aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/Run.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-02-05 04:18:24 +0100
committergwern0 <gwern0@gmail.com>2008-02-05 04:18:24 +0100
commiteacbec4b7e012eca16b616fae36134a444a8f6a3 (patch)
tree6b38537e9e89f341c87e8a980d7e037a25e7a211 /XMonad/Util/Run.hs
parent459d5887fd0e5ede4c3e2773a5cddcacaa62820e (diff)
downloadXMonadContrib-eacbec4b7e012eca16b616fae36134a444a8f6a3.tar.gz
XMonadContrib-eacbec4b7e012eca16b616fae36134a444a8f6a3.tar.xz
XMonadContrib-eacbec4b7e012eca16b616fae36134a444a8f6a3.zip
Run.hs: add an option to runinterms
It turns out that for urxvt, and most terminal, apparently, once you give a '-e' option, that's it. They will not interpret anything after that as anything but input for /bin/sh, so if you wanted to go 'runInTerm "'screen -r session' -title IRC"', you were SOL - the -title would not be seen by urxvt. This, needless to say, is bad, since then you can't do stuff like set the title which means various hooks and extensions are helpless. This patch adds an extra options argument which is inserted *before* the -e. If you want the old behaivour, you can just go 'runInTerm "" "executable"', but now if you need to do something extra, 'runInTerm "-title mutt" "mutt"' works fine. This patch also updates callers. darcs-hash:20080205031824-f7719-ca5117c1b75f6667459273be2613bc29e8cbbacb.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Util/Run.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs
index face2d8..1f544f2 100644
--- a/XMonad/Util/Run.hs
+++ b/XMonad/Util/Run.hs
@@ -56,7 +56,7 @@ runProcessWithInput cmd args input = do
hPutStr pin input
hClose pin
output <- hGetContents pout
- when (output==output) $ return ()
+ when (output == output) $ return ()
hClose pout
hClose perr
waitForProcess ph
@@ -112,11 +112,11 @@ unsafeSpawn = spawn
-- | Run a given program in the preferred terminal emulator. This uses
-- 'safeSpawn'.
-safeRunInTerm :: String -> X ()
-safeRunInTerm command = asks (terminal . config) >>= \t -> safeSpawn t ("-e " ++ command)
+safeRunInTerm :: String -> String -> X ()
+safeRunInTerm options command = asks (terminal . config) >>= \t -> safeSpawn t (options ++ " -e " ++ command)
-unsafeRunInTerm, runInTerm :: String -> X ()
-unsafeRunInTerm command = asks (terminal . config) >>= \t -> unsafeSpawn $ t ++ " -e " ++ command
+unsafeRunInTerm, runInTerm :: String -> String -> X ()
+unsafeRunInTerm options command = asks (terminal . config) >>= \t -> unsafeSpawn $ t ++ " " ++ options ++ " -e " ++ command
runInTerm = unsafeRunInTerm
-- | Launch an external application and return a 'Handle' to its standard input.