aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-03-13 16:33:10 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-03-13 16:33:10 +0100
commit43a9e5f204d7df44304388e08fb1499e5b9e6c63 (patch)
treed417422f540a9390e2864584ae174c05abf87930 /XMonad.hs
parentf2549902a0759eb7f556fe14d53295a68da4a7d6 (diff)
downloadxmonad-43a9e5f204d7df44304388e08fb1499e5b9e6c63.tar.gz
xmonad-43a9e5f204d7df44304388e08fb1499e5b9e6c63.tar.xz
xmonad-43a9e5f204d7df44304388e08fb1499e5b9e6c63.zip
Fix forking issues, add unix dependency.
darcs-hash:20070313153310-a5988-47512502a33b3b003a6a3106ad730e61cbd0d548.gz
Diffstat (limited to '')
-rw-r--r--XMonad.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/XMonad.hs b/XMonad.hs
index a628fd0..670fdd1 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -24,7 +24,7 @@ import StackSet (StackSet)
import Control.Monad.State
import System.IO
-import System.Process (runCommand)
+import System.Posix.Process (newSession, executeFile)
import Graphics.X11.Xlib
import Control.Exception
@@ -73,8 +73,7 @@ io = liftIO
-- | spawn. Launch an external application
spawn :: String -> X ()
-spawn x = do v <- io $ handle (return . Just) (runCommand x >> return Nothing)
- whenJust v $ \e -> trace $ "xmonad:spawn: unable to fork "++show x++": "++show e
+spawn x = io $ forkProcess (do newSession; executeFile "/bin/sh" False ["-c", x] Nothing)
-- | Run a side effecting action with the current workspace. Like 'when' but
whenJust :: Maybe a -> (a -> X ()) -> X ()