[xmonad] waitForProcess error on startup

Joseph Garvin joseph.h.garvin at gmail.com
Mon Feb 14 01:21:56 CET 2011


I've written a shell script that chooses which browser I would prefer
to run based on what's available on my machine. In my xmonad.hs I use
readProcess to get the name at startup, and then bind a key to running
that name. On my Solaris machine, with an older GHC, this works
perfectly, but on my Ubuntu machine with a newer GHC it gives an error
at startup:

xmonad-x86_64-linux: waitForProcess: does not exist (No child processes)

Maybe it tries to get the pid of the child after launching the script
but it executes too fast? Here's the snippet from xmonad.hs:

main = do
  home_folder <- getEnv "HOME"
  editor  <- getEditor
  browser_name <- (readProcess (joinPath [home_folder,
"etc/utils/pick_best_browser"]) ["-n"] [])
  xmonad $ defaults editor home_folder ((head . lines) browser_name)

The script when I run it gives this output:

/usr/bin/chromium-browser

And when I run it with the -n flag like I'm passing above:

chromium-browser

Which is exactly the output I expect. Since it all works fine on a
another box I don't think it's anything wrong with the script -- I
figured it could be an environment problem but it only relies on
$HOME.

Any ideas?

Thanks,

Joe G.



More information about the xmonad mailing list