eww -> scripts -> power_profile: Now uses powerprofilesctl instead of asusctl
This commit is contained in:
parent
f5bed6145b
commit
827c4f8c03
1 changed files with 26 additions and 5 deletions
|
@ -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)"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue