From 46d893b6be9b5d4cb92293986e7517d757ebec0d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 21 Nov 2016 17:25:56 -0800 Subject: [PATCH] [XMonad] Automatically deactivate full for several commands --- dotfiles/xmonad/xmonad.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 797e19d0..5cef67d0 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -137,9 +137,12 @@ setToggleActive' toggle active = toggleInState toggle (Just active) >>= setToggleActive :: (Transformer t Window) => t -> Bool -> X () setToggleActive = (void .) . setToggleActive' +deactivateFull = setToggleActive NBFULL False + toggleOr toggle toState action = setToggleActive' toggle toState >>= ((`when` action) . not) deactivateFullOr = toggleOr NBFULL False +deactivateFullAnd action = sequence_ [deactivateFull, action] -- Layout setup @@ -404,8 +407,8 @@ addKeys conf@XConfig {modMask = modm} = -- ModAlt bindings , ((modalt, xK_w), spawn "rofi_wallpaper.sh") - , ((modalt, xK_space), restoreOrMinimizeOtherClasses) - , ((modalt, xK_Return), restoreAllMinimized) + , ((modalt, xK_space), deactivateFullOr restoreOrMinimizeOtherClasses) + , ((modalt, xK_Return), deactivateFullAnd restoreAllMinimized) , ((modalt, xK_5), selectToggle) , ((modalt, xK_4), selectLimit)