[xmonad] forkIO & xmonad

Nils ml at n-sch.de
Sat Oct 24 09:42:14 EDT 2009

Hi there,

I'm trying to write a little status bar extension, which allows
X.U.Loggers (and other) to be piped into dzen2 which then gets updated
every X seconds (the dynamicLogHooks update only after an xmonad event).
So I thought, forkIO with a threadDelay should do the job, but something
weird happened.

The code is: http://paste.n-sch.de/0y/hs

Then run it with:

> main = do
>   runStatusbar $ defaultStatusBar "dzen"
>   xmonad $ ...

If I start xmonad like this, the forked process stops after a short
amount of time and continues only when I hit some xmonad-keybindings
(even that happens pretty random). For example, if I remove the
threadDelay from the previous code, you would expect to have a never
ending counter in your dzen bar. But it starts counting up to about
10000, stops and waits for some input and (maybe) continues counting for
another 1000 or 2000.

Can anyone see why xmonad acts like this with forkIO?


Nils / McManiaC

More information about the xmonad mailing list