From 0c73b9179e618684d5d3325c70ff69ba6ce3fcd0 Mon Sep 17 00:00:00 2001 From: Eric Mrak Date: Thu, 29 May 2014 23:19:23 -0700 Subject: Adding UnsafeXMonadLog, similar to UnsafeStdinReader --- src/Plugins/XMonadLog.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Plugins/XMonadLog.hs b/src/Plugins/XMonadLog.hs index 8f63dc9..b424565 100644 --- a/src/Plugins/XMonadLog.hs +++ b/src/Plugins/XMonadLog.hs @@ -31,20 +31,27 @@ import XUtil (nextEvent') import Actions (stripActions) data XMonadLog = XMonadLog + | UnsafeXMonadLog | XPropertyLog String | NamedXPropertyLog String String deriving (Read, Show) instance Exec XMonadLog where alias XMonadLog = "XMonadLog" + alias UnsafeXMonadLog = "UnsafeXMonadLog" alias (XPropertyLog atom) = atom alias (NamedXPropertyLog _ name) = name start x cb = do let atom = case x of XMonadLog -> "_XMONAD_LOG" + UnsafeXMonadLog -> "_XMONAD_LOG" XPropertyLog a -> a NamedXPropertyLog a _ -> a + sanitize = case x of + UnsafeXMonadLog -> id + _ -> stripActions + d <- openDisplay "" xlog <- internAtom d atom False @@ -53,7 +60,7 @@ instance Exec XMonadLog where let update = do mwp <- getWindowProperty8 d xlog root - maybe (return ()) (cb . stripActions. decodeCChar) mwp + maybe (return ()) (cb . sanitize . decodeCChar) mwp update -- cgit v1.2.3