]> code.delx.au - dotfiles/blobdiff - .xmonad/xmonad.hs
xmonad: fix screen switching keybindings
[dotfiles] / .xmonad / xmonad.hs
index 7fa7a65cea54eb8251b4b01cf9b4e33151a47289..05989b5e28631c5e1ce1539bdcdda5d2e1aea4e2 100644 (file)
@@ -33,6 +33,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
 
         ((modm, xK_n), spawn "xfce4-terminal"),
         ((modm, xK_i), spawn "firefox"),
+        ((modm .|. shiftMask, xK_i), spawn "firefox --private-window"),
         ((modm, xK_c), spawn "emacsclient --create-frame --no-wait"),
         ((modm, xK_p), spawn "kupfer"),
 
@@ -52,7 +53,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)
     ]
     ++
 
@@ -60,8 +61,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
     -- mod-shift-{o,e,u}, Move client to screen 1, 2, or 3
     [((m .|. modm, key), f sc)
         | (key, sc) <- zip [xK_o, xK_e, xK_u] [0..]
-        , (f, m) <- [(viewScreen, 0), (sendToScreen, shiftMask)]
-    ]
+        , (f, m) <- [(viewScreen def, 0), (sendToScreen def, shiftMask)]]
     ++
 
     -- mod-[1..9], Switch to workspace N
@@ -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