From 7c3d01947c8e1e717cb33ac6c325b710b69586c4 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Wed, 1 Apr 2020 18:13:26 -0400 Subject: [PATCH] ENH add number of windows to workspace monitor --- bin/xmonad.hs | 3 ++- lib/WorkspaceMon.hs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/xmonad.hs b/bin/xmonad.hs index 6c37860..02883d9 100644 --- a/bin/xmonad.hs +++ b/bin/xmonad.hs @@ -229,7 +229,7 @@ myLoghook h = withWindowSet $ io . hPutStrLn h . myWindowSetXinerama myWindowSetXinerama :: LayoutClass layout a1 => W.StackSet String (layout a1) a2 ScreenId ScreenDetail -> String -myWindowSetXinerama ws = wsString ++ sep ++ layout +myWindowSetXinerama ws = wsString ++ sep ++ layout ++ "(" ++ nWindows ++ ")" where wsString = wrapColorBg T.backdropFgColor "" $ onscreen ++ offscreen' offscreen' = if null offscreen then "" else " " ++ offscreen @@ -251,6 +251,7 @@ myWindowSetXinerama ws = wsString ++ sep ++ layout hilightBgColor = "#8fc7ff" hilightFgColor = T.blend' 0.5 hilightBgColor T.fgColor layout = description . W.layout . W.workspace . W.current $ ws + nWindows = show . length . W.integrate' . W.stack . W.workspace . W.current $ ws compareXCoord s0 s1 = compare x0 x1 where (_, Rectangle x0 _ _ _) = getScreenIdAndRectangle s0 diff --git a/lib/WorkspaceMon.hs b/lib/WorkspaceMon.hs index f6d5e72..9965c94 100644 --- a/lib/WorkspaceMon.hs +++ b/lib/WorkspaceMon.hs @@ -197,5 +197,6 @@ doSink = doF $ \s -> case W.stack $ W.workspace $ W.current s of -- When an app is closed, this will respond the event that is sent in the main -- XMonad thread +-- TODO this doesn't kill a workspace if it isn't in focus...weird removeDynamicWorkspace :: WorkspaceId -> X () removeDynamicWorkspace = removeEmptyWorkspaceByTag