aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Mertens <emertens@galois.com>2007-10-18 02:16:52 +0200
committerEric Mertens <emertens@galois.com>2007-10-18 02:16:52 +0200
commit4854b8000e86fc2843f001ce1f4433a39a69a6dc (patch)
tree0ad298471af5e55799752c82a3e4f8b3b2f20c47
parent7038d3f605ac236cbefe9abf9ca9605f866cdf7f (diff)
downloadXMonadContrib-4854b8000e86fc2843f001ce1f4433a39a69a6dc.tar.gz
XMonadContrib-4854b8000e86fc2843f001ce1f4433a39a69a6dc.tar.xz
XMonadContrib-4854b8000e86fc2843f001ce1f4433a39a69a6dc.zip
DynamicLog.hs: Add ppWsSep field to PP to specify workspace separator.
This can be useful when you are using colors to distinguish between workspaces and simply provides more functionality. The default behavior remains the same. darcs-hash:20071018001652-b49f3-2fc4fa9e2412b77e18f34969b45acb3ffb2c16f6.gz
-rw-r--r--DynamicLog.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/DynamicLog.hs b/DynamicLog.hs
index e8d5419..213b997 100644
--- a/DynamicLog.hs
+++ b/DynamicLog.hs
@@ -86,7 +86,7 @@ dynamicLogWithPP pp = do
]
pprWindowSet :: PP -> WindowSet -> String
-pprWindowSet pp s = unwords' $ map fmt $ sortBy cmp
+pprWindowSet pp s = sepBy (ppWsSep pp) $ map fmt $ sortBy cmp
(map S.workspace (S.current s : S.visible s) ++ S.hidden s)
where f Nothing Nothing = EQ
f (Just _) Nothing = LT
@@ -128,10 +128,6 @@ wrap :: String -> String -> String -> String
wrap l r "" = ""
wrap l r m = l ++ m ++ r
--- | Intersperse spaces, filtering empty words.
-unwords' :: [String] -> String
-unwords' = sepBy " "
-
sepBy :: String -> [String] -> String
sepBy sep = concat . intersperse sep . filter (not . null)
@@ -144,7 +140,7 @@ xmobarColor fg bg = wrap t "</fc>"
-- dynamicLogPP
data PP = PP { ppCurrent, ppVisible
, ppHidden, ppHiddenNoWindows :: WorkspaceId -> String
- , ppSep :: String
+ , ppSep, ppWsSep :: String
, ppTitle :: String -> String
, ppLayout :: String -> String
, ppOrder :: [String] -> [String] }
@@ -156,6 +152,7 @@ defaultPP = PP { ppCurrent = wrap "[" "]"
, ppHidden = id
, ppHiddenNoWindows = const ""
, ppSep = " : "
+ , ppWsSep = " "
, ppTitle = const ""
, ppLayout = id
, ppOrder = id }