mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-14 04:07:18 +00:00
Fix toggle-powersave script
This commit is contained in:
parent
427d15e717
commit
68b0d96841
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$#" -gt 1 ]; then
|
if [ "$#" -gt 1 ]; then
|
||||||
>&2 echo "Invalid amount of arguments!"
|
echo >&2 "Invalid amount of arguments!"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$#" -eq 1 ]; then
|
elif [ "$#" -eq 1 ]; then
|
||||||
# user specified on/off mode
|
# user specified on/off mode
|
||||||
|
@ -10,12 +10,12 @@ elif [ "$#" -eq 1 ]; then
|
||||||
elif [ "$1" = "off" ]; then
|
elif [ "$1" = "off" ]; then
|
||||||
ENABLE=0
|
ENABLE=0
|
||||||
else
|
else
|
||||||
>&2 echo "Argument $1 not recognized."
|
echo >&2 "Argument $1 not recognized."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Toggle mode
|
# Toggle mode
|
||||||
if [ "$(hyprctl getoption misc:no_vfr -j | jq ".int")" = "1" ]; then
|
if [ "$(hyprctl getoption misc:disable_autoreload -j | jq ".int")" = "1" ]; then
|
||||||
ENABLE=1
|
ENABLE=1
|
||||||
else
|
else
|
||||||
ENABLE=0
|
ENABLE=0
|
||||||
|
@ -24,13 +24,11 @@ fi
|
||||||
|
|
||||||
if [ "$ENABLE" -eq 1 ]; then
|
if [ "$ENABLE" -eq 1 ]; then
|
||||||
echo "Enabled power saving mode"
|
echo "Enabled power saving mode"
|
||||||
hyprctl keyword misc:no_vfr false >/dev/null
|
|
||||||
hyprctl keyword misc:disable_autoreload true >/dev/null
|
hyprctl keyword misc:disable_autoreload true >/dev/null
|
||||||
hyprctl keyword decoration:blur false >/dev/null
|
hyprctl keyword decoration:blur false >/dev/null
|
||||||
hyprctl keyword decoration:drop_shadow false >/dev/null
|
hyprctl keyword decoration:drop_shadow false >/dev/null
|
||||||
else
|
else
|
||||||
echo "Disabled power saving mode"
|
echo "Disabled power saving mode"
|
||||||
hyprctl keyword misc:no_vfr true >/dev/null
|
|
||||||
hyprctl keyword misc:disable_autoreload false >/dev/null
|
hyprctl keyword misc:disable_autoreload false >/dev/null
|
||||||
hyprctl keyword decoration:blur true >/dev/null
|
hyprctl keyword decoration:blur true >/dev/null
|
||||||
hyprctl keyword decoration:drop_shadow true >/dev/null
|
hyprctl keyword decoration:drop_shadow true >/dev/null
|
||||||
|
|
Loading…
Reference in a new issue