aboutsummaryrefslogtreecommitdiffstats
path: root/RunInXTerm.hs
diff options
context:
space:
mode:
Diffstat (limited to 'RunInXTerm.hs')
-rw-r--r--RunInXTerm.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/RunInXTerm.hs b/RunInXTerm.hs
new file mode 100644
index 0000000..3b88858
--- /dev/null
+++ b/RunInXTerm.hs
@@ -0,0 +1,31 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : XMonadContrib.RunInXTerm
+-- Copyright : (C) 2007 Andrea Rossato
+-- License : BSD3
+--
+-- Maintainer : andrea.rossato@unibz.it
+-- Stability : unstable
+-- Portability : unportable
+--
+-- A simple module to launch commands in an X terminal
+-- from XMonad
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.RunInXTerm (
+ -- * Usage
+ -- $usage
+ runInXTerm
+ ) where
+
+import XMonad
+import System.Environment
+
+-- $usage
+-- For an example usage see SshPrompt
+
+runInXTerm :: String -> X ()
+runInXTerm com = do
+ c <- io $ catch (getEnv "XTERMCMD") (const $ return "xterm")
+ spawn ("exec " ++ c ++ " -e " ++ com)