]> code.delx.au - dotfiles/commitdiff
xmonad: cycleRecentWorkspaceOnSingleScreen
authorJames Bunton <jamesbunton@delx.net.au>
Thu, 30 Mar 2017 08:58:04 +0000 (19:58 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Thu, 30 Mar 2017 08:59:11 +0000 (19:59 +1100)
.xmonad/xmonad.hs

index 7fa7a65cea54eb8251b4b01cf9b4e33151a47289..9c96c65c1169bac4471b82ffd7ea6cefd4385082 100644 (file)
@@ -52,7 +52,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
         ((modm , xK_period), sendMessage (IncMasterN (-1))),
         ((modm , xK_b ), sendMessage ToggleStruts),
         ((modm , xK_z ), sendMessage Mag.Toggle),
-        ((modm , xK_a), cycleRecentWS [xK_Super_L] xK_a xK_a)
+        ((modm , xK_a), cycleRecentWorkspaceOnSingleScreen [xK_Super_L] xK_a xK_a)
     ]
     ++
 
@@ -71,6 +71,10 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
         , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
     ]
 
+cycleRecentWorkspaceOnSingleScreen = cycleWindowSets options
+    where
+        options w = map (W.view `flip` w) (recentTags w)
+        recentTags w = map W.tag $ W.hidden w ++ [W.workspace (W.current w)]
 
 avoidMaster = W.modify' $ \c -> case c of
     W.Stack t [] (r:rs) -> W.Stack t [r] rs