dotfiles/home/.local/bin/scripts/gui/hyprland/toggle-fake-fullscreen

23 lines
831 B
Text
Raw Normal View History

#!/usr/bin/env bash
2025-02-03 18:32:58 +01:00
set -euo pipefail
2025-02-03 18:32:58 +01:00
#ACTIVE_BORDER_COLOR="rgba(FF327BD1)"
ACTIVE_BORDER_COLOR="rgba(FF6600FF)"
DEFAULT_BORDER_COLOR="rgba(FFA500FF)"
2025-02-03 18:32:58 +01:00
window_address="$(hyprctl activewindow -j | jq -r '.address')"
hyprctl dispatch fullscreenstate -1 2
fullscreen_status="$(hyprctl activewindow -j | jq '.fullscreenClient')"
if [ "$fullscreen_status" = "null" ]; then
echo "Update your hyprland, 'fakeFullscreen' window property not found."
exit 1
elif [ "$fullscreen_status" = "2" ]; then
2025-02-03 18:32:58 +01:00
hyprctl dispatch setprop "address:$window_address" activebordercolor "$ACTIVE_BORDER_COLOR"
elif [ "$fullscreen_status" = "0" ]; then
2025-02-03 18:32:58 +01:00
hyprctl dispatch setprop "address:$window_address" activebordercolor "$DEFAULT_BORDER_COLOR"
else
echo "Unexpected output from 'fullscreenClient' window property: $fullscreen_status"
exit 1
fi