From 3f4ee2579b446f15de48d8a5ab8b046e4f7567c1 Mon Sep 17 00:00:00 2001 From: rope Date: Thu, 15 Oct 2026 21:00:21 +0100 Subject: [PATCH] Screenshare: auto-pick gamescope windows Co-Authored-By: Claude Opus 5.5 --- settings/hyprland.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index bcfe3b7..ed0a583 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -118,10 +118,10 @@ in # picker skips the dialog when a game is open: XDPH hands it the window # list as id[HC>]class[HT>]title[HE>]address[HA>]… and reads back # "[SELECTION]/window:" (flag r = token allowed). Hearthstone - # wins, else any other Proton window (steam_app_*) that isn't a launcher - # or HDT. Gaming's patched Vesktop writes the time to xdph-pick-manually - # right before asking the portal ("Pick Another Window", shift-click) - # to get the normal picker instead. + # wins, then a nested gamescope window, then any other Proton window + # (steam_app_*) that isn't a launcher or HDT. Gaming's patched Vesktop + # writes the time to xdph-pick-manually right before asking the portal + # ("Pick Another Window", shift-click) to get the normal picker instead. # # After answering, it grim-shots the selection to xdph-preview.jpg for # Vesktop's dialog (~70ms vs Electron's ~1s PipeWire thumbnail). grim @@ -154,9 +154,10 @@ in } game=$(entries "" ' $2 ~ /^steam_app_/ && $3 == "Hearthstone" { hs = $1 } + $2 == "gamescope" && !gs { gs = $1 } $2 ~ /^steam_app_/ && $3 != "" && !other \ && $3 !~ /^(Battle\.net|Hearthstone Deck Tracker|HearthstoneOverlay)/ { other = $1 } - END { print hs != "" ? hs : other }') + END { print hs != "" ? hs : gs != "" ? gs : other }') if [ -n "$game" ] && (( now - forced > 10 )); then selection=r/window:$game