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
This commit is contained in:
2025-12-02 16:07:12 -08:00
parent 385fd798de
commit 2d8cfe75a0

View File

@@ -76,13 +76,19 @@ in
home.packages = [ pkgs.aerospace ] home.packages = [ pkgs.aerospace ]
++ optionals cfg.autoraise.enable [ pkgs.autoraise ]; ++ optionals cfg.autoraise.enable [ pkgs.autoraise ];
# Configure aerospace with user settings # Enable and configure aerospace
programs.aerospace.enable = true;
programs.aerospace.userSettings = mkMerge [ programs.aerospace.userSettings = mkMerge [
# Default configuration with leader key substitution # 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 = { mode.main.binding = {
"${cfg.leader}-slash" = "layout tiles horizontal vertical"; "${cfg.leader}-w" = "layout accordion horizontal"; # tabbed
"${cfg.leader}-comma" = "layout accordion horizontal vertical"; "${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-q" = "close";
"${cfg.leader}-shift-f" = "fullscreen"; "${cfg.leader}-shift-f" = "fullscreen";
"${cfg.leader}-h" = "focus left"; "${cfg.leader}-h" = "focus left";
@@ -93,8 +99,7 @@ in
"${cfg.leader}-shift-j" = "move down"; "${cfg.leader}-shift-j" = "move down";
"${cfg.leader}-shift-k" = "move up"; "${cfg.leader}-shift-k" = "move up";
"${cfg.leader}-shift-l" = "move right"; "${cfg.leader}-shift-l" = "move right";
"${cfg.leader}-minus" = "resize smart -50"; "${cfg.leader}-r" = "mode resize";
"${cfg.leader}-equal" = "resize smart +50";
"${cfg.leader}-1" = "workspace 1"; "${cfg.leader}-1" = "workspace 1";
"${cfg.leader}-2" = "workspace 2"; "${cfg.leader}-2" = "workspace 2";
"${cfg.leader}-3" = "workspace 3"; "${cfg.leader}-3" = "workspace 3";
@@ -148,6 +153,20 @@ in
"${cfg.leader}-p" = "mode passthrough"; "${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 # Service mode: For deliberate aerospace window management operations
mode.service.binding = { mode.service.binding = {
esc = ["reload-config" "mode main"]; esc = ["reload-config" "mode main"];