diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index 5dee9af..062740e 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -93,6 +93,32 @@ } ] )) + { + hyprland-toggle-floating = { + keys = "SUPER + Space"; + action.kind = "toggle-floating"; + }; + + hyprland-toggle-fullscreen = { + keys = "SUPER + F"; + action.kind = "toggle-fullscreen"; + }; + + hyprland-toggle-split = { + keys = "SUPER + T"; + action.kind = "toggle-split"; + }; + + hyprland-close-window = { + keys = "SUPER + SHIFT + Q"; + action.kind = "close-window"; + }; + + hyprland-kill-window = { + keys = "SUPER + CTRL + Q"; + action.kind = "kill-window"; + }; + } ]; # This program integration owns the session, portals, and polkit, launched @@ -160,6 +186,11 @@ .${keybind.action.direction} ) })"; + "toggle-floating" = ''hl.dsp.window.float({ action = "toggle" })''; + "toggle-fullscreen" = "hl.dsp.window.fullscreen()"; + "toggle-split" = ''hl.dsp.layout("togglesplit")''; + "close-window" = "hl.dsp.window.close()"; + "kill-window" = "hl.dsp.window.kill()"; } .${keybind.action.kind} )) diff --git a/configs/nixos/registry/keybind.nix b/configs/nixos/registry/keybind.nix index 7abd253..5436544 100644 --- a/configs/nixos/registry/keybind.nix +++ b/configs/nixos/registry/keybind.nix @@ -23,6 +23,18 @@ && entry.value.action.direction != null && entry.value.action.workspace == null ) + || ( + builtins.elem entry.value.action.kind [ + "toggle-floating" + "toggle-fullscreen" + "toggle-split" + "close-window" + "kill-window" + ] + && entry.value.action.command == null + && entry.value.action.direction == null + && entry.value.action.workspace == null + ) ) entries; message = "Desktop keybind actions must set the fields their kind requires."; } @@ -54,6 +66,11 @@ "focus" "move-window" "resize-window" + "toggle-floating" + "toggle-fullscreen" + "toggle-split" + "close-window" + "kill-window" ]; };