From 9ce0ee6dcca19dc530c30936e5cd38d7c424840e Mon Sep 17 00:00:00 2001 From: jasmine Date: Fri, 3 Oct 2025 09:54:37 +0800 Subject: [PATCH] refactor: simplify navigation keybinds Replace Navigation2D directional navigation with simpler window cycling. Arrow keys now cycle windows/workspaces, shifted arrows for rotation/screens. --- src/xmonad.hs | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/src/xmonad.hs b/src/xmonad.hs index 4b5945d..03864d7 100644 --- a/src/xmonad.hs +++ b/src/xmonad.hs @@ -1,7 +1,7 @@ import Data.List as L import XMonad import XMonad.Actions.CycleWS -import XMonad.Actions.Navigation2D +import XMonad.Actions.CycleWindows import XMonad.Actions.RotSlaves import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops @@ -29,7 +29,6 @@ main = xmonad . docks . ewmhFullscreen . ewmh - . withNavigation2DConfig def . withSB myXmobar $ myConfig @@ -85,30 +84,24 @@ myKeymap = -- - -- Layout Navigation + -- Navigation -- - -- directional navigation of windows - , ("M-" , windowGo U False) - , ("M-" , windowGo L False) - , ("M-" , windowGo D False) - , ("M-" , windowGo R False) - -- cycle windows - , ("M-" , windows W.focusUp ) - , ("M-", windows W.focusDown) - - -- window rotation - , ("M-C-", rotAllUp) - , ("M-C-", rotAllDown) + , ("M-" , windows W.focusUp ) + , ("M-", windows W.focusDown) -- cycle workspaces - , ("M-", moveTo Prev hiddenWS) - , ("M-" , moveTo Next hiddenWS) + , ("M-" , moveTo Prev hiddenWS) + , ("M-", moveTo Next hiddenWS) - -- focus screens (directional) - , ("M-C-", screenGo L False) -- focus left monitor - , ("M-C-", screenGo R False) -- focus right monitor + -- window rotation + , ("M-S-", rotAllUp) + , ("M-S-", rotAllDown) + + -- focus screens + , ("M-S-", prevScreen) + , ("M-S-", nextScreen) -- switch workspaces , ("M-1", windows $ W.greedyView "code" ) @@ -125,14 +118,14 @@ myKeymap = , ("M-S-5", windows $ W.shift "misc" ) -- master pane manipulation - , ("M-C-", sendMessage Shrink) -- control layout: shrink master - , ("M-C-", sendMessage Expand) -- control layout: expand master - , ("M-S-", sendMessage (IncMasterN 1)) -- shift windows: more in master - , ("M-S-", sendMessage (IncMasterN (-1))) -- shift windows: fewer in master + , ("M-", sendMessage Shrink) -- shrink master pane width + , ("M-", sendMessage Expand) -- expand master pane width + , ("M-", sendMessage (IncMasterN 1)) -- more windows in master + , ("M-", sendMessage (IncMasterN (-1))) -- fewer windows in master -- master window operations - , ("M-", windows W.focusMaster) - , ("M-S-", windows W.swapMaster) + , ("M-", windows W.focusMaster) + , ("M-S-", windows W.swapMaster ) --