From 9ba6006fca420f6c2889b17a703c913ff0155786 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Tue, 10 Sep 2024 11:26:01 -0700 Subject: [PATCH] [i3] Use home row navigation --- home/modules/i3+sway/default.nix | 84 +++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/home/modules/i3+sway/default.nix b/home/modules/i3+sway/default.nix index 695aad6..08950ee 100644 --- a/home/modules/i3+sway/default.nix +++ b/home/modules/i3+sway/default.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.home.i3_sway; + i3_cfg = config.xsession.windowManager.i3.config; shared_config = recursiveUpdate { modifier = "Mod4"; @@ -25,7 +26,88 @@ in { config = { xsession.windowManager.i3 = let - base_i3_config = recursiveUpdate shared_config {}; + base_i3_config = recursiveUpdate shared_config { + keybindings = { + "${shared_config.modifier}+Return" = "exec ${i3_cfg.terminal}"; + "${shared_config.modifier}+Shift+q" = "kill"; + "${shared_config.modifier}+d" = "exec ${i3_cfg.menu}"; + + "${shared_config.modifier}+h" = "focus left"; + "${shared_config.modifier}+j" = "focus down"; + "${shared_config.modifier}+k" = "focus up"; + "${shared_config.modifier}+l" = "focus right"; + + "${shared_config.modifier}+Shift+h" = "move left"; + "${shared_config.modifier}+Shift+j" = "move down"; + "${shared_config.modifier}+Shift+k" = "move up"; + "${shared_config.modifier}+Shift+l" = "move right"; + + "${shared_config.modifier}+Left" = "focus left"; + "${shared_config.modifier}+Down" = "focus down"; + "${shared_config.modifier}+Up" = "focus up"; + "${shared_config.modifier}+Right" = "focus right"; + + "${shared_config.modifier}+Shift+Left" = "move left"; + "${shared_config.modifier}+Shift+Down" = "move down"; + "${shared_config.modifier}+Shift+Up" = "move up"; + "${shared_config.modifier}+Shift+Right" = "move right"; + + #"${shared_config.modifier}+h" = "split h"; + "${shared_config.modifier}+v" = "split v"; + "${shared_config.modifier}+f" = "fullscreen toggle"; + + "${shared_config.modifier}+s" = "layout stacking"; + "${shared_config.modifier}+w" = "layout tabbed"; + "${shared_config.modifier}+e" = "layout toggle split"; + + "${shared_config.modifier}+Shift+space" = "floating toggle"; + "${shared_config.modifier}+space" = "focus mode_toggle"; + + "${shared_config.modifier}+a" = "focus parent"; + + "${shared_config.modifier}+Shift+minus" = "move scratchpad"; + "${shared_config.modifier}+minus" = "scratchpad show"; + + "${shared_config.modifier}+1" = "workspace number 1"; + "${shared_config.modifier}+2" = "workspace number 2"; + "${shared_config.modifier}+3" = "workspace number 3"; + "${shared_config.modifier}+4" = "workspace number 4"; + "${shared_config.modifier}+5" = "workspace number 5"; + "${shared_config.modifier}+6" = "workspace number 6"; + "${shared_config.modifier}+7" = "workspace number 7"; + "${shared_config.modifier}+8" = "workspace number 8"; + "${shared_config.modifier}+9" = "workspace number 9"; + "${shared_config.modifier}+0" = "workspace number 10"; + + "${shared_config.modifier}+Shift+1" = + "move container to workspace number 1"; + "${shared_config.modifier}+Shift+2" = + "move container to workspace number 2"; + "${shared_config.modifier}+Shift+3" = + "move container to workspace number 3"; + "${shared_config.modifier}+Shift+4" = + "move container to workspace number 4"; + "${shared_config.modifier}+Shift+5" = + "move container to workspace number 5"; + "${shared_config.modifier}+Shift+6" = + "move container to workspace number 6"; + "${shared_config.modifier}+Shift+7" = + "move container to workspace number 7"; + "${shared_config.modifier}+Shift+8" = + "move container to workspace number 8"; + "${shared_config.modifier}+Shift+9" = + "move container to workspace number 9"; + "${shared_config.modifier}+Shift+0" = + "move container to workspace number 10"; + + "${shared_config.modifier}+Shift+c" = "reload"; + "${shared_config.modifier}+Shift+r" = "restart"; + "${shared_config.modifier}+Shift+e" = + "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'"; + + "${shared_config.modifier}+r" = "mode resize"; + }; + }; in { enable = true; config = recursiveUpdate base_i3_config cfg.extraI3Config;