From 0a7ae19f90ceeac609f71eccd47cd3e07c4e5f25 Mon Sep 17 00:00:00 2001 From: vrs Date: Mon, 7 Sep 2015 22:59:38 +0200 Subject: [PATCH] X.H.DynamicLog: make xmobarStrip actually strip xmobar tags consider the old implementation: > xmobarStrip "<fc=#f00>foofc>" "foo" --- XMonad/Hooks/DynamicLog.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs index 8e9dcdcf..c13a2fb5 100644 --- a/XMonad/Hooks/DynamicLog.hs +++ b/XMonad/Hooks/DynamicLog.hs @@ -398,7 +398,11 @@ xmobarColor fg bg = wrap t "" -- | Strip xmobar markup, specifically the , and tags and -- the matching tags like . xmobarStrip :: String -> String -xmobarStrip = xmobarStripTags ["fc","icon","action"] where +xmobarStrip = converge (xmobarStripTags ["fc","icon","action"]) where + +converge :: (Eq a) => (a -> a) -> a -> a +converge f a = let xs = iterate f a + in fst $ head $ dropWhile (uncurry (/=)) $ zip xs $ tail xs xmobarStripTags :: [String] -- ^ tags -> String -> String -- ^ with all ... removed