From ff91f3f0c0984113e5b4a90f29969f7913780268 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sat, 27 Oct 2007 00:19:44 +0200 Subject: add dynamicLogDzen, a dwm status bar, using dzen colour codes darcs-hash:20071026221944-cba2c-7f8b88843873c2285fe1619df63e77254cdd87b0.gz --- DynamicLog.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'DynamicLog.hs') 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 () -- cgit v1.2.3