From ba51e490511cda293641cff6a3ca408529db9c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 24 Aug 2025 11:29:29 +0800 Subject: [PATCH] vanadium/xmonad: update xmobar handling --- .../vanadium/home/xmonad/xmonad.hs | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 14b850b9..94fe4c74 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -8,6 +8,7 @@ import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.FadeWindows import XMonad.Hooks.InsertPosition +import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.RefocusLast import XMonad.Hooks.StatusBar @@ -29,15 +30,13 @@ import System.Posix import Leanamonad.Layouts.ReflectMsg import Leanamonad.GreekChar --- Note: `xmonad --restart` will make Firefox's fullscreen work duck the xmobar stop working --- You need restart Firefox main :: IO () main = xmonad -- Fix all java things that don't scale with XMonad -- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing . javaHack - . dynamicEasySBs xmonadOn + . withSB xmobarConfig . docks . ewmhFullscreen . ewmh $ def { modMask = superMask @@ -88,11 +87,10 @@ main = , layoutHook = let tallr = reflectMsg . reflectHoriz $ ResizableTall 1 (1/10) (3/7) [] - in smartBorders - ( named "Normal" - (smartSpacingWithEdge 5 tallr) - ||| Full - ) + in avoidStruts + $ smartBorders + $ named "Normal" (smartSpacingWithEdge 5 tallr) + ||| Full , manageHook = let @@ -248,19 +246,16 @@ centeredFloat = W.RationalRect (1/9) (1/9) (7/9) (7/9) smallFloat = W.RationalRect (3/5) (3/5) (2/7) (2/7) fullFloat = W.RationalRect 0 0 1 1 -xmonadOn :: ScreenId -> X StatusBarConfig -xmonadOn = \case - 0 -> pure $ statusBarProp "xmobar -x 0" (pure myPrettyPrinter) - 1 -> pure $ statusBarProp "xmobar -x 1" (pure myPrettyPrinter) - _ -> mempty +xmobarConfig :: StatusBarConfig +xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter) where myPrettyPrinter = filterOutWsPP [scratchpadWorkspaceTag] $ def - { ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper - , ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅" - , ppSep = " | " - } + { ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper + , ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅" + , ppSep = " | " + } isFirefoxPIP :: Query Bool isFirefoxPIP =