LinuxQuestions.org
Visit Jeremy's Blog.
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 12-11-2005, 06:53 PM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
Changing ACPI cpufreq when running on battery


Is there any way to get Slackware to automagically run a script that changes the scaling_governor from ondemand or performance to powersave once the system runs on batteries, and then back to ondemand or performance when it's plugged in again?

I'm currently running echo -n ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor on boot, but I haven't found any hooks anywhere under ACPI to run a similar (except powersave) when the system is unplugged..

Anyone?

-Y1
 
Old 12-11-2005, 07:05 PM   #2
Namaseit
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 325

Rep: Reputation: 30
Well if I am not mistaken you can see if the laptop is plugged in or not in /proc/acpi. Write a script to just parse the right file every what, 1 minute, maybe 30 seconds. Then if it shows it's not plugged in it changes the schema. Simple enough.
 
Old 12-11-2005, 07:14 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
That's one way of doing it, but being a purist I'm not a big fan of scripts that poll a file every n seconds, so what I was hoping for is that there's a hook somewhere that runs a script when I unplug power.
There is a directory called /etc/acpi that contains some default actions and a handler-script, but all documentation I've found so far relate to putting the system into hibernate/sleep, and not just changing runlevel when unpowering the system.

-Y1
 
Old 12-11-2005, 08:28 PM   #4
Namaseit
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 325

Rep: Reputation: 30
Not sure what the 'purist' reference is, but to me whatever works is best. To each his own I suppose. Scripts are just an easy way to do tasks. You can do that in >30 lines of bash scripting, but eh.
 
Old 12-12-2005, 08:15 AM   #5
cathectic
Member
 
Registered: Sep 2004
Location: UK, Europe
Distribution: Slackware64
Posts: 761

Rep: Reputation: 34
You could use something like cpufreqd to automatically change the governor when on batteries (laptop-mode-tools also has some basic support for changing cpu frequency governor).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FATAL: Error inserting acpi cpufreq in fedora 4 CapCavernaX Linux - Newbie 14 10-21-2006 01:01 PM
FSC Amilo M 7400, SuSE 9.1pro, Problems w/ Cpufreq, Battery ruh31 Linux - Laptop and Netbook 8 10-03-2004 12:17 PM
ACPI + battery augamecock Linux - Laptop and Netbook 2 04-05-2004 06:42 AM
What's the deal with ACPI, cpufreq, and powernow-k7 on Emachines m5310 adamis Linux - Laptop and Netbook 10 02-14-2004 01:55 AM
battery status with ACPI cornucopiae Linux - Laptop and Netbook 5 08-03-2003 11:56 AM


All times are GMT -5. The time now is 03:05 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration