mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Merge pull request #373 from TheMC47/xmobarBorder
Added xmobarBorder utility function to add borders to strings
This commit is contained in:
commit
2ad0c04447
@ -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 borders around strings.
|
||||||
|
|
||||||
## 0.16
|
## 0.16
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user