Today I was looking for a solution how to disable the urgency hint for programs which I automatically launch in my i3 config file on startup.

I have saved the layout of my workspace number 2 (see https://i3wm.org/docs/layout-saving.html for the docs) and in my i3 config I attach that layout to workspace number 2 and I also launch some programs (applications) there. Then I let i3-msg switch to workspace 1 so I see the wallpaper. But the launched programs on workspace 2 launch just after that (I guess a few milliseconds later) so they are not focused and i3 changes the workspace color to red, which is annoying because I have to switch to workspace 2 and back to workspace 1 to get rid of the red color.

Solution: put this Bash script to your i3 config folder, in my case the full path is ~/.config/i3/urgency_off.sh and make the file executable.

#!/bin/sh
# Disable urgency hint of all opened windows on i3wm startup.
# Add it to i3 config as exec.

sleep 2

for i in $(xdotool search --class .\*)
do
	xdotool set_window --urgency 0 $i
done

Then put this line at the end of your ~/.config/i3/config file:

exec --no-startup-id ~/.config/i3/urgency_off.sh

Make sure you have xdotool installed. On Debian-based systems you can install it simply with apt install xdotool. If you use Wayland instead of X you may need to use another tool.