From ab7d4a946f053a77c007923c0dec4fd2409c825e Mon Sep 17 00:00:00 2001 From: gwern0 Date: Fri, 19 Oct 2007 20:09:53 +0200 Subject: Run.hs: fmt darcs-hash:20071019180953-f7719-0e7101b3e3a3378d43807d080aae8de74ffb3802.gz --- Run.hs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Run.hs b/Run.hs index 7fd9ff7..2eb16d4 100644 --- a/Run.hs +++ b/Run.hs @@ -3,7 +3,7 @@ -- Module : XMonadContrib.Run -- Copyright : (C) 2007 Spencer Janssen, Andrea Rossato, glasser@mit.edu -- License : BSD-style (see LICENSE) --- +-- -- Maintainer : Christian Thiemann -- Stability : unstable -- Portability : unportable @@ -23,15 +23,15 @@ module XMonadContrib.Run ( seconds ) where -import XMonad +import Control.Monad.State (Monad((>>), return), when) +import System.Posix.Process (createSession, forkProcess, executeFile, + getProcessStatus) import Control.Concurrent (threadDelay) -import Control.Monad.State -import System.Environment -import System.Exit -import System.IO -import System.Posix.Process (forkProcess, getProcessStatus, createSession) -import System.Process - +import Control.Exception (try) +import System.Exit (ExitCode(ExitSuccess), exitWith) +import System.IO (IO, FilePath, hPutStr, hGetContents, hFlush, hClose) +import System.Process (runInteractiveProcess, waitForProcess) +import XMonad (X, io, spawn) -- $usage -- For an example usage of runInXTerm see XMonadContrib.SshPrompt @@ -66,8 +66,6 @@ runProcessWithInputAndWait cmd args input timeout = do hFlush pin threadDelay timeout hClose pin - -- output <- hGetContents pout - -- when (output==output) $ return () hClose pout hClose perr waitForProcess ph -- cgit v1.2.3