diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-06-05 00:23:32 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-06-05 00:23:32 +0200 |
commit | 85fdac20a36675559802dd215a81f640b91693fe (patch) | |
tree | 8fff8ccb15e611547f9501cd53fd569917769510 /src/Plugins/StdinReader.hs | |
parent | 3d1fe35837bc756a96f8bf529455794bc1ac7d8b (diff) | |
download | xmobar-85fdac20a36675559802dd215a81f640b91693fe.tar.gz xmobar-85fdac20a36675559802dd215a81f640b91693fe.tar.bz2 |
Stripping actions in stdin and xprop plugins
Diffstat (limited to 'src/Plugins/StdinReader.hs')
-rw-r--r-- | src/Plugins/StdinReader.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Plugins/StdinReader.hs b/src/Plugins/StdinReader.hs index fddd0bc..f242f93 100644 --- a/src/Plugins/StdinReader.hs +++ b/src/Plugins/StdinReader.hs @@ -20,15 +20,16 @@ import System.Exit import System.IO import Control.Exception (SomeException(..), handle) import Plugins +import Actions (stripActions) -data StdinReader = StdinReader - deriving (Read, Show) +data StdinReader = StdinReader deriving (Read, Show) instance Exec StdinReader where - start StdinReader cb = do - cb =<< handle (\(SomeException e) -> do hPrint stderr e; return "") - (hGetLineSafe stdin) - eof <- hIsEOF stdin - if eof - then exitImmediately ExitSuccess - else start StdinReader cb + start StdinReader cb = do + s <- handle (\(SomeException e) -> do hPrint stderr e; return "") + (hGetLineSafe stdin) + cb (stripActions s) + eof <- hIsEOF stdin + if eof + then exitImmediately ExitSuccess + else start StdinReader cb |