From 33128fc3c7d942a161c0ac9058f8fe32eeace1eb Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 16:58:27 -0400 Subject: [PATCH] feat(hyprland): migrate desktop utility bindings --- .../modules/desktop/utilities/clipboard.nix | 15 +++--- .../modules/desktop/utilities/recording.nix | 16 +++---- .../modules/desktop/utilities/screenshot.nix | 47 ++++++++++++------- 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/configs/nixos/modules/desktop/utilities/clipboard.nix b/configs/nixos/modules/desktop/utilities/clipboard.nix index 9b9f982..5f965e4 100644 --- a/configs/nixos/modules/desktop/utilities/clipboard.nix +++ b/configs/nixos/modules/desktop/utilities/clipboard.nix @@ -28,6 +28,14 @@ in lib.mkEnableOption "cliphist clipboard history"; config = lib.mkIf config.modules.desktop.utilities.clipboard.enable { + registry.keybind.${config.networking.hostName}.clipboard-history = { + keys = "SUPER + SHIFT + V"; + action = { + kind = "exec"; + command = "${picker}"; + }; + }; + home-manager.users.${user} = { # wl-copy and wl-paste on PATH, so the shell can pipe into and out of the # clipboard. @@ -38,13 +46,6 @@ in # Two watchers record text and images to history, bound to the graphical # session so uwsm starts and stops them with it. services.cliphist.enable = true; - - # $mod is defined by the compositor config these binds share. - /* - wayland.windowManager.hyprland.settings.bind = [ - "$mod SHIFT, V, exec, ${picker}" - ]; - */ }; }; } diff --git a/configs/nixos/modules/desktop/utilities/recording.nix b/configs/nixos/modules/desktop/utilities/recording.nix index c6eb400..1fa9e63 100644 --- a/configs/nixos/modules/desktop/utilities/recording.nix +++ b/configs/nixos/modules/desktop/utilities/recording.nix @@ -6,8 +6,6 @@ }: # Keybound screen recording: pick a region, then toggle a video-only capture. let - user = config.user.name; - slurp = "${pkgs.slurp}/bin/slurp"; wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder"; notify-send = "${pkgs.libnotify}/bin/notify-send"; @@ -44,13 +42,13 @@ in lib.mkEnableOption "wf-recorder screen recording"; config = lib.mkIf config.modules.desktop.utilities.recording.enable { - home-manager.users.${user} = { - # $mod is defined by the compositor config these binds share. - /* - wayland.windowManager.hyprland.settings.bind = [ - "$mod SHIFT, R, exec, ${toggle}" - ]; - */ + registry.keybind.${config.networking.hostName}.recording-toggle = { + keys = "SUPER + SHIFT + R"; + action = { + kind = "exec"; + command = "${toggle}"; + }; }; + }; } diff --git a/configs/nixos/modules/desktop/utilities/screenshot.nix b/configs/nixos/modules/desktop/utilities/screenshot.nix index 016aadd..ec5e65a 100644 --- a/configs/nixos/modules/desktop/utilities/screenshot.nix +++ b/configs/nixos/modules/desktop/utilities/screenshot.nix @@ -37,27 +37,42 @@ in lib.mkEnableOption "screenshots via grimblast and satty"; config = lib.mkIf config.modules.desktop.utilities.screenshot.enable { + registry.keybind.${config.networking.hostName} = { + screenshot-area = { + keys = "Print"; + action = { + kind = "exec"; + command = "${capture "area"}"; + }; + }; + + screenshot-active = { + keys = "SHIFT + Print"; + action = { + kind = "exec"; + command = "${capture "active"}"; + }; + }; + + screenshot-screen = { + keys = "CTRL + Print"; + action = { + kind = "exec"; + command = "${capture "screen"}"; + }; + }; + }; + home-manager.users.${user} = { # satty is a one-shot annotation surface, so float it rather than letting # it claim a tile in the layout. - # windowrule v3 syntax: space-separated field/value tokens, comma - # separated, with matchers under a match: prefix and effects bare. - /* - wayland.windowManager.hyprland.settings.windowrule = [ - "float 1, match:class ^(com\\.gabm\\.satty)$" + wayland.windowManager.hyprland.settings.window_rule = [ + { + match.class = "^(com\\.gabm\\.satty)$"; + float = true; + } ]; - */ - # Print with plain/Shift/Ctrl for region/window/full. - # Super+L is already the hjkl focus and movement bind, so screenshots take - # the Print key instead. - /* - wayland.windowManager.hyprland.settings.bind = [ - ", Print, exec, ${capture "area"}" - "SHIFT, Print, exec, ${capture "active"}" - "CTRL, Print, exec, ${capture "screen"}" - ]; - */ }; }; }