vanadium/xmonad: update xmobar handling

This commit is contained in:
Primrose 2025-08-24 11:29:29 +08:00
parent 7a8d963413
commit ba51e49051
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -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)
in avoidStruts
$ smartBorders
$ named "Normal" (smartSpacingWithEdge 5 tallr)
||| Full
)
, manageHook =
let
@ -248,11 +246,8 @@ 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]