From 7ae328264c8dbf87125c2375651ccdd74a67e1a9 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Mon, 22 Jun 2009 21:30:18 +0200 Subject: XMonad.Util.Run: +convenience function for safeSpawn which drops args to the prog Ignore-this: fc48265f252e015ffdc1792c6c9eaa12 darcs-hash:20090622193018-f7719-e9d8d69d38b45f944c2a3c090dd0c47d09887013.gz --- XMonad/Util/Run.hs | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3