mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
add higher order 'dzen' function
The intent is that: main = dzen xmonad should just work, and indeed it does now, for launching a cool status bar with minimal effort.
This commit is contained in:
parent
e34a880460
commit
901522fc10
@ -13,15 +13,12 @@
|
||||
module XMonad.Config.Dons where
|
||||
|
||||
import XMonad
|
||||
import XMonad.Config
|
||||
import XMonad.Hooks.DynamicLog
|
||||
|
||||
config :: XConfig
|
||||
config = defaultConfig
|
||||
donsMain :: IO ()
|
||||
donsMain = dzen $ \conf -> xmonad $ conf
|
||||
{ borderWidth = 2
|
||||
, defaultGaps = [(18,0,0,0)]
|
||||
, terminal = "term"
|
||||
, normalBorderColor = "#cccccc"
|
||||
, focusedBorderColor = "#cd8b00"
|
||||
, logHook = dynamicLogDzen }
|
||||
, focusedBorderColor = "#cd8b00" }
|
||||
|
||||
|
@ -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:
|
||||
--
|
||||
|
Loading…
x
Reference in New Issue
Block a user