#!/usr/bin/env sh
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ] ; then
    hyprctl --batch "\
        keyword animations:enabled 0;\
        keyword decoration:shadow:enabled 0;\
        keyword decoration:blur:enabled 0;\
        keyword decoration:blur:ignore_opacity 1;\
        keyword decoration:blur:new_optimizations 1;\
        keyword decoration:blur:xray 1;\
        keyword decoration:active_opacity 1;\
        keyword plugin:hyprfocus:fade_opacity 1"

    if pgrep waybar > /dev/null; then
        pkill waybar 
        # TODO: lite waybar version
        $HOME/.config/waybar/run.sh
    fi
    exit
fi

if pgrep waybar > /dev/null; then
    pkill waybar
    $HOME/.config/waybar/run.sh
fi

hyprctl reload
