mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-13 11:16:01 -07:00
Generalize safe/unsafeSpawn to MonadIO
This commit is contained in:
@@ -104,9 +104,9 @@ seconds = fromEnum . (* 1000000)
|
|||||||
$HOME and interpolation, whereas the safeSpawn example can be safe because Firefox doesn't need any arguments if it is
|
$HOME and interpolation, whereas the safeSpawn example can be safe because Firefox doesn't need any arguments if it is
|
||||||
just being started.
|
just being started.
|
||||||
-}
|
-}
|
||||||
safeSpawn :: FilePath -> String -> X ()
|
safeSpawn :: MonadIO m => FilePath -> String -> m ()
|
||||||
safeSpawn prog arg = io (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ())
|
safeSpawn prog arg = liftIO (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ())
|
||||||
unsafeSpawn :: String -> X ()
|
unsafeSpawn :: MonadIO m => String -> m ()
|
||||||
unsafeSpawn = spawn
|
unsafeSpawn = spawn
|
||||||
|
|
||||||
-- | Run a given program in the preferred terminal emulator. This uses safeSpawn.
|
-- | Run a given program in the preferred terminal emulator. This uses safeSpawn.
|
||||||
|
Reference in New Issue
Block a user