From 29584eecbdc55e2a8d1bab2403bab7b95b66aba8 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 4 Aug 2021 22:28:33 -0600 Subject: [PATCH] [XMonad] Don't magnify in tabbed layout --- dotfiles/config/xmonad/xmonad-contrib | 2 +- dotfiles/config/xmonad/xmonad.hs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dotfiles/config/xmonad/xmonad-contrib b/dotfiles/config/xmonad/xmonad-contrib index 29e3974c..e08cfede 160000 --- a/dotfiles/config/xmonad/xmonad-contrib +++ b/dotfiles/config/xmonad/xmonad-contrib @@ -1 +1 @@ -Subproject commit 29e3974c937073aa25343f2eead95b3f1aec7922 +Subproject commit e08cfede71d33edf7eda6e11d95da4df5ad682e6 diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 2d98907e..d6b6cfda 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -61,6 +61,7 @@ import XMonad.Hooks.TaffybarPagerHints import XMonad.Hooks.WorkspaceHistory import XMonad.Layout.Accordion import XMonad.Layout.BoringWindows +import XMonad.Layout.ConditionalModifier import XMonad.Layout.Cross import XMonad.Layout.Grid import XMonad.Layout.LayoutCombinators @@ -266,11 +267,21 @@ data MyToggles | MAGNIFY deriving (Read, Show, Eq, Typeable) +data DisableOnTabbedCondition = DisableOnTabbedCondition deriving (Read, Show) + +instance ModifierCondition DisableOnTabbedCondition where + shouldApply _ = do + not . isInfixOf "Tabbed" . description . W.layout <$> currentWorkspace + +disableOnTabbed = ConditionalLayoutModifier DisableOnTabbedCondition + +myMagnify = ModifiedLayout $ disableOnTabbed (Mag 1 (1.3, 1.3) On (AllWins 1)) + instance Transformer MyToggles Window where transform LIMIT x k = k (limitSlice 2 x) unmodifyLayout transform GAPS x k = k (smartSpacing 5 x) unmodifyLayout transform MAGICFOCUS x k = k (magicFocus x) unmodifyLayout - transform MAGNIFY x k = k (magnify (1.3) (AllWins 1) True x) unmodifyLayout + transform MAGNIFY x k = k (myMagnify x) unmodifyLayout myToggles = [LIMIT, GAPS, MAGICFOCUS, MAGNIFY] otherToggles = [NBFULL, MIRROR, NOBORDERS, SMARTBORDERS]