3

I noticed when I plug-in or unplug my laptop's AC adapter, the CPU scaling governor changes to ondemand. Because my laptop gets fairly hot, and I do nothing intensive on it, I prefer powersave at all times... and it helps keep my lap cool.

Is there a way to prevent Xubuntu from automatically changing it to ondemand when I plug/unplug the AC adapter?

I'm using Xubuntu 12.10 if that's relevant.

1 Answer 1

0

This is probably a silly pm script that is doing this but I don't know it off the top of my head. If you militantly want to stick to powersave, run the following in a terminal:

sudo install -b -m 744 <(<<EOF
#! /bin sh

sleep 5

for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
do
    [ -f $CPUFREQ ] || continue
    echo -n powersave > $CPUFREQ
done
EOF) /etc/pm/power.d/99-powersave

The embedded script there will then run whenever your power situation changes. We don't really need to target the on_ac_power event at all. This will just set powersave whenever it can.

It sleeps for five seconds before running just in case whatever is setting it to ondemand takes a little while to trigger.

1
  • What's that line at the beginning of the script ?
    – userDepth
    Sep 25, 2016 at 15:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .