aboutsummaryrefslogtreecommitdiffstats
path: root/DynamicLog.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2007-10-27 00:19:44 +0200
committerDon Stewart <dons@galois.com>2007-10-27 00:19:44 +0200
commitff91f3f0c0984113e5b4a90f29969f7913780268 (patch)
tree55218231c87a76f5bbce2a0928e27826cf2e285f /DynamicLog.hs
parent246ed3137ca4dd1f7f84e3e5023786d38651c348 (diff)
downloadXMonadContrib-ff91f3f0c0984113e5b4a90f29969f7913780268.tar.gz
XMonadContrib-ff91f3f0c0984113e5b4a90f29969f7913780268.tar.xz
XMonadContrib-ff91f3f0c0984113e5b4a90f29969f7913780268.zip
add dynamicLogDzen, a dwm status bar, using dzen colour codes
darcs-hash:20071026221944-cba2c-7f8b88843873c2285fe1619df63e77254cdd87b0.gz
Diffstat (limited to 'DynamicLog.hs')
-rw-r--r--DynamicLog.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/DynamicLog.hs b/DynamicLog.hs
index e0d7b06..8863eb6 100644
--- a/DynamicLog.hs
+++ b/DynamicLog.hs
@@ -22,6 +22,7 @@ module XMonadContrib.DynamicLog (
-- * Usage
-- $usage
dynamicLog,
+ dynamicLogDzen,
dynamicLogWithPP,
dynamicLogXinerama,
@@ -68,6 +69,30 @@ import XMonadContrib.NamedWindows
dynamicLog :: X ()
dynamicLog = dynamicLogWithPP defaultPP
+-- | An example log hook that emulates dwm's status bar, using colour codes printed to dzen
+-- Requires dzen. Workspaces, xinerama, layouts and the window title are handled.
+--
+dynamicLogDzen :: X ()
+dynamicLogDzen = dynamicLogWithPP dzenPP
+ where
+ dzenPP = defaultPP { ppCurrent = dzenColor "white" "#2b4f98" . pad
+ , ppVisible = dzenColor "black" "#999999" . pad
+ , ppHidden = dzenColor "black" "#cccccc" . pad
+ , ppHiddenNoWindows = const ""
+ , ppWsSep = ""
+ , ppSep = ""
+ , ppLayout = dzenColor "black" "#cccccc" .
+ (\ x -> case x of
+ "TilePrime Horizontal" -> " TTT "
+ "TilePrime Vertical" -> " []= "
+ "Hinted Full" -> " [ ] "
+ _ -> pad x
+ )
+ , ppTitle = ("^bg(#324c80) " ++) . escape
+ }
+ escape = concatMap (\x -> if x == '^' then "^^" else [x])
+ pad = wrap " " " "
+
-- |
-- A log function that uses the 'PP' hooks to customize output.
dynamicLogWithPP :: PP -> X ()