From 2d8cfe75a09978517b8153176488d3fb0033750b Mon Sep 17 00:00:00 2001 From: John Ogle Date: Tue, 2 Dec 2025 16:07:12 -0800 Subject: [PATCH] Align aerospace keybindings with i3+sway and add resize mode - Enable programs.aerospace to ensure config generation - Disable normalizations for pure i3-style tree management - Update layout keybindings to match i3+sway: - cmd-w: accordion-horizontal (tabbed) - cmd-s: accordion-vertical (stacking) - cmd-e: tiles layout with orientation toggle - Replace direct resize bindings with cmd-r resize mode - Add resize mode with hjkl directional controls --- home/roles/aerospace/default.nix | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/home/roles/aerospace/default.nix b/home/roles/aerospace/default.nix index 127f11d..985f8e9 100644 --- a/home/roles/aerospace/default.nix +++ b/home/roles/aerospace/default.nix @@ -76,13 +76,19 @@ in home.packages = [ pkgs.aerospace ] ++ optionals cfg.autoraise.enable [ pkgs.autoraise ]; - # Configure aerospace with user settings + # Enable and configure aerospace + programs.aerospace.enable = true; programs.aerospace.userSettings = mkMerge [ # Default configuration with leader key substitution { + # Disable normalizations for i3-like behavior + enable-normalization-flatten-containers = false; + enable-normalization-opposite-orientation-for-nested-containers = false; + mode.main.binding = { - "${cfg.leader}-slash" = "layout tiles horizontal vertical"; - "${cfg.leader}-comma" = "layout accordion horizontal vertical"; + "${cfg.leader}-w" = "layout accordion horizontal"; # tabbed + "${cfg.leader}-s" = "layout accordion vertical"; # stacking + "${cfg.leader}-e" = "layout tiles horizontal vertical"; # tiles, toggles orientation "${cfg.leader}-shift-q" = "close"; "${cfg.leader}-shift-f" = "fullscreen"; "${cfg.leader}-h" = "focus left"; @@ -93,8 +99,7 @@ in "${cfg.leader}-shift-j" = "move down"; "${cfg.leader}-shift-k" = "move up"; "${cfg.leader}-shift-l" = "move right"; - "${cfg.leader}-minus" = "resize smart -50"; - "${cfg.leader}-equal" = "resize smart +50"; + "${cfg.leader}-r" = "mode resize"; "${cfg.leader}-1" = "workspace 1"; "${cfg.leader}-2" = "workspace 2"; "${cfg.leader}-3" = "workspace 3"; @@ -148,6 +153,20 @@ in "${cfg.leader}-p" = "mode passthrough"; }; + # Resize mode: For window resizing operations + mode.resize.binding = { + h = "resize width -50"; + j = "resize height +50"; + k = "resize height -50"; + l = "resize width +50"; + + minus = "resize smart -50"; + equal = "resize smart +50"; + + esc = "mode main"; + enter = "mode main"; + }; + # Service mode: For deliberate aerospace window management operations mode.service.binding = { esc = ["reload-config" "mode main"];