[XMonad] Add goToNextScreen and use it when swapping screen content

This commit is contained in:
Ivan Malison 2016-12-24 04:38:03 -08:00
parent ba72168c04
commit 2a0a2c085d
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -588,6 +588,13 @@ shiftToNextScreen = withWindowSet $ \ws ->
case W.visible ws of case W.visible ws of
W.Screen i _ _:_ -> windows $ W.view (W.tag i) . W.shift (W.tag i) W.Screen i _ _:_ -> windows $ W.view (W.tag i) . W.shift (W.tag i)
_ -> return () _ -> return ()
goToNextScreen = windows $ \ws ->
case W.visible ws of
newVisible:rest -> ws { W.current = newVisible
, W.visible = W.current ws:rest
}
_ -> ws
-- Key bindings -- Key bindings
@ -604,7 +611,8 @@ addKeys conf@XConfig {modMask = modm} =
, ((modm .|. controlMask, xK_t), spawn , ((modm .|. controlMask, xK_t), spawn
"systemctl --user restart taffybar.service") "systemctl --user restart taffybar.service")
, ((modm, xK_v), spawn "copyq paste") , ((modm, xK_v), spawn "copyq paste")
, ((modm, xK_s), swapNextScreen) , ((modm, xK_s), swapNextScreen >> goToNextScreen)
, ((modm .|. shiftMask, xK_s), goToNextScreen)
, ((modm .|. controlMask, xK_space), goFullscreen) , ((modm .|. controlMask, xK_space), goFullscreen)
, ((modm, xK_slash), sendMessage $ Toggle MIRROR) , ((modm, xK_slash), sendMessage $ Toggle MIRROR)
, ((modm, xK_m), withFocused minimizeWindow) , ((modm, xK_m), withFocused minimizeWindow)