Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
    [ -f $CPUFREQ ] || continue
    echo -n powersave > $CPUFREQ
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


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.