diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-16 04:55:41 +0200 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-16 04:55:41 +0200 |
commit | 9cc08d835d62f899f9f9937b908c20512feb078a (patch) | |
tree | 1049d3bafebc5b8cec1fee5285ecf0f169ad6821 | |
parent | f260cd01e096221707bf0a870be4d8b75e4e5958 (diff) | |
download | metatile-9cc08d835d62f899f9f9937b908c20512feb078a.tar metatile-9cc08d835d62f899f9f9937b908c20512feb078a.zip |
test for xmonad in path first, before restarting
darcs-hash:20070416025541-9c5c1-16be9a7ee5e4d1c3d319be7890f0812c56986116
-rw-r--r-- | Operations.hs | 10 |
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 |