From c45e6618bc3b45fe40f59da9535fb16ee4b7e5bb Mon Sep 17 00:00:00 2001 From: janabhumi Date: Mon, 12 Sep 2022 11:40:50 +0300 Subject: [PATCH] home/xmonad: open new windows below --- home/ui/xmonad/config.hs | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/home/ui/xmonad/config.hs b/home/ui/xmonad/config.hs index 83c8492..0cd80dc 100644 --- a/home/ui/xmonad/config.hs +++ b/home/ui/xmonad/config.hs @@ -24,6 +24,7 @@ import XMonad.Actions.EasyMotion ) import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.InsertPosition (Focus (Newer), Position (Below), insertPosition) import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers ( composeOne, @@ -40,7 +41,7 @@ import XMonad.Layout.LimitWindows (limitWindows) import XMonad.Layout.NoBorders (smartBorders) import XMonad.Layout.Spacing (spacing) import XMonad.Layout.ThreeColumns (ThreeCol (..)) -import XMonad.Prompt (XPConfig (..), XPPosition (..), XPType (..), XPrompt (..), mkComplFunFromList', mkXPromptWithModes) +import XMonad.Prompt (XPConfig (..), XPPosition (Top), XPType (..), XPrompt (..), mkComplFunFromList', mkXPromptWithModes) import qualified XMonad.StackSet as W import XMonad.Util.EZConfig import qualified XMonad.Util.ExtensibleState as XS @@ -238,19 +239,32 @@ myEventHook = mempty -- myManageHook = manageApps where - isRole = stringProperty "WM_WINDOW_ROLE" - isPopup = isRole =? "pop-up" + role = stringProperty "WM_WINDOW_ROLE" + isPopup = role =? "pop-up" + anyOf :: [Query Bool] -> Query Bool + anyOf = foldl (<||>) (pure False) + tileBelow = insertPosition Below Newer manageApps = composeOne [ -- apps className =? "Gimp" -?> doFloat, - className =? "nheko" -?> doShift comWs, - className =? "KotatogramDesktop" -?> doShift comWs, + anyOf + [ className =? "nheko", + className =? "KotatogramDesktop" + ] + -?> doShift comWs, -- general - resource =? "desktop_window" -?> doIgnore, - resource =? "kdesktop" -?> doIgnore, - isPopup -?> doCenterFloat, - isDialog -?> doCenterFloat + anyOf + [ resource =? "desktop_window", + resource =? "kdesktop" + ] + -?> doIgnore, + anyOf + [ isPopup, + isDialog + ] + -?> doCenterFloat, + pure True -?> tileBelow ] ------------------------------------------------------------------------