added the lost_window function
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user