Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XMonad spawn programs on startup in specified workspace

Tags:

haskell

xmonad

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?

like image 235
salbeira Avatar asked Jun 11 '12 07:06

salbeira


1 Answers

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"
  }
like image 89
Matvey Aksenov Avatar answered Nov 16 '22 02:11

Matvey Aksenov