Merge pull request #549 from rolsdorph/add-xmobarfont

Add xmobarFont
This commit is contained in:
Yecine Megdiche 2021-05-24 21:26:44 +02:00 committed by GitHub
commit ff391de17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -117,6 +117,8 @@
`workspaceNamesPP`, `marshallPP` and/or `clickablePP` to compose `workspaceNamesPP`, `marshallPP` and/or `clickablePP` to compose
intuitively. intuitively.
- Added `xmobarFont` for selecting an xmobar font index
* `XMonad.Hooks.StatusBar` * `XMonad.Hooks.StatusBar`

View File

@ -36,7 +36,7 @@ module XMonad.Hooks.StatusBar.PP (
-- * Formatting utilities -- * Formatting utilities
wrap, pad, trim, shorten, shorten', shortenLeft, shortenLeft', wrap, pad, trim, shorten, shorten', shortenLeft, shortenLeft',
xmobarColor, xmobarAction, xmobarBorder, xmobarColor, xmobarFont, xmobarAction, xmobarBorder,
xmobarRaw, xmobarStrip, xmobarStripTags, xmobarRaw, xmobarStrip, xmobarStripTags,
dzenColor, dzenEscape, dzenStrip, filterOutWsPP, dzenColor, dzenEscape, dzenStrip, filterOutWsPP,
@ -286,6 +286,12 @@ dzenStrip = strip [] where
| otherwise = let (good,x') = span (/= '^') x | otherwise = let (good,x') = span (/= '^') x
in strip (keep ++ good) x' in strip (keep ++ good) x'
-- | Use xmobar escape codes to output a string with the font at the given index
xmobarFont :: Int -- ^ index: index of the font to use (0: standard font)
-> String -- ^ output string
-> String
xmobarFont index = wrap ("<fn=" ++ show index ++ ">") "</fn>"
-- | Use xmobar escape codes to output a string with given foreground -- | Use xmobar escape codes to output a string with given foreground
-- and background colors. -- and background colors.
xmobarColor :: String -- ^ foreground color: a color name, or #rrggbb format xmobarColor :: String -- ^ foreground color: a color name, or #rrggbb format