diff options
-rw-r--r-- | XMonad/Config/Dons.hs | 15 | ||||
-rw-r--r-- | XMonad/Hooks/DynamicLog.hs | 25 |
2 files changed, 30 insertions, 10 deletions
diff --git a/XMonad/Config/Dons.hs b/XMonad/Config/Dons.hs index ef5ccef..b8d62a1 100644 --- a/XMonad/Config/Dons.hs +++ b/XMonad/Config/Dons.hs @@ -13,15 +13,12 @@ module XMonad.Config.Dons where import XMonad -import XMonad.Config import XMonad.Hooks.DynamicLog -config :: XConfig -config = defaultConfig - { borderWidth = 2 - , defaultGaps = [(18,0,0,0)] - , terminal = "term" - , normalBorderColor = "#cccccc" - , focusedBorderColor = "#cd8b00" - , logHook = dynamicLogDzen } +donsMain :: IO () +donsMain = dzen $ \conf -> xmonad $ conf + { borderWidth = 2 + , terminal = "term" + , normalBorderColor = "#cccccc" + , focusedBorderColor = "#cd8b00" } diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs index 02fa34d..2164080 100644 --- a/XMonad/Hooks/DynamicLog.hs +++ b/XMonad/Hooks/DynamicLog.hs @@ -25,6 +25,7 @@ module XMonad.Hooks.DynamicLog ( dynamicLogDzen, dynamicLogWithPP, dynamicLogXinerama, + dzen, pprWindowSet, pprWindowSetXinerama, @@ -67,9 +68,31 @@ makeSimpleDzenConfig = do h <- spawnPipe "dzen2" return defaultConfig { defaultGaps = [(18,0,0,0)] - , logHook = dynamicLogWithPP defaultPP + , logHook = dynamicLogWithPP dzenPP { ppOutput = hPutStrLn h } } +-- | +-- +-- Run xmonad with a dzen status bar set to some nice defaults. Output +-- it taken fromthe dynamicLogWithPP hook. +-- +-- > main = dzen xmonad +-- +-- The intent is that the avove config file should provide a nice status +-- bar with minimal effort. +-- +dzen :: (XConfig -> IO ()) -> IO () +dzen f = do + h <- spawnPipe ("dzen2" ++ " " ++ flags) + f $ defaultConfig + { defaultGaps = [(18,0,0,0)] + , logHook = dynamicLogWithPP dzenPP + { ppOutput = hPutStrLn h } } + where + fg = "'#a8a3f7'" -- n.b quoting + bg = "'#3f3c6d'" + flags = "-e '' -w 400 -ta l -fg " ++ fg ++ " -bg " ++ bg + -- | -- An example log hook, print a status bar output to stdout, in the form: -- |