Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.