XMonad startup on different workspaces

匆匆过客 提交于 2019-12-24 01:24:25

问题


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 classNames might vary, though.



来源:https://stackoverflow.com/questions/13279791/xmonad-startup-on-different-workspaces

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!