mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-02 13:11:52 -07:00
DynamicLog.hs: Add dzenColor
This commit is contained in:
@@ -29,7 +29,7 @@ module XMonadContrib.DynamicLog (
|
|||||||
pprWindowSetXinerama,
|
pprWindowSetXinerama,
|
||||||
|
|
||||||
PP(..), defaultPP, sjanssenPP,
|
PP(..), defaultPP, sjanssenPP,
|
||||||
wrap, xmobarColor, shorten
|
wrap, dzenColor, xmobarColor, shorten
|
||||||
) where
|
) where
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -137,7 +137,13 @@ shorten n xs | length xs < n = xs
|
|||||||
sepBy :: String -> [String] -> String
|
sepBy :: String -> [String] -> String
|
||||||
sepBy sep = concat . intersperse sep . filter (not . null)
|
sepBy sep = concat . intersperse sep . filter (not . null)
|
||||||
|
|
||||||
-- TODO dzenColor
|
dzenColor :: String -> String -> String -> String
|
||||||
|
dzenColor fg bg = wrap (fg1++bg1) (fg2++bg2)
|
||||||
|
where (fg1,fg2) | null fg = ("","")
|
||||||
|
| otherwise = ("^fg(" ++ fg ++ ")","^fg()")
|
||||||
|
(bg1,bg2) | null bg = ("","")
|
||||||
|
| otherwise = ("^bg(" ++ bg ++ ")","^bg()")
|
||||||
|
|
||||||
xmobarColor :: String -> String -> String -> String
|
xmobarColor :: String -> String -> String -> String
|
||||||
xmobarColor fg bg = wrap t "</fc>"
|
xmobarColor fg bg = wrap t "</fc>"
|
||||||
where t = concat ["<fc=", fg, if null bg then "" else "," ++ bg, ">"]
|
where t = concat ["<fc=", fg, if null bg then "" else "," ++ bg, ">"]
|
||||||
|
Reference in New Issue
Block a user