aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--XMonad/Util/Loggers.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/XMonad/Util/Loggers.hs b/XMonad/Util/Loggers.hs
index 35892fd..4c879a7 100644
--- a/XMonad/Util/Loggers.hs
+++ b/XMonad/Util/Loggers.hs
@@ -83,6 +83,5 @@ battery = logCmd "/usr/bin/acpi | sed -r 's/.*?: (.*%).*/\\1/; s/discharging, ([
-- | Create a 'Logger' from an arbitrary shell command.
logCmd :: String -> Logger
logCmd c = io $ do (_, out, _, _) <- runInteractiveCommand c
- output <- hGetLine out
+ fmap Just (hGetLine out) `catch` (const $ return Nothing)
-- no need to waitForProcess, we ignore SIGCHLD
- return $ Just output