[xmonad] X () with side effects

Jochen Keil jochen.keil at gmail.com
Sun Aug 14 12:05:32 CEST 2011


Hello,

I am trying to write a function which has side-effects, e.g. call spawn.

foo :: X ()
foo = do
  io $ spawn "myprogram"
  doSomethingElseOrReturn
  foo -- recursion

However, if I call foo from a keybinding

((modMask, xK_x), foo)

the spawned program will run but not mapped. This means that I can see
the console output in xmonad stdout/stderr but the window will not pop
up. I think this is because of the internal handling of keyevents in
xmonads main. Is there a way I could bypass this and have my windows
mapped as soon as I call the program with spawn?

I hope this is clear enough.. if not, I'll come back with the actual
code I have written. It's some kind of of vi-mode behaviour for xmonad.
Pure X actions (like focusing up/down) work without problems but
spawning doesn't.

Many thanks and best regards,

Jochen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20110814/8bbc8648/attachment.pgp>


More information about the xmonad mailing list