LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-21-2010, 12:24 AM   #1
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 142Reputation: 142
Using the "powersave" governor on battery and "ondemand" governor on AC power


I want my computer to use the "ondemand" CPU frequency scaling governor when plugged in and switch to the "powersave" governor when running on battery power.

Is this possible?

Last edited by piratesmack; 01-21-2010 at 12:55 PM.
 
Old 01-21-2010, 01:19 AM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
The answer is yes
And here's a good explanation on how to do it trough scripts: http://granapadano.blogspot.com/2009...-linux-26.html
 
Old 01-21-2010, 11:52 AM   #3
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Original Poster
Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by gbonvehi View Post
The answer is yes
And here's a good explanation on how to do it trough scripts: http://granapadano.blogspot.com/2009...-linux-26.html
Thanks, I'll check that out
 
Old 01-21-2010, 12:30 PM   #4
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 110Reputation: 110
That's amazing, I was just thinking about this exact same thing the other day. I didn't really do anything about it, just thinking about it. Maybe this is a sign.....
 
Old 01-21-2010, 12:42 PM   #5
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
If you have KDE 4 you just need the governors in your kernel and powerdevil will start using them.

Regards,

Alunduil
 
Old 01-21-2010, 12:54 PM   #6
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Original Poster
Rep: Reputation: 142Reputation: 142
Worked great. I'd prefer to use a bash script instead of python, so I came up with this.

Code:
#!/bin/sh

if grep -q 'on-line' /proc/acpi/ac_adapter/*/state; then
  GOV="ondemand"
else
  GOV="powersave"
fi

for cpu in /sys/devices/system/cpu/cpu?/cpufreq/scaling_governor; do
  echo $GOV > $cpu
done
Thanks again.

Last edited by piratesmack; 06-06-2010 at 02:29 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Disabling hardware detection of "reboot" and "power" buttons Sabinou Linux - General 3 08-21-2006 07:03 PM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration