hyprland scripts
This commit is contained in:
31
.config/hypr/scripts/tiling-helper/move-grayjay.sh
Executable file
31
.config/hypr/scripts/tiling-helper/move-grayjay.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
timeout=50 # 10 seconds max (50 * 0.2s)
|
||||
count=0
|
||||
|
||||
while (( count < timeout )); do
|
||||
# Grab both address and floating status
|
||||
read -r win_addr floating <<< $(hyprctl -j clients | jq -r '.[] | select(.title == "Grayjay") | "\(.address) \(.floating)"')
|
||||
|
||||
if [[ -n "$win_addr" ]]; then
|
||||
# Add 0x prefix if missing
|
||||
if [[ "$win_addr" != 0x* ]]; then
|
||||
win_addr="0x$win_addr"
|
||||
fi
|
||||
|
||||
# If the window is floating, toggle to make it tiled
|
||||
if [[ "$floating" == "true" ]]; then
|
||||
hyprctl dispatch togglefloating address:$win_addr
|
||||
fi
|
||||
|
||||
# Move to workspace 2 silently
|
||||
hyprctl dispatch movetoworkspacesilent 2,address:$win_addr
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sleep 0.2
|
||||
((count++))
|
||||
done
|
||||
|
||||
echo "Grayjay window not found within timeout." >&2
|
||||
exit 1
|
||||
39
.config/hypr/scripts/tiling-helper/toggle-goxlr-fullscreen.sh
Executable file
39
.config/hypr/scripts/tiling-helper/toggle-goxlr-fullscreen.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user