summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-05-21 21:19:00 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-05-21 21:19:00 +0200
commite6dce1b6b829c593dbc416e1b00efc19b5263008 (patch)
tree0ec899e7b537ebc1ceb69e1dec1ef7b165fe5483
parent4672491cdad0680c59451a4c15e38270cf0f472c (diff)
downloadmetatile-e6dce1b6b829c593dbc416e1b00efc19b5263008.tar
metatile-e6dce1b6b829c593dbc416e1b00efc19b5263008.zip
Catch the exception rather than explicitly checking the PATH
darcs-hash:20070521191900-a5988-ef2361014d1d8c27cd8c73d290cdeff13ee38df6
-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 ()