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 | d148ed202ba2ead69556232f09973cf998e093b0 (patch) | |
tree | 1049d3bafebc5b8cec1fee5285ecf0f169ad6821 | |
parent | adf7a9f01247a51aa5f4640bfe86a230864c0b65 (diff) | |
download | xmonad-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.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 |