From d148ed202ba2ead69556232f09973cf998e093b0 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 16 Apr 2007 04:55:41 +0200 Subject: test for xmonad in path first, before restarting darcs-hash:20070416025541-9c5c1-16be9a7ee5e4d1c3d319be7890f0812c56986116.gz --- Operations.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Operations.hs') 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 -- cgit v1.2.3