From 16a1666570de89fa9a49579241e8ecccf48ed99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Fri, 31 Oct 2025 20:49:32 +0800 Subject: [PATCH] vanadium/xmonad: remove fancy insertion rules --- .../vanadium/home/xmonad/xmonad.hs | 54 +++++++------------ 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 8fc0a1c9..c60fb6d7 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -25,7 +25,6 @@ import XMonad.Util.SpawnOnce import XMonad.Layout.Magnifier import Data.Map.Strict qualified as M -import Data.Monoid import System.Posix import Graphics.X11.ExtraTypes.XF86 @@ -102,42 +101,27 @@ main = mag tallr ||| Full , manageHook = - let - hasEvenWindows :: X Bool - hasEvenWindows = g <$> get - where g = even . length . W.integrate' - . W.stack . W.workspace . W.current . windowset + composeAll + [ className ~? "NautilusPreviewer" --> customFloating centeredFloat + , className =? "feh" --> customFloating buttomRightFloat + , className =? "Minder" + <&&> not <$> title ~? "Pick a Color" -- ignore the color picker + --> customFloating centeredFloat + , isFirefoxPIP --> doFloat - -- When having a lot of windows this will converge into the middle of the stack - insertInMiddle :: Query (Endo WindowSet) - insertInMiddle = - ifM - (liftX hasEvenWindows) - (insertPosition Below Newer) -- New window is odd - (insertPosition Above Newer) -- New window is even - in - composeAll - [ className ~? "NautilusPreviewer" --> customFloating centeredFloat - , className =? "feh" --> customFloating buttomRightFloat - , className =? "Minder" - <&&> not <$> title ~? "Pick a Color" -- ignore the color picker - --> customFloating centeredFloat - , isFirefoxPIP --> doFloat + , namedScratchpadManageHook myScratchpads + ] - , namedScratchpadManageHook myScratchpads - ] - - <> - composeOne - [ className =? "firefox" -?> insertPosition Master Newer - , className =? "kitty" -?> insertPosition Below Newer - , className `isOneOf` - [ "sioyek" - , "Nautilus" - ] - -?> insertPosition End Older - , Just <$> insertInMiddle - ] + <> + composeOne + [ className =? "firefox" -?> insertPosition Master Newer + , className =? "kitty" -?> insertPosition Below Newer + , className `isOneOf` + [ "sioyek" + , "Nautilus" + ] + -?> insertPosition End Older + ] } -- Only remove mappings that needs pass through (it's a map).