summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--XMonad.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/XMonad.hs b/XMonad.hs
index 4d33569..d18e9f1 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -29,7 +29,6 @@ import System.IO
import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession)
import System.Exit
import System.Environment
-import System.Directory
import Graphics.X11.Xlib
import Data.Typeable
@@ -146,11 +145,8 @@ spawn x = io $ do
restart :: X ()
restart = io $ do
prog <- getProgName
- prog_path <- findExecutable prog
- case prog_path of
- Nothing -> return () -- silently fail
- Just p -> do args <- getArgs
- executeFile p True args Nothing
+ args <- getArgs
+ catch (executeFile prog True args Nothing) (const $ return ())
-- | Run a side effecting action with the current workspace. Like 'when' but
whenJust :: Maybe a -> (a -> X ()) -> X ()