XMonad spawn programs on startup in specified workspace

房东的猫 提交于 2019-11-28 02:58:52

问题


I am trying to configure my xmonad.hs so that when I start my session I start an array of different programs on different workspaces (like Terminal in 1 ; Firefox in 2 ; Pidgin in 3).

I already looked into the XMonad.Actions.SpawnOn, but as spawnOn returns with an X () and not with a common m () I can not use it in main = do ....

Is there a function that takes an X-monad and returns with IO () or is there another workaround?


回答1:


The common way is to use startupHook which takes X () action and performs it on each startup. E.g.

main = xmonad $ defaultConfig
  { startupHook = do
      spawnOn "workspace1" "program1"
      …
      spawnOn "workspaceN" "programN"
  }


来源:https://stackoverflow.com/questions/10976044/xmonad-spawn-programs-on-startup-in-specified-workspace

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