From fabc451ceafc612ab13e1193367b1d5136b13c32 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 11 May 2017 18:17:45 -0700 Subject: [PATCH] Revert "[XMonad] Fix space toggling" This reverts commit f44a3e52ef646b65f5bc14873bb87fe1495f38ff. fixup 8dba7e5 Revert "[XMonad] Enable gaps at starup" fixup 88882d9 Revert "[XMonad] Make gaps an arbitrary X action" also reverts 94a315b, 67f2c87. --- dotfiles/xmonad/xmonad.hs | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 72e7016e..962362e3 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -185,11 +185,9 @@ tvScreenId :: ScreenId tvScreenId = 1 disableTVFading = setFading (Just tvScreenId) False -enableGaps = sendMessage $ ModifySpacing $ const spacingSize -disableGaps = sendMessage $ ModifySpacing $ const 0 hostNameToAction = - M.fromList [ ("imalison-arch", disableTVFading >> enableGaps) + M.fromList [ ("imalison-arch", disableTVFading) , ("imalison-uber-loaner", return ()) ] @@ -223,31 +221,22 @@ data MyToggles 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 -myToggles = [LIMIT, MAGICFOCUS] +myToggles = [LIMIT, GAPS, MAGICFOCUS] otherToggles = [NBFULL, MIRROR] followIfNoMagicFocus = followOnlyIf $ maybe False not <$> isToggleActive MAGICFOCUS -layoutTogglesMap = +togglesMap = fmap M.fromList $ sequence $ map toggleTuple myToggles ++ map toggleTuple otherToggles where toggleTuple toggle = fmap (\str -> (str, Toggle toggle)) (toggleToStringWithState toggle) -spacingSize = 20 - -togglesXActionsMap = - M.fromList [ ("GAPS", sendMessage $ ModifySpacing toggleSpacing ) ] - where toggleSpacing 0 = spacingSize - toggleSpacing _ = 0 - -togglesMap = - M.union (M.map Left togglesXActionsMap) . M.map Right <$> - layoutTogglesMap toggleStateToString s = case s of @@ -262,10 +251,7 @@ toggleToStringWithState toggle = selectToggle = togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>= - flip whenJust handleToggle - where - handleToggle (Left action) = action - handleToggle (Right toggle) = sendMessage toggle + flip whenJust sendMessage toggleInState :: (Transformer t Window) => t -> Maybe Bool -> X Bool toggleInState t s = fmap (/= s) (isToggleActive t) @@ -323,9 +309,9 @@ myLayoutHook = boringAuto . mkToggle1 MIRROR . mkToggle1 LIMIT . + mkToggle1 GAPS . mkToggle1 MAGICFOCUS . mkToggle1 NBFULL . - smartSpacing spacingSize . workspaceNamesHook . lessBorders Screen $ fst layoutInfo