From 5a39fe89c5a3f8df9ae80f5c1605f0cbea894cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Fri, 5 Dec 2025 20:48:25 +0800 Subject: [PATCH] xmonad: remove count in PP for xmobar --- .../vanadium/home/xmonad/xmonad.hs | 39 +++++-------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 73d13b92..bd224647 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -26,7 +26,6 @@ import XMonad.Util.NamedScratchpad import XMonad.Util.SpawnOnce import XMonad.Layout.Magnifier -import Data.Function import Data.Char.Greek import Data.Ratio import Data.Semigroup @@ -357,35 +356,17 @@ fullFloat = W.RationalRect 0 0 1 1 buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2) xmobarConfig :: StatusBarConfig -xmobarConfig = statusBarProp "xmobar -x 0" myPrettyPrinter +xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter) where - mkPpCurrent :: X (String -> String) - mkPpCurrent = do - windowCount <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset - pure $ \wid -> - wid <> (if windowCount > 1 then ":" <> show windowCount else mempty) - & xmobarColor "#000000" "#ffffff" . wrap " " " " - - mkPpHidden :: X (String -> String) - mkPpHidden = do - m <- gets $ M.fromList . map (\x -> (W.tag x, length . W.integrate' . W.stack $ x)) . W.hidden . windowset - pure $ \wid -> - let windowCount = m M.! wid - in wid <> (if windowCount > 1 then ":" <> show windowCount else mempty) - & xmobarColor "#ffffff" "" - - myPrettyPrinter :: X PP - myPrettyPrinter = do - myPpCurrent <- mkPpCurrent - myPpHidden <- mkPpHidden - pure - $ filterOutWsPP [scratchpadWorkspaceTag] - $ def - { ppCurrent = myPpCurrent - , ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅" - , ppHidden = myPpHidden - , ppSep = " | " - } + myPrettyPrinter :: PP + myPrettyPrinter = + filterOutWsPP [scratchpadWorkspaceTag] + $ def + { ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " + , ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅" + , ppHidden = xmobarColor "#ffffff" "" + , ppSep = " | " + } myScratchpads :: [NamedScratchpad] myScratchpads =