eww -> scripts -> power_profile: Now uses powerprofilesctl instead of asusctl

This commit is contained in:
GaspardCulis 2024-04-19 11:18:45 +02:00
parent f5bed6145b
commit 827c4f8c03
No known key found for this signature in database
GPG key ID: BC18146756955609

View file

@ -1,10 +1,31 @@
#!/bin/dash #!/bin/dash
profile="$(powerprofilesctl get)"
formatprofile() {
p="$(echo "$1" | sed 's/power-saver/quiet/g')"
echo "$(echo "$p" | sed 's/.*/\u&/')"
}
if [ "$1" = "next" ]; then if [ "$1" = "next" ]; then
asusctl profile -n case "$profile" in
profile=$(asusctl profile -p | sed s:'Active profile is '::) performance)
eww update power_profile="$profile" powerprofilesctl set power-saver
else ;;
asusctl profile -p | sed s:'Active profile is ':: 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 fi
echo "$(formatprofile $profile)"