Compare commits

..

2 commits

View file

@ -25,7 +25,6 @@ import XMonad.Util.SpawnOnce
import XMonad.Layout.Magnifier import XMonad.Layout.Magnifier
import Data.Map.Strict qualified as M import Data.Map.Strict qualified as M
import Data.Monoid
import System.Posix import System.Posix
import Graphics.X11.ExtraTypes.XF86 import Graphics.X11.ExtraTypes.XF86
@ -65,6 +64,7 @@ main =
, "Signal" , "Signal"
, "steam" , "steam"
, "discord" , "discord"
, "vlc"
] ]
-?> opaque -?> opaque
@ -101,42 +101,27 @@ main =
mag tallr ||| Full mag tallr ||| Full
, manageHook = , manageHook =
let composeAll
hasEvenWindows :: X Bool [ className ~? "NautilusPreviewer" --> customFloating centeredFloat
hasEvenWindows = g <$> get , className =? "feh" --> customFloating buttomRightFloat
where g = even . length . W.integrate' , className =? "Minder"
. W.stack . W.workspace . W.current . windowset <&&> 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 , namedScratchpadManageHook myScratchpads
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 <>
] composeOne
[ className =? "firefox" -?> insertPosition Master Newer
<> , className =? "kitty" -?> insertPosition Below Newer
composeOne , className `isOneOf`
[ className =? "firefox" -?> insertPosition Master Newer [ "sioyek"
, className =? "kitty" -?> insertPosition Below Newer , "Nautilus"
, className `isOneOf` ]
[ "sioyek" -?> insertPosition End Older
, "Nautilus" ]
]
-?> insertPosition End Older
, Just <$> insertInMiddle
]
} }
-- Only remove mappings that needs pass through (it's a map). -- Only remove mappings that needs pass through (it's a map).