How do I implement the no_focus directive in i3wm and how do I dynamically assign a program to a workspace based on the workspace where I key the binding to open the program (i.e., I press the keybinding on
workspace n and it opens on
workspace n even if my focus has changed to
workspace n + 1 before the program has fully loaded)?
Context: I have a handful of keybindings in i3wm (i3-gaps on Arch, to be specific) that I use, e.g.
bindsym $mod+Shift+W exec chromium bindsym $mod+Shift+I exec chromium --incognito bindsym $mod+Shift+F exec firefox
But I dislike the focus stealing of newly opened windows and especially dislike the behavior where I'm on
workspace n, jump to
workspace n + 1 to hit my keybinding, jump back to
workspace n to continue performing some task in terminal while I wait for the program to load, and, lo, the program loads on my current
workspace n instead of
workspace n + 1 where I hit the keybinding.
I have found this explanation in the i3wm documentation discussing exactly what I want in terms of window focusing but cannot find a single example command that I can modify:
no_focus [window_role="pop-up"], the example they give, does not make sense to me. I have tried
exec no_focus chromium,
no_focus exec chromium and a handful of less sensible combinations and none of them seem to work: I do not know how to implement the command.
I also am unsure, once I get it to work, if keying in a binding on a work space will force the program to open on that work space rather than following me to my new workspace. I know of workspace assignment (never implemented it, but that is another question) but would prefer to have a dynamic workspace assignment like I've been detailing: workspace assignment based on the workspace the keybinding is executed.