mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
RunInXTerm: a simple module to run commands in an X terminal
This is just a wrapper around spawn to launch commands in an X terminal: runInXTerm will check the for the XTERMCMD environmental variable, and use it to run the command. If the variable is not set the command will be executed with xterm.
This commit is contained in:
parent
686328c517
commit
71d75dcd7d
31
RunInXTerm.hs
Normal file
31
RunInXTerm.hs
Normal file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user