aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2010-03-19 22:46:31 +0100
committerTomas Janousek <tomi@nomi.cz>2010-03-19 22:46:31 +0100
commit79d492a9e2fed26ab0e0cbedbc6bec6c2da9cf59 (patch)
treebd62b445646ff6d5bef78c4dddd8d3b548a58e06 /XMonad/Hooks
parent518cd7f1cf36c32707fcd67bcb09a4639a8b7b6d (diff)
downloadXMonadContrib-79d492a9e2fed26ab0e0cbedbc6bec6c2da9cf59.tar.gz
XMonadContrib-79d492a9e2fed26ab0e0cbedbc6bec6c2da9cf59.tar.xz
XMonadContrib-79d492a9e2fed26ab0e0cbedbc6bec6c2da9cf59.zip
X.H.DynamicLog: let the user of xmonadPropLog choose property name
Ignore-this: 17c0cac2a469e0b70b0cea86f3aeed51 darcs-hash:20100319214631-c9ff5-e1515d6d27fdecb2bf28805918d373d0d5445403.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/DynamicLog.hs17
1 files changed, 11 insertions, 6 deletions
diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs
index d947bb5..4777134 100644
--- a/XMonad/Hooks/DynamicLog.hs
+++ b/XMonad/Hooks/DynamicLog.hs
@@ -29,6 +29,7 @@ module XMonad.Hooks.DynamicLog (
dynamicLog,
dynamicLogXinerama,
+ xmonadPropLog',
xmonadPropLog,
-- * Build your own formatter
@@ -209,20 +210,24 @@ statusBar cmd pp k conf = do
where
keys' = (`M.singleton` sendMessage ToggleStruts) . k
--- | Write a string to the property _XMONAD_LOG on the root window. This
--- property is of type UTF8_STRING. The string must have been processed by
--- encodeString (dynamicLogString does this).
-xmonadPropLog :: String -> X ()
-xmonadPropLog msg = do
+-- | Write a string to a property on the root window. This property is of
+-- type UTF8_STRING. The string must have been processed by encodeString
+-- (dynamicLogString does this).
+xmonadPropLog' :: String -> String -> X ()
+xmonadPropLog' prop msg = do
d <- asks display
r <- asks theRoot
- xlog <- getAtom "_XMONAD_LOG"
+ xlog <- getAtom prop
ustring <- getAtom "UTF8_STRING"
io $ changeProperty8 d r xlog ustring propModeReplace (encodeCChar msg)
where
encodeCChar :: String -> [CChar]
encodeCChar = map (fromIntegral . ord)
+-- | Write a string to the _XMONAD_LOG property on the root window.
+xmonadPropLog :: String -> X ()
+xmonadPropLog = xmonadPropLog' "_XMONAD_LOG"
+
-- |
-- Helper function which provides ToggleStruts keybinding
--