diff options
author | gwern0 <gwern0@gmail.com> | 2009-06-22 21:30:18 +0200 |
---|---|---|
committer | gwern0 <gwern0@gmail.com> | 2009-06-22 21:30:18 +0200 |
commit | 7ae328264c8dbf87125c2375651ccdd74a67e1a9 (patch) | |
tree | 16a657e9e9aa4c62876a7bb5307fa68c6e7ab248 | |
parent | 8e6012c832ccdb5750d92eaf77a6edb00d65d38c (diff) | |
download | XMonadContrib-7ae328264c8dbf87125c2375651ccdd74a67e1a9.tar.gz XMonadContrib-7ae328264c8dbf87125c2375651ccdd74a67e1a9.tar.xz XMonadContrib-7ae328264c8dbf87125c2375651ccdd74a67e1a9.zip |
XMonad.Util.Run: +convenience function for safeSpawn which drops args to the prog
Ignore-this: fc48265f252e015ffdc1792c6c9eaa12
darcs-hash:20090622193018-f7719-e9d8d69d38b45f944c2a3c090dd0c47d09887013.gz
-rw-r--r-- | XMonad/Util/Run.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs index 700ee3c..f0be837 100644 --- a/XMonad/Util/Run.hs +++ b/XMonad/Util/Run.hs @@ -21,6 +21,7 @@ module XMonad.Util.Run ( runProcessWithInput, runProcessWithInputAndWait, safeSpawn, + safeSpawnProg, unsafeSpawn, runInTerm, safeRunInTerm, @@ -109,6 +110,12 @@ Firefox doesn't need any arguments if it is just being started. -} safeSpawn :: MonadIO m => FilePath -> String -> m () safeSpawn prog arg = liftIO (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ()) +-- | Like 'safeSpawn', but only takes a program (and no arguments for it). eg. +-- +-- > safeSpawnProg "firefox" +safeSpawnProg :: MonadIO m => FilePath -> m () +safeSpawnProg = flip safeSpawn "" + unsafeSpawn :: MonadIO m => String -> m () unsafeSpawn = spawn |