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.)