Revert "[XMonad] Fix space toggling"
This reverts commitf44a3e52ef
. fixup 8dba7e5 Revert "[XMonad] Enable gaps at starup" fixup 88882d9 Revert "[XMonad] Make gaps an arbitrary X action" also reverts94a315b
,67f2c87
.
This commit is contained in:
parent
46fcd61bdd
commit
fabc451cea
@ -185,11 +185,9 @@ tvScreenId :: ScreenId
|
|||||||
tvScreenId = 1
|
tvScreenId = 1
|
||||||
|
|
||||||
disableTVFading = setFading (Just tvScreenId) False
|
disableTVFading = setFading (Just tvScreenId) False
|
||||||
enableGaps = sendMessage $ ModifySpacing $ const spacingSize
|
|
||||||
disableGaps = sendMessage $ ModifySpacing $ const 0
|
|
||||||
|
|
||||||
hostNameToAction =
|
hostNameToAction =
|
||||||
M.fromList [ ("imalison-arch", disableTVFading >> enableGaps)
|
M.fromList [ ("imalison-arch", disableTVFading)
|
||||||
, ("imalison-uber-loaner", return ())
|
, ("imalison-uber-loaner", return ())
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -223,31 +221,22 @@ data MyToggles
|
|||||||
|
|
||||||
instance Transformer MyToggles Window where
|
instance Transformer MyToggles Window where
|
||||||
transform LIMIT x k = k (limitSlice 2 x) unmodifyLayout
|
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 MAGICFOCUS x k = k (magicFocus x) unmodifyLayout
|
||||||
|
|
||||||
myToggles = [LIMIT, MAGICFOCUS]
|
myToggles = [LIMIT, GAPS, MAGICFOCUS]
|
||||||
otherToggles = [NBFULL, MIRROR]
|
otherToggles = [NBFULL, MIRROR]
|
||||||
|
|
||||||
followIfNoMagicFocus =
|
followIfNoMagicFocus =
|
||||||
followOnlyIf $ maybe False not <$> isToggleActive MAGICFOCUS
|
followOnlyIf $ maybe False not <$> isToggleActive MAGICFOCUS
|
||||||
|
|
||||||
layoutTogglesMap =
|
togglesMap =
|
||||||
fmap M.fromList $ sequence $
|
fmap M.fromList $ sequence $
|
||||||
map toggleTuple myToggles ++ map toggleTuple otherToggles
|
map toggleTuple myToggles ++ map toggleTuple otherToggles
|
||||||
where
|
where
|
||||||
toggleTuple toggle =
|
toggleTuple toggle =
|
||||||
fmap (\str -> (str, Toggle toggle)) (toggleToStringWithState 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 =
|
toggleStateToString s =
|
||||||
case s of
|
case s of
|
||||||
@ -262,10 +251,7 @@ toggleToStringWithState toggle =
|
|||||||
|
|
||||||
selectToggle =
|
selectToggle =
|
||||||
togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>=
|
togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>=
|
||||||
flip whenJust handleToggle
|
flip whenJust sendMessage
|
||||||
where
|
|
||||||
handleToggle (Left action) = action
|
|
||||||
handleToggle (Right toggle) = sendMessage toggle
|
|
||||||
|
|
||||||
toggleInState :: (Transformer t Window) => t -> Maybe Bool -> X Bool
|
toggleInState :: (Transformer t Window) => t -> Maybe Bool -> X Bool
|
||||||
toggleInState t s = fmap (/= s) (isToggleActive t)
|
toggleInState t s = fmap (/= s) (isToggleActive t)
|
||||||
@ -323,9 +309,9 @@ myLayoutHook =
|
|||||||
boringAuto .
|
boringAuto .
|
||||||
mkToggle1 MIRROR .
|
mkToggle1 MIRROR .
|
||||||
mkToggle1 LIMIT .
|
mkToggle1 LIMIT .
|
||||||
|
mkToggle1 GAPS .
|
||||||
mkToggle1 MAGICFOCUS .
|
mkToggle1 MAGICFOCUS .
|
||||||
mkToggle1 NBFULL .
|
mkToggle1 NBFULL .
|
||||||
smartSpacing spacingSize .
|
|
||||||
workspaceNamesHook .
|
workspaceNamesHook .
|
||||||
lessBorders Screen $ fst layoutInfo
|
lessBorders Screen $ fst layoutInfo
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user