added xmobarBorder

This commit is contained in:
Yecine Megdiche
2020-08-29 19:44:01 +02:00
parent 51bc4f8c2f
commit ab04e29e42
2 changed files with 16 additions and 2 deletions

View File

@@ -145,6 +145,8 @@
* `XMonad.Util.EZConfig` * `XMonad.Util.EZConfig`
- Added support for XF86Bluetooth. - Added support for XF86Bluetooth.
* `XMonad.Hooks.DynamicLog`
- Added `xmobarBorder` function to create boorders around strings.
## 0.16 ## 0.16

View File

@@ -43,8 +43,8 @@ module XMonad.Hooks.DynamicLog (
-- * Formatting utilities -- * Formatting utilities
wrap, pad, trim, shorten, wrap, pad, trim, shorten,
xmobarColor, xmobarAction, xmobarRaw, xmobarColor, xmobarAction, xmobarBorder,
xmobarStrip, xmobarStripTags, xmobarRaw, xmobarStrip, xmobarStripTags,
dzenColor, dzenEscape, dzenStrip, dzenColor, dzenEscape, dzenStrip,
-- * Internal formatting functions -- * Internal formatting functions
@@ -436,6 +436,18 @@ xmobarAction command button = wrap l r
l = "<action=`" ++ command ++ "` button=" ++ button ++ ">" l = "<action=`" ++ command ++ "` button=" ++ button ++ ">"
r = "</action>" r = "</action>"
-- | Use xmobar box to add a border to an arbitrary string.
xmobarBorder :: String -- ^ Border type. Possible values: VBoth, HBoth, Full,
-- Top, Bottom, Left or Right
-> String -- ^ color: a color name, or #rrggbb format
-> Int -- ^ width in pixels
-> String -- ^ output string
-> String
xmobarBorder border color width = wrap prefix "</box>"
where
prefix = "<box type=" ++ border ++ " width=" ++ show width ++ " color="
++ color ++ ">"
-- | Encapsulate arbitrary text for display only, i.e. untrusted content if -- | Encapsulate arbitrary text for display only, i.e. untrusted content if
-- wrapped (perhaps from window titles) will be displayed only, with all tags -- wrapped (perhaps from window titles) will be displayed only, with all tags
-- ignored. Introduced in xmobar 0.21; see their documentation. Be careful not -- ignored. Introduced in xmobar 0.21; see their documentation. Be careful not