summaryrefslogtreecommitdiffstats
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
commit5341c579b074e3e0ead3f6be224f1dd9c354139e (patch)
treed417422f540a9390e2864584ae174c05abf87930
parent670bef2d339a1e4c4e204e739663f5ae4014ca1f (diff)
downloadmetatile-5341c579b074e3e0ead3f6be224f1dd9c354139e.tar
metatile-5341c579b074e3e0ead3f6be224f1dd9c354139e.zip
Fix forking issues, add unix dependency.
darcs-hash:20070313153310-a5988-47512502a33b3b003a6a3106ad730e61cbd0d548
-rw-r--r--README1
-rw-r--r--XMonad.hs5
-rw-r--r--xmonad.cabal2
3 files changed, 4 insertions, 4 deletions
diff --git a/README b/README
index 5daa2fe..7483c43 100644
--- a/README
+++ b/README
@@ -15,6 +15,7 @@ Building:
X11 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/X11-1.2
mtl http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mtl-1.0
+ unix http://hackage.haskell.org/cgi-bin/hackage-scripts/package/unix-2.0 (included with ghc)
X11-extras: darcs get http://darcs.haskell.org/~sjanssen/X11-extras
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 ()
diff --git a/xmonad.cabal b/xmonad.cabal
index cf8ff84..d0f11d2 100644
--- a/xmonad.cabal
+++ b/xmonad.cabal
@@ -7,7 +7,7 @@ license: BSD3
license-file: LICENSE
author: Spencer Janssen
maintainer: sjanssen@cse.unl.edu
-build-depends: base==2.0, X11>=1.1, X11-extras==0.0, mtl==1.0
+build-depends: base==2.0, X11>=1.1, X11-extras==0.0, mtl==1.0, unix>=1.0
executable: xmonad
main-is: Main.hs