mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-14 03:35:54 -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
|
||||
just being started.
|
||||
-}
|
||||
safeSpawn :: FilePath -> String -> X ()
|
||||
safeSpawn prog arg = io (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ())
|
||||
unsafeSpawn :: String -> X ()
|
||||
safeSpawn :: MonadIO m => FilePath -> String -> m ()
|
||||
safeSpawn prog arg = liftIO (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ())
|
||||
unsafeSpawn :: MonadIO m => String -> m ()
|
||||
unsafeSpawn = spawn
|
||||
|
||||
-- | Run a given program in the preferred terminal emulator. This uses safeSpawn.
|
||||
|
Reference in New Issue
Block a user