aboutsummaryrefslogtreecommitdiffstats
path: root/Dmenu.hs
diff options
context:
space:
mode:
authorChristian Thiemann <mail@christian-thiemann.de>2007-10-12 16:52:33 +0200
committerChristian Thiemann <mail@christian-thiemann.de>2007-10-12 16:52:33 +0200
commitc5f7a0ab918ee2e4296263b447157ea3bfcf180e (patch)
tree6fedead21ca002adbdf4eec36509bc8baf4b16b6 /Dmenu.hs
parentc3d8c3ed79f56ed5b7b57684b6d2c9e40b9e0f57 (diff)
downloadXMonadContrib-c5f7a0ab918ee2e4296263b447157ea3bfcf180e.tar.gz
XMonadContrib-c5f7a0ab918ee2e4296263b447157ea3bfcf180e.tar.xz
XMonadContrib-c5f7a0ab918ee2e4296263b447157ea3bfcf180e.zip
Move runXXX functions to one module
This patch takes runProcessWithInput out of Dmenu, runProcessWithInputAndWait out of Dzen, and runInXTerm out of RunInXTerm and collects them in one central module called Run. This way, other modules may include Run instead of Dmenu to get what they want without giving the impression of making use of dmenu. darcs-hash:20071012145233-8602e-6f8fb66c62afecdbd52a6a9122b5ecb55fc7f8bc.gz
Diffstat (limited to 'Dmenu.hs')
-rw-r--r--Dmenu.hs20
1 files changed, 2 insertions, 18 deletions
diff --git a/Dmenu.hs b/Dmenu.hs
index 1b6d7e6..fd68446 100644
--- a/Dmenu.hs
+++ b/Dmenu.hs
@@ -17,16 +17,14 @@
module XMonadContrib.Dmenu (
-- * Usage
-- $usage
- dmenu, dmenuXinerama, dmenuMap,
- runProcessWithInput
+ dmenu, dmenuXinerama, dmenuMap
) where
import XMonad
import qualified StackSet as W
import qualified Data.Map as M
-import System.Process
-import System.IO
import Control.Monad.State
+import XMonadContrib.Run
-- $usage
-- You can use this module with the following in your Config.hs file:
@@ -35,20 +33,6 @@ import Control.Monad.State
-- %import XMonadContrib.Dmenu
--- | Returns Just output if the command succeeded, and Nothing if it didn't.
--- This corresponds to dmenu's notion of exit code 1 for a cancelled invocation.
-runProcessWithInput :: FilePath -> [String] -> String -> IO String
-runProcessWithInput cmd args input = do
- (pin, pout, perr, ph) <- runInteractiveProcess cmd args Nothing Nothing
- hPutStr pin input
- hClose pin
- output <- hGetContents pout
- when (output==output) $ return ()
- hClose pout
- hClose perr
- waitForProcess ph
- return output
-
-- | Starts dmenu on the current screen. Requires this patch to dmenu:
-- <http://www.jcreigh.com/dmenu/dmenu-3.2-xinerama.patch>
dmenuXinerama :: [String] -> X String