aboutsummaryrefslogtreecommitdiffstats
path: root/Run.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Run.hs')
-rw-r--r--Run.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Run.hs b/Run.hs
index 5d61110..c3ed501 100644
--- a/Run.hs
+++ b/Run.hs
@@ -22,10 +22,12 @@ module XMonadContrib.Run (
runProcessWithInputAndWait,
safeSpawn,
unsafeSpawn,
+ runInXTerm,
seconds
) where
import Control.Monad.State (Monad((>>), return), when)
+import System.Environment (getEnv)
import System.Posix.Process (createSession, forkProcess, executeFile,
getProcessStatus)
import Control.Concurrent (threadDelay)
@@ -102,3 +104,8 @@ safeSpawn :: FilePath -> String -> X ()
safeSpawn prog arg = io (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ())
unsafeSpawn :: String -> X ()
unsafeSpawn = spawn
+
+runInXTerm :: String -> X ()
+runInXTerm com = do
+ c <- io $ catch (getEnv "XTERMCMD") (const $ return "xterm")
+ spawn ("exec " ++ c ++ " -e " ++ com)