From 2a0a2c085df663401f6a8eb9775ac4892c2ddef2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 24 Dec 2016 04:38:03 -0800 Subject: [PATCH] [XMonad] Add goToNextScreen and use it when swapping screen content --- dotfiles/xmonad/xmonad.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 612b4827..4366be1a 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -588,6 +588,13 @@ shiftToNextScreen = withWindowSet $ \ws -> case W.visible ws of W.Screen i _ _:_ -> windows $ W.view (W.tag i) . W.shift (W.tag i) _ -> return () + +goToNextScreen = windows $ \ws -> + case W.visible ws of + newVisible:rest -> ws { W.current = newVisible + , W.visible = W.current ws:rest + } + _ -> ws -- Key bindings @@ -604,7 +611,8 @@ addKeys conf@XConfig {modMask = modm} = , ((modm .|. controlMask, xK_t), spawn "systemctl --user restart taffybar.service") , ((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, xK_slash), sendMessage $ Toggle MIRROR) , ((modm, xK_m), withFocused minimizeWindow)