Skip to content
32 changes: 10 additions & 22 deletions Configs/.local/lib/hyde/gamemode.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use hyprctl for this. Sorry for the misunderstanding. Thanks!

HYPRGAMEMODE=$(hyprctl getoption animations:enabled | sed -n '1p' | awk '{print $2}')
if [ "$HYPRGAMEMODE" = 1 ]; then
hyprctl -q --batch "\
keyword animations:enabled 0;\
keyword decoration:shadow:enabled 0;\
keyword decoration:blur:xray 1;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0 ;\
keyword decoration:active_opacity 1 ;\
keyword decoration:inactive_opacity 1 ;\
keyword decoration:fullscreen_opacity 1 ;\
keyword layerrule noanim,waybar ;\
keyword layerrule noanim,swaync-notification-window ;\
keyword layerrule noanim,swww-daemon ;\
keyword layerrule noanim,rofi
"
hyprctl 'keyword windowrule opaque,class:(.*)'
exit
else
LOCK_FILE="${XDG_RUNTIME_DIR}/hyde/gamemode.lck"

if [ -f "$LOCK_FILE" ]; then
# Gamemode is ON → turn it OFF
hyprctl reload config-only -q
rm -f "$LOCK_FILE"
else
# Gamemode is OFF → turn it ON
mkdir -p "${XDG_RUNTIME_DIR}/hyde"
hyprctl keyword source "${XDG_CONFIG_HOME}/hypr/workflows/gaming.conf"
touch "$LOCK_FILE"
fi
Loading