2024-01-25 14:39:08 +01:00
|
|
|
#!/bin/dash
|
|
|
|
|
2024-04-19 11:18:45 +02:00
|
|
|
profile="$(powerprofilesctl get)"
|
|
|
|
|
|
|
|
formatprofile() {
|
|
|
|
p="$(echo "$1" | sed 's/power-saver/quiet/g')"
|
|
|
|
echo "$(echo "$p" | sed 's/.*/\u&/')"
|
|
|
|
}
|
|
|
|
|
2024-01-25 14:39:08 +01:00
|
|
|
if [ "$1" = "next" ]; then
|
2024-04-19 11:18:45 +02:00
|
|
|
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)"
|
2024-01-25 14:39:08 +01:00
|
|
|
fi
|
2024-04-19 11:18:45 +02:00
|
|
|
|
|
|
|
echo "$(formatprofile $profile)"
|
2024-01-25 14:39:08 +01:00
|
|
|
|