Quote:
Originally Posted by ajevremovic
After some more research and tuning, I realized it's better to change the plan than the governor. So here is the updated /etc/pm/power.d/cpufreq script:
Code:
#!/bin/sh
# Default value on battery [$1 = "true"]
SCALING_PLAN_BAT="powersave"
# Default value on AC [$1 = "false"]
SCALING_PLAN_AC="balanced"
set_cpufreq() {
case $1 in
bat) SCALING_PLAN=$SCALING_PLAN_BAT;;
ac) SCALING_PLAN=$SCALING_PLAN_AC;;
esac
printf "Setting CPU frequency scaling plan to %s..." "$SCALING_PLAN"
/usr/local/bin/pstate-frequency -S -p $SCALING_PLAN
[ "$?" -eq 0 ] && echo Done. || echo Failed.
}
case $1 in
true) set_cpufreq bat;;
false) set_cpufreq ac;;
*) exit $NA;;
esac
exit 0
|
You might want to take a look at gegechris99's work - his blog entry: ACPI configuration to handle AC adapter events
https://www.linuxquestions.org/quest...ml#post5903041