From 629fd708d77480231c8f30c170b107f11e8a01fe Mon Sep 17 00:00:00 2001 From: rope Date: Thu, 9 Jul 2026 12:16:27 +0100 Subject: [PATCH] hyprland: auto-allow screenshare restore tokens Co-Authored-By: Claude Fable 5 --- settings/hyprland.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 315a33d..0e02254 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -78,6 +78,19 @@ in # separate hyprpaper daemon. stylix.targets.hyprpaper.enable = false; + # Screenshare picker: auto-allow restore tokens (the "allow a restore + # token" checkbox) so Vesktop/Discord gets a token on the first pick + # instead of re-prompting. XDPH parses "[SELECTION]/..." from the + # picker's stdout; flag 'r' = token allowed, so inject it always. + xdg.configFile."hypr/xdph.conf".text = '' + screencopy { + custom_picker_binary = ${pkgs.writeShellScript "share-picker-auto-restore" '' + ${pkgs.xdg-desktop-portal-hyprland}/bin/hyprland-share-picker "$@" \ + | ${pkgs.gnused}/bin/sed 's/^\[SELECTION\]/[SELECTION]r/' + ''} + } + ''; + wayland.windowManager.hyprland = { enable = true; configType = "lua";