Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I make my linux system (ubuntu) automatically choose the performance governor when it works with ac and switch automatically to ondemand when it is on battery (and vice versa)?

Is it also possible to switch to the lowest CPU frequency if the battery state drops below a certain value?

I am looking for a solution which is independent of the used desktop environment.

Edit

The solution may interfer with another cpu scaling mechanism installed in ubuntu by default. For example there is a file /etc/init.d/ondemand which sets the CPU to ondemand...

Are there other pitfalls like this one?

share|improve this question
    
I think "interferences" are distro-specific (and setup specific, if you have more than one daemon / use more than one app to manage governors). I'm not really familiar with Ubuntu, I use Arch, I have no /etc/init.d/ondemand. Bottom line is you should have only one app/daemon that controls your governor. –  don_crissti Jun 5 '13 at 18:36

1 Answer 1

You could use laptop-mode-tools. You can specify the governor and max/min frequency while on AC or BATTERY via config files. (Archwiki page)

Another option which gives you more control (rules per battery level) is Cpufreqd (thinkwiki page).

You can also tune your cpu based on acpi events (Archwiki page)

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.