Merge pull request #234 from vmandela/dzen

DynamicLog: add dzenWithFlags function
This commit is contained in:
Brent Yorgey
2018-04-02 10:14:50 -05:00
committed by GitHub
2 changed files with 36 additions and 5 deletions

View File

@@ -233,6 +233,12 @@
- New function `appendFilePrompt'` which allows for transformation of the - New function `appendFilePrompt'` which allows for transformation of the
string passed by a user before writing to a file. string passed by a user before writing to a file.
* `XMonad.Hooks.DynamicLog`
- Added a new function `dzenWithFlags` which allows specifying the arguments
passed to `dzen2` invocation. The behaviour of current `dzen` function is
unchanged.
## 0.13 (February 10, 2017) ## 0.13 (February 10, 2017)
### Breaking Changes ### Breaking Changes

View File

@@ -24,6 +24,7 @@ module XMonad.Hooks.DynamicLog (
-- * Drop-in loggers -- * Drop-in loggers
dzen, dzen,
dzenWithFlags,
xmobar, xmobar,
statusBar, statusBar,
dynamicLog, dynamicLog,
@@ -150,6 +151,32 @@ import XMonad.Hooks.ManageDocks
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Run xmonad with a dzen status bar with specified dzen
-- command line arguments.
--
-- > main = xmonad =<< dzenWithFlags flags myConfig
-- >
-- > myConfig = def { ... }
-- >
-- > flags = "-e onstart lower -w 800 -h 24 -ta l -fg #a8a3f7 -bg #3f3c6d"
--
-- This function can be used to customize the arguments passed to dzen2.
-- e.g changing the default width and height of dzen2.
--
-- If you wish to customize the status bar format at all, you'll have to
-- use the 'statusBar' function instead.
--
-- The binding uses the XMonad.Hooks.ManageDocks module to automatically
-- handle screen placement for dzen, and enables 'mod-b' for toggling
-- the menu bar.
--
-- You should use this function only when the default 'dzen' function does not
-- serve your purpose.
--
dzenWithFlags :: LayoutClass l Window
=> String -> XConfig l -> IO (XConfig (ModifiedLayout AvoidStruts l))
dzenWithFlags flags conf = statusBar ("dzen2 " ++ flags) dzenPP toggleStrutsKey conf
-- | Run xmonad with a dzen status bar set to some nice defaults. -- | Run xmonad with a dzen status bar set to some nice defaults.
-- --
-- > main = xmonad =<< dzen myConfig -- > main = xmonad =<< dzen myConfig
@@ -159,16 +186,14 @@ import XMonad.Hooks.ManageDocks
-- The intent is that the above config file should provide a nice -- The intent is that the above config file should provide a nice
-- status bar with minimal effort. -- status bar with minimal effort.
-- --
-- If you wish to customize the status bar format at all, you'll have to
-- use the 'statusBar' function instead.
--
-- The binding uses the XMonad.Hooks.ManageDocks module to automatically -- The binding uses the XMonad.Hooks.ManageDocks module to automatically
-- handle screen placement for dzen, and enables 'mod-b' for toggling -- handle screen placement for dzen, and enables 'mod-b' for toggling
-- the menu bar. -- the menu bar. Please refer to 'dzenWithFlags' function for further
-- documentation.
-- --
dzen :: LayoutClass l Window dzen :: LayoutClass l Window
=> XConfig l -> IO (XConfig (ModifiedLayout AvoidStruts l)) => XConfig l -> IO (XConfig (ModifiedLayout AvoidStruts l))
dzen conf = statusBar ("dzen2 " ++ flags) dzenPP toggleStrutsKey conf dzen conf = dzenWithFlags flags conf
where where
fg = "'#a8a3f7'" -- n.b quoting fg = "'#a8a3f7'" -- n.b quoting
bg = "'#3f3c6d'" bg = "'#3f3c6d'"