
17 Sep
2009
17 Sep
'09
7:50 p.m.
I was able to get this working, and the (noticeable) timeout has gone, after some help in IRC. The problem was that the rawSystem call was blocking. The following did the trick: [...] import System.Environment import System.Cmd import Control.Concurrent [...] main = do env <- getEnvironment case lookup "DESKTOP_AUTOSTART_ID" env of Just id -> do forkIO $ (>> return ()) $ rawSystem "dbus-send" ["--session","--print-reply=string","--dest=org.gnome.SessionManager","/org/gnome/SessionManager","org.gnome.SessionManager.RegisterClient","string:xmonad","string:"++id] return () Nothing -> return () xmonad $ defaultConfig { [...] -- simple stuff }