Files
hyprland-dotfiles/.config/hypr/scripts/tiling-helper/toggle-goxlr-fullscreen.sh
2025-10-16 20:50:11 +02:00

40 lines
979 B
Bash
Executable File

#!/bin/bash
timeout=50 # 10 seconds max (50 * 0.2s)
count=0
while (( count < timeout )); do
win_addr=$(hyprctl clients | awk '
/^Window/ { addr=$2 }
/title: GoXLR Utility/ { print addr }
')
if [[ -n "$win_addr" ]]; then
# Add 0x prefix if missing
if [[ "$win_addr" != 0x* ]]; then
win_addr="0x$win_addr"
fi
# Get fullscreen state (1 or 0)
fullscreen_state=$(hyprctl clients | awk -v addr="${win_addr#0x}" '
$1 == "Window" && $2 == addr { found=1 }
found && /^fullscreen:/ { print $2; exit }
')
if [[ "$fullscreen_state" == "1" ]]; then
hyprctl dispatch fullscreen address:$win_addr
echo "Fullscreen disabled for GoXLR Utility."
else
echo "GoXLR Utility is not fullscreen."
fi
exit 0
fi
sleep 0.2
((count++))
done
echo "GoXLR Utility window not found within timeout." >&2
exit 1