summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/XMonadLog.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/XMonadLog.hs')
-rw-r--r--src/Plugins/XMonadLog.hs21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/Plugins/XMonadLog.hs b/src/Plugins/XMonadLog.hs
index 8f63dc9..158b7ef 100644
--- a/src/Plugins/XMonadLog.hs
+++ b/src/Plugins/XMonadLog.hs
@@ -31,20 +31,35 @@ import XUtil (nextEvent')
import Actions (stripActions)
data XMonadLog = XMonadLog
+ | UnsafeXMonadLog
| XPropertyLog String
+ | UnsafeXPropertyLog String
| NamedXPropertyLog String String
+ | UnsafeNamedXPropertyLog String String
deriving (Read, Show)
instance Exec XMonadLog where
alias XMonadLog = "XMonadLog"
+ alias UnsafeXMonadLog = "UnsafeXMonadLog"
alias (XPropertyLog atom) = atom
alias (NamedXPropertyLog _ name) = name
+ alias (UnsafeXPropertyLog atom) = atom
+ alias (UnsafeNamedXPropertyLog _ name) = name
start x cb = do
let atom = case x of
- XMonadLog -> "_XMONAD_LOG"
- XPropertyLog a -> a
+ XMonadLog -> "_XMONAD_LOG"
+ UnsafeXMonadLog -> "_XMONAD_LOG"
+ XPropertyLog a -> a
+ UnsafeXPropertyLog a -> a
NamedXPropertyLog a _ -> a
+ UnsafeNamedXPropertyLog a _ -> a
+ sanitize = case x of
+ UnsafeXMonadLog -> id
+ UnsafeXPropertyLog _ -> id
+ UnsafeNamedXPropertyLog _ _ -> id
+ _ -> stripActions
+
d <- openDisplay ""
xlog <- internAtom d atom False
@@ -53,7 +68,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