added the lost_window function

This commit is contained in:
Hannes
2026-08-03 22:54:04 +02:00
parent df9c7af7da
commit 79f7de709b
3 changed files with 158 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
function lost_window
if not command -q hyprctl
echo "Only works with Hyprland compositor."
return 1
end
if test (count $argv) -lt 1
echo "Usage: lost_window <number>"
return 1
end
if test (count $argv) -lt 2
set addr (hyprctl clients -j \
| jq -r '.[] | select(.workspace.id == '$argv[1]') | .address' \
| head -n1)
test -n "$addr"; or return 1
hyprctl dispatch "hl.dsp.focus({window = 'address:$addr'})"
end
end