summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins')
-rw-r--r--src/Plugins/StdinReader.hs19
-rw-r--r--src/Plugins/XMonadLog.hs8
2 files changed, 15 insertions, 12 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
diff --git a/src/Plugins/XMonadLog.hs b/src/Plugins/XMonadLog.hs
index 1403800..8f63dc9 100644
--- a/src/Plugins/XMonadLog.hs
+++ b/src/Plugins/XMonadLog.hs
@@ -28,9 +28,11 @@ import Codec.Binary.UTF8.String as UTF8
#endif
import Foreign.C (CChar)
import XUtil (nextEvent')
+import Actions (stripActions)
-
-data XMonadLog = XMonadLog | XPropertyLog String | NamedXPropertyLog String String
+data XMonadLog = XMonadLog
+ | XPropertyLog String
+ | NamedXPropertyLog String String
deriving (Read, Show)
instance Exec XMonadLog where
@@ -51,7 +53,7 @@ instance Exec XMonadLog where
let update = do
mwp <- getWindowProperty8 d xlog root
- maybe (return ()) (cb . decodeCChar) mwp
+ maybe (return ()) (cb . stripActions. decodeCChar) mwp
update