I know that it's possible to set certain programs to spawn in certain workspaces like so:
myManageHook = composeAll
[ classname =? "XTerm" --> doShift "3" ]
main = xmonad $ defaultConfig
{ manageHook = myManageHook <+> manageHook defaultConfig }
So that all instances of Xterm
will spawn in workspace "3". What I want to do is make all new programs spawn in the workspace which is in focus when they are started, such that if, for example, I'm in workspace "1" and start firefox, then quickly switch to workspace "2", the firefox window will stay in workspace "1".
I was thinking of something to the effect of
import qualified XMonad.StackSet as W
myManageHook = composeAll
[ classname =? ".*" --> doShift currentTag ]
main = xmonad $ defaultConfig
{ manageHook = myManageHook <+> manageHook defaultConfig }
which obviously doesn't work, but hopefully you get the idea.
My question is quite similar to this one in intent, but I want all programs to spawn in the intially focused workspace however I open them (dmenu, from a terminal, etc.)
program[firefox] = firefox
bind[firefox] = MOD+f
– Triune_NET_WM_PID
,_SWM_PID
,_SWM_WS
, and whether the window is a transient with a parent. (xmonad offers ways to check such stuff, too.) The code snippet I posted doesn't set any of these properties and does not create a transient window: it offers no cooperation. Which is why I say I'm stumped! – Bernardobernarr