问题
I want to startup some applications in different workspaces(it is important) on xmonad start. So, I wrote following startupHook
:
startupApps :: [String]
startupApps = ["konsole", "emacs", "firefox", "gvim", "konsole"]
startupSpawn :: X ()
startupSpawn = zipWithM_ id (map (spawnOn . show) [1..]) startupApps
But, it spawns all apps in first workspace. It seems to be part of more general problem -- if I start application, it get workspace not when it actually started, but when it loaded. So, if I start firefox on WS1, then switch to WS2, firefox will spawn on WS2.
Still, what can I do about my intention?
回答1:
You can use the manageHook to tell xmonad to move certain applications to certain desktops.
myManageHook = composeAll . concat $ [
[ className =? "Firefox" --> doF (shiftToWs 2) ]
, [ className =? "gvim" --> doF (shiftToWs 3) ]
-- and so on
]
The className
s might vary, though.
来源:https://stackoverflow.com/questions/13279791/xmonad-startup-on-different-workspaces