aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-16 04:55:41 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-16 04:55:41 +0200
commitd148ed202ba2ead69556232f09973cf998e093b0 (patch)
tree1049d3bafebc5b8cec1fee5285ecf0f169ad6821
parentadf7a9f01247a51aa5f4640bfe86a230864c0b65 (diff)
downloadxmonad-d148ed202ba2ead69556232f09973cf998e093b0.tar.gz
xmonad-d148ed202ba2ead69556232f09973cf998e093b0.tar.xz
xmonad-d148ed202ba2ead69556232f09973cf998e093b0.zip
test for xmonad in path first, before restarting
darcs-hash:20070416025541-9c5c1-16be9a7ee5e4d1c3d319be7890f0812c56986116.gz
Diffstat (limited to '')
-rw-r--r--Operations.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Operations.hs b/Operations.hs
index def5339..418d4ea 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -22,6 +22,7 @@ import Control.Arrow
import System.Posix.Process
import System.Environment
+import System.Directory
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras
@@ -276,6 +277,9 @@ isClient w = liftM (W.member w) (gets workspace)
-- to be in PATH for this to work.
restart :: IO ()
restart = do
- prog <- getProgName
- args <- getArgs
- executeFile prog True args Nothing
+ prog <- getProgName
+ prog_path <- findExecutable prog
+ case prog_path of
+ Nothing -> return () -- silently fail
+ Just p -> do args <- getArgs
+ executeFile p True args Nothing