summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins
diff options
context:
space:
mode:
authorEric Mrak <mail@ericmrak.info>2014-05-29 23:19:23 -0700
committerEric Mrak <mail@ericmrak.info>2014-05-29 23:19:41 -0700
commit0c73b9179e618684d5d3325c70ff69ba6ce3fcd0 (patch)
treeedcffc4b086142c41b84b8f16ac6dd47c4be012f /src/Plugins
parentef990c7a4715cdc8a7e322ab2fb8581f1a911b92 (diff)
downloadxmobar-0c73b9179e618684d5d3325c70ff69ba6ce3fcd0.tar.gz
xmobar-0c73b9179e618684d5d3325c70ff69ba6ce3fcd0.tar.bz2
Adding UnsafeXMonadLog, similar to UnsafeStdinReader
Diffstat (limited to 'src/Plugins')
-rw-r--r--src/Plugins/XMonadLog.hs9
1 files changed, 8 insertions, 1 deletions
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