31 lines
583 B
Bash
Executable file
31 lines
583 B
Bash
Executable file
#!/usr/bin/env dash
|
|
|
|
profile="$(powerprofilesctl get)"
|
|
|
|
formatprofile() {
|
|
p="$(echo "$1" | sed 's/power-saver/quiet/g')"
|
|
echo "$(echo "$p" | sed 's/.*/\u&/')"
|
|
}
|
|
|
|
if [ "$1" = "next" ]; then
|
|
case "$profile" in
|
|
performance)
|
|
powerprofilesctl set power-saver
|
|
;;
|
|
balanced)
|
|
powerprofilesctl set performance
|
|
;;
|
|
power-saver)
|
|
powerprofilesctl set balanced
|
|
;;
|
|
*)
|
|
echo "Unknown power profile"
|
|
exit 1
|
|
;;
|
|
esac
|
|
profile="$(powerprofilesctl get)"
|
|
eww update power_profile="$(formatprofile $profile)"
|
|
fi
|
|
|
|
echo "$(formatprofile $profile)"
|
|
|