You are not logged in.
Pages: 1
I made a little bash script for laptop to manage acpi events like lid closed, laptop on battery, laptop inactivity, etc ...
The main idea is to control exactly the actions too take when we are on battery or on sector. It's like a mix of laptop-mode-tools and gnome-power-manager but more flexible. You can extend this by adding new rules ( for example what to do when the power button is pressed .)
Depends : acpi ( or Hal, or Upower, as you want ) , kernel's module acpi-cpufreq, cpufrequtils ( You don't need acpid or laptop-mode-tools )
If you use pm-utils >= 1.4, it override laptop-script configuration on resume.
Defaults rules :
- On ac :
* Governor cpu ondemand, normal screensaver.
- On battery :
* Governor cpu conservative , shutdown screen after 5 minutes.
* If battery less than 15%, the governor becomes powersave.
* hibernate after 900s of inactivity and below 5% battery remaining.
* If no battery present, governor cpu on demand.
- On program exception :
* shut down screensaver and governor on demand, no other change are made.
* If battery less than 15%, the governor becomes powersave.
- Closing screen :
* shut down screen on AC
* Hibernate on battery
Look inside the script to put your own rules and powersavings tips. Don't forget to read the installation document.
If you want to try : PKGBUILD
PS : Sorry for my poor english.
Last edited by coolaman (2010-07-05 15:11:18)
Offline
Update of the script :
- Less power consomption .
- Some litlles bugs fix.
Offline
I would try using the ondemand cpu govenor on battery, it uses less power than the others. See www.lesswatts.org for more info if your curious.
Offline
It's easy to remove the governor. Look in the script and remove line 80, 118,137 to 140,181 to 184 and add :
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor on line 40.
With this, only ondemand governor will be available ( both on battery and ac ).
I will test ondemand governor later on my laptop.
One question for you: I see in one of your post that you use acpi-cpufreq-phc. I try it but i can't see if it work ( battery life is still the same without it ). How can i see if it work ?
Thanks.
Offline
Coolaman, this is AWESOME. Five stars, just what I was looking for!
moljac024: No one really knows what happens inside /dev/null... it could be a gateway to another universe....
dunc: If it is, the people who live there must be getting pretty annoyed by now with all the junk we send them.
Offline
A little update :
- Correction of the bug which prevents the computer to hibernate with exception
Coolaman, this is AWESOME. Five stars, just what I was looking for!
Thanks . I'm happy that this script is useful for you
Last edited by coolaman (2009-01-29 15:43:50)
Offline
Update :
Corrections:
- If no battery present when booting, hibernate computer
- Auto suspend if there is no activities don't work.
Offline
I've read the readme and the script, but I think this script will not work with a Core 2 Duo.
Has anyone tried it?
Would it work if I change line 85 from:
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
to
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor && echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
And so for all the lines regarding CPU?
Arch x86_64 on HP 6820s and on HP nx9420. Registered Linux User 350155, since 24-03-2004
"Everyone said that it could not be done, until someone came along who didn't know that."
Offline
I've read the readme and the script, but I think this script will not work with a Core 2 Duo.
Has anyone tried it?
Would it work if I change line 85 from:
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
to
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor && echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
And so for all the lines regarding CPU?
I think whatever you do to cpu0 will also affect cpu1. So it should work, but im not 100% positive on this one.
Offline
Got it working now, but without CPU Governor. After second thoughts I don't need it at all.
Arch x86_64 on HP 6820s and on HP nx9420. Registered Linux User 350155, since 24-03-2004
"Everyone said that it could not be done, until someone came along who didn't know that."
Offline
I have rewrite the script to be more simpler and flexible.
If you find bugs or ameliorations, please tell me.
Last edited by coolaman (2010-07-05 15:12:23)
Offline
Pages: 1