diff options
author | Eric Mertens <emertens@galois.com> | 2007-10-18 19:45:23 +0200 |
---|---|---|
committer | Eric Mertens <emertens@galois.com> | 2007-10-18 19:45:23 +0200 |
commit | 5e25e35c8df01f0d41d831c53e1f72ac6a65f67e (patch) | |
tree | 7c43dbdf847979745a486111afea4a31cc3d3500 | |
parent | 8ddc675faa186c4585b7c4b6df93861bd4b16b05 (diff) | |
download | XMonadContrib-5e25e35c8df01f0d41d831c53e1f72ac6a65f67e.tar.gz XMonadContrib-5e25e35c8df01f0d41d831c53e1f72ac6a65f67e.tar.xz XMonadContrib-5e25e35c8df01f0d41d831c53e1f72ac6a65f67e.zip |
DynamicLog.hs: Add dzenColor
darcs-hash:20071018174523-b49f3-1fb1d59daf1b5d78e2f3d153570090940d335694.gz
-rw-r--r-- | DynamicLog.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/DynamicLog.hs b/DynamicLog.hs index 793c4c8..8e7d188 100644 --- a/DynamicLog.hs +++ b/DynamicLog.hs @@ -29,7 +29,7 @@ module XMonadContrib.DynamicLog ( pprWindowSetXinerama, PP(..), defaultPP, sjanssenPP, - wrap, xmobarColor, shorten + wrap, dzenColor, xmobarColor, shorten ) where -- @@ -137,7 +137,13 @@ shorten n xs | length xs < n = xs sepBy :: String -> [String] -> String 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 fg bg = wrap t "</fc>" where t = concat ["<fc=", fg, if null bg then "" else "," ++ bg, ">"] |