summaryrefslogtreecommitdiffhomepage
path: root/Plugins/XMonadLog.hs
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2009-11-20 15:44:26 +0100
committerTomas Janousek <tomi@nomi.cz>2009-11-20 15:44:26 +0100
commitf0ebea1d9095c151405f0fb45603dfdd721f12f7 (patch)
tree74bf51f7da682221026e0dadcd142e9e968d6810 /Plugins/XMonadLog.hs
parentbffbb688f0ff79e130b5c5a783d4142d402f1a30 (diff)
downloadxmobar-f0ebea1d9095c151405f0fb45603dfdd721f12f7.tar.gz
xmobar-f0ebea1d9095c151405f0fb45603dfdd721f12f7.tar.bz2
extend XMonadLog with XPropertyLog
Ignore-this: baec7062f93ab5950f57c44876c2f XMonadLog can be even more awesome with the ability to gather input from custom sources. This patch adds exactly that, along with a script to read from pipe and write to xmobar using an X property. darcs-hash:20091120144426-c9ff5-596f8b40c4b3df6ede43832b147e95e48ad582ba.gz
Diffstat (limited to 'Plugins/XMonadLog.hs')
-rw-r--r--Plugins/XMonadLog.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Plugins/XMonadLog.hs b/Plugins/XMonadLog.hs
index 34fae31..3461e26 100644
--- a/Plugins/XMonadLog.hs
+++ b/Plugins/XMonadLog.hs
@@ -30,13 +30,19 @@ import Foreign.C (CChar)
import XUtil (nextEvent')
-data XMonadLog = XMonadLog
+data XMonadLog = XMonadLog | XPropertyLog String
deriving (Read, Show)
instance Exec XMonadLog where
- start XMonadLog cb = do
+ alias XMonadLog = "XMonadLog"
+ alias (XPropertyLog atom) = atom
+
+ start x cb = do
+ let atom = case x of
+ XMonadLog -> "_XMONAD_LOG"
+ XPropertyLog a -> a
d <- openDisplay ""
- xlog <- internAtom d "_XMONAD_LOG" False
+ xlog <- internAtom d atom False
root <- rootWindow d (defaultScreen d)
selectInput d root propertyChangeMask