[XMonad] Use workspace parameterized isToggleActive
This commit is contained in:
parent
1102ad4b03
commit
4df646f438
@ -230,8 +230,11 @@ instance Transformer MyToggles Window where
|
|||||||
myToggles = [LIMIT, GAPS, MAGICFOCUS]
|
myToggles = [LIMIT, GAPS, MAGICFOCUS]
|
||||||
otherToggles = [NBFULL, MIRROR]
|
otherToggles = [NBFULL, MIRROR]
|
||||||
|
|
||||||
|
currentWorkspace = W.workspace . W.current <$> gets windowset
|
||||||
|
isToggleActiveInCurrent t = currentWorkspace >>= isToggleActive t
|
||||||
|
|
||||||
followIfNoMagicFocus =
|
followIfNoMagicFocus =
|
||||||
followOnlyIf $ maybe False not <$> isToggleActive MAGICFOCUS
|
followOnlyIf $ maybe False not <$> isToggleActiveInCurrent MAGICFOCUS
|
||||||
|
|
||||||
togglesMap =
|
togglesMap =
|
||||||
fmap M.fromList $ sequence $
|
fmap M.fromList $ sequence $
|
||||||
@ -249,14 +252,14 @@ toggleStateToString s =
|
|||||||
toggleToStringWithState :: (Transformer t Window, Show t) => t -> X String
|
toggleToStringWithState :: (Transformer t Window, Show t) => t -> X String
|
||||||
toggleToStringWithState toggle =
|
toggleToStringWithState toggle =
|
||||||
printf "%s (%s)" (show toggle) . toggleStateToString <$>
|
printf "%s (%s)" (show toggle) . toggleStateToString <$>
|
||||||
isToggleActive toggle
|
isToggleActiveInCurrent toggle
|
||||||
|
|
||||||
selectToggle =
|
selectToggle =
|
||||||
togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>=
|
togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>=
|
||||||
flip whenJust sendMessage
|
flip whenJust sendMessage
|
||||||
|
|
||||||
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) (isToggleActiveInCurrent t)
|
||||||
|
|
||||||
setToggleActive' toggle active =
|
setToggleActive' toggle active =
|
||||||
toggleInState toggle (Just active) >>=/
|
toggleInState toggle (Just active) >>=/
|
||||||
|
Loading…
Reference in New Issue
Block a user