diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index b322f9d..af463c9 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -61,6 +61,16 @@ }; }; } + { + name = "hyprland-resize-${direction}"; + value = { + keys = "SUPER + ALT + ${key}"; + action = { + kind = "resize-window"; + inherit direction; + }; + }; + } ] ) [ @@ -122,6 +132,33 @@ "move-window" = "hl.dsp.window.move(${ lib.generators.toLua { } { inherit (keybind.action) direction workspace; } })"; + "resize-window" = "hl.dsp.window.resize(${ + lib.generators.toLua { } ( + { + down = { + x = 0; + y = 10; + relative = true; + }; + left = { + x = -10; + y = 0; + relative = true; + }; + right = { + x = 10; + y = 0; + relative = true; + }; + up = { + x = 0; + y = -10; + relative = true; + }; + } + .${keybind.action.direction} + ) + })"; } .${keybind.action.kind} )) diff --git a/configs/nixos/registry/keybind.nix b/configs/nixos/registry/keybind.nix index 198d44f..ddaef59 100644 --- a/configs/nixos/registry/keybind.nix +++ b/configs/nixos/registry/keybind.nix @@ -18,6 +18,11 @@ ] && lib.xor (entry.value.action.direction != null) (entry.value.action.workspace != null) ) + || ( + entry.value.action.kind == "resize-window" + && entry.value.action.direction != null + && entry.value.action.workspace == null + ) ) entries; message = "Desktop keybind actions must set the fields their kind requires."; } @@ -41,6 +46,7 @@ "exec" "focus" "move-window" + "resize-window" ]; };