From 1af7582b30d70ded97db92a69673849372c98fb9 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Tue, 12 Jun 2007 17:12:09 +0200 Subject: changes to work with Stacks that can't be empty. darcs-hash:20070612151209-72aca-62307f8565fc32ca80be8daf2c30fe414d49111e.gz --- DynamicLog.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'DynamicLog.hs') diff --git a/DynamicLog.hs b/DynamicLog.hs index 0ef5ada..41c82f9 100644 --- a/DynamicLog.hs +++ b/DynamicLog.hs @@ -20,6 +20,7 @@ module XMonadContrib.DynamicLog (dynamicLog, dynamicLogXinerama) where -- Useful imports -- import XMonad +import Data.Maybe ( isJust ) import Data.List import qualified StackSet as S @@ -45,7 +46,7 @@ dynamicLog = withWindowSet $ io . putStrLn . ppr fmt w | S.tag w == this = "[" ++ pprTag w ++ "]" | S.tag w `elem` visibles = "<" ++ pprTag w ++ ">" - | S.stack w /= S.Empty = " " ++ pprTag w ++ " " + | isJust (S.stack w) = " " ++ pprTag w ++ " " | otherwise = "" -- @@ -62,7 +63,7 @@ dynamicLogXinerama = withWindowSet $ io . putStrLn . ppr ppr ws = "[" ++ unwords onscreen ++ "] " ++ unwords offscreen where onscreen = map (pprTag . S.workspace) . sortBy (compare `on` S.screen) $ S.current ws : S.visible ws - offscreen = map pprTag . filter ((/= S.Empty) . S.stack) + offscreen = map pprTag . filter (isJust . S.stack) . sortBy (compare `on` S.tag) $ S.hidden ws -- util functions -- cgit v1.2.3