[XMonad] Fixup whitespace

This commit is contained in:
Ivan Malison 2016-11-21 17:42:55 -08:00
parent 26cdc5d340
commit 78de86f197
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -107,9 +107,11 @@ instance Transformer MyToggles Window where
myToggles = [LIMIT, GAPS, MAGICFOCUS] myToggles = [LIMIT, GAPS, MAGICFOCUS]
otherToggles = [NBFULL, MIRROR] otherToggles = [NBFULL, MIRROR]
togglesMap = fmap M.fromList $ sequence $ map toggleTuple myToggles ++ map toggleTuple otherToggles togglesMap = fmap M.fromList $ sequence $
map toggleTuple myToggles ++ map toggleTuple otherToggles
where where
toggleTuple toggle = fmap (\str -> (str, Toggle toggle)) (toggleToStringWithState toggle) toggleTuple toggle = fmap (\str -> (str, Toggle toggle))
(toggleToStringWithState toggle)
toggleStateToString s = case s of toggleStateToString s = case s of
Just True -> "ON" Just True -> "ON"
@ -117,7 +119,8 @@ toggleStateToString s = case s of
Nothing -> "N/A" Nothing -> "N/A"
toggleToStringWithState :: (Transformer t Window, Show t) => t -> X String toggleToStringWithState :: (Transformer t Window, Show t) => t -> X String
toggleToStringWithState toggle = (printf "%s (%s)" (show toggle) . toggleStateToString) <$> toggleToStringWithState toggle =
(printf "%s (%s)" (show toggle) . toggleStateToString) <$>
isToggleActive toggle isToggleActive toggle
selectToggle = togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>= selectToggle = togglesMap >>= DM.menuMapArgs "rofi" ["-dmenu", "-i"] >>=
@ -130,7 +133,8 @@ whenB b a = do
when b a when b a
return b return b
setToggleActive' toggle active = toggleInState toggle (Just active) >>= setToggleActive' toggle active =
toggleInState toggle (Just active) >>=
flip whenB (sendMessage $ Toggle toggle) flip whenB (sendMessage $ Toggle toggle)
-- Ambiguous type reference without signature -- Ambiguous type reference without signature
@ -139,7 +143,8 @@ setToggleActive = (void .) . setToggleActive'
deactivateFull = setToggleActive NBFULL False deactivateFull = setToggleActive NBFULL False
toggleOr toggle toState action = setToggleActive' toggle toState >>= ((`when` action) . not) toggleOr toggle toState action = setToggleActive' toggle toState >>=
((`when` action) . not)
deactivateFullOr = toggleOr NBFULL False deactivateFullOr = toggleOr NBFULL False
deactivateFullAnd action = sequence_ [deactivateFull, action] deactivateFullAnd action = sequence_ [deactivateFull, action]
@ -209,7 +214,8 @@ myBringWindow WindowBringerConfig{ menuCommand = cmd
} = } =
windowMap' titler >>= DM.menuMapArgs cmd args >>= flip whenJust action windowMap' titler >>= DM.menuMapArgs cmd args >>= flip whenJust action
where action window = sequence_ [ maximizeWindow window where action window = sequence_ [ maximizeWindow window
, windows $ W.focusWindow window . bringWindow window , windows $ W.focusWindow window .
bringWindow window
] ]
-- Dynamic Workspace Renaming -- Dynamic Workspace Renaming
@ -357,8 +363,10 @@ swapMinimizeStateAfter action = withFocused $ \originalWindow -> do
-- Raise or spawn -- Raise or spawn
myRaiseNextMaybe = (maybeUnminimizeClassAfter .) . raiseNextMaybeCustomFocus greedyFocusWindow myRaiseNextMaybe = (maybeUnminimizeClassAfter .) .
myBringNextMaybe = (maybeUnminimizeAfter .) . raiseNextMaybeCustomFocus bringWindow raiseNextMaybeCustomFocus greedyFocusWindow
myBringNextMaybe = (maybeUnminimizeAfter .) .
raiseNextMaybeCustomFocus bringWindow
bindBringAndRaise :: KeyMask -> KeySym -> X () -> Query Bool -> [((KeyMask, KeySym), X ())] bindBringAndRaise :: KeyMask -> KeySym -> X () -> Query Bool -> [((KeyMask, KeySym), X ())]
bindBringAndRaise mask sym start query = bindBringAndRaise mask sym start query =