From 4db7617ad62041dc465c44f0a5b31e1ff09ff978 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 9 Aug 2021 14:10:30 -0600 Subject: [PATCH] [XMonad] Make AVOIDSTRUTS a toggle --- dotfiles/config/xmonad/xmonad.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 1ae21755..d49f97f6 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -244,6 +244,7 @@ hostNameToAction = ] myStartup = do + setToggleActiveAll AVOIDSTRUTS True setToggleActiveAll GAPS True setToggleActiveAll NOBORDERS True hostName <- io getHostName @@ -272,6 +273,7 @@ data MyToggles | GAPS | MAGICFOCUS | MAGNIFY + | AVOIDSTRUTS deriving (Read, Show, Eq, Typeable) instance Transformer MyToggles Window where @@ -279,10 +281,15 @@ instance Transformer MyToggles Window where transform GAPS x k = k (smartSpacing 5 x) unmodifyLayout transform MAGICFOCUS x k = k (magicFocus x) unmodifyLayout transform MAGNIFY x k = k (myMagnify x) unmodifyLayout + transform AVOIDSTRUTS x k = k (avoidStruts x) unmodifyLayout -myToggles = [LIMIT, GAPS, MAGICFOCUS, MAGNIFY] +myToggles = [LIMIT, GAPS, MAGICFOCUS, MAGNIFY, AVOIDSTRUTS] otherToggles = [NBFULL, MIRROR, NOBORDERS, SMARTBORDERS] -toggleHandlers = [(Toggle GAPS, toggleAll), (Toggle MAGNIFY, toggleAll)] +toggleHandlers = + [ (Toggle GAPS, toggleAll) + , (Toggle MAGNIFY, toggleAll) + , (Toggle AVOIDSTRUTS, toggleAll) + ] instance Eq (Toggle Window) where (Toggle v) == v2 = Just v == fromToggle v2 @@ -386,9 +393,9 @@ layoutNames = [description layout | layout <- layoutList] selectLayout = myDmenu layoutNames >>= (sendMessage . JumpToLayout) myLayoutHook = - avoidStruts . minimizeNoDescription . boringAuto . + mkToggle1 AVOIDSTRUTS . mkToggle1 MIRROR . mkToggle1 LIMIT . mkToggle1 GAPS .