mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-27 21:54:34 +00:00
36 lines
879 B
Bash
Executable file
36 lines
879 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ "$#" -gt 1 ]; then
|
|
echo >&2 "Invalid amount of arguments!"
|
|
exit 1
|
|
elif [ "$#" -eq 1 ]; then
|
|
# user specified on/off mode
|
|
if [ "$1" = "on" ]; then
|
|
ENABLE=1
|
|
elif [ "$1" = "off" ]; then
|
|
ENABLE=0
|
|
else
|
|
echo >&2 "Argument $1 not recognized."
|
|
exit 1
|
|
fi
|
|
else
|
|
# Toggle mode
|
|
if [ "$(hyprctl getoption misc:disable_autoreload -j | jq ".int")" = "1" ]; then
|
|
ENABLE=1
|
|
else
|
|
ENABLE=0
|
|
fi
|
|
fi
|
|
|
|
if [ "$ENABLE" -eq 1 ]; then
|
|
echo "Enabled power saving mode"
|
|
hyprctl keyword misc:disable_autoreload true >/dev/null
|
|
hyprctl keyword decoration:blur false >/dev/null
|
|
hyprctl keyword decoration:drop_shadow false >/dev/null
|
|
else
|
|
echo "Disabled power saving mode"
|
|
hyprctl keyword misc:disable_autoreload false >/dev/null
|
|
hyprctl keyword decoration:blur true >/dev/null
|
|
hyprctl keyword decoration:drop_shadow true >/dev/null
|
|
fi
|