Difference between revisions of "Powerdown"

From ArchWiki
Jump to: navigation, search
(Packages that are no longer necessary after installation: Do a little homework before spreading false information. powernow is also utterly unrelated to powertop)
(Installation: Let's not assume AUR Helpers, especially bad ones. It's "e.g." not "f.e." This article still needs a lot of work. Please refer to the style guides.)
Line 12: Line 12:
  
 
==Installation==
 
==Installation==
Use your favourite AUR-helper to install {{AUR|powerdown}}, f.e.
+
{{AUR|powerdown}} is available from the [[AUR]].
# packer -S powerdown xorg-xset
+
  
Add the following options to your kernel boot-line (f.e. in grub's menu.lst):
+
Add the following options to your kernel command line:
 
  pcie_aspm=force i915.i915_enable_rc6=1
 
  pcie_aspm=force i915.i915_enable_rc6=1
  
Add the following lines to ~/.xinitrc to turn off your screen after 5 minutes of idling by default:
+
Add the following lines to {{ic|~/.xinitrc}} to turn off your screen after 5 minutes of idling by default:
# screen powersave
+
{{hc|~/.xinitrc|
xset +dpms
+
# screen powersave
xset dpms 0 0 300
+
xset +dpms
 +
xset dpms 0 0 300
 +
}}
  
{{Note|Resetting the dpms settings will probably enable the default blanking after 10 minutes. If you dislike this, add 'consoleblank=0' to your boot parameters and run these xset commands (this would be a great addition to the powerdown scripts):
+
{{Note|Resetting dpms settings will probably enable the default blanking after 10 minutes. If unsatisfactory, add {{ic|1=consoleblank=0}} to the kernel command line and run the following {{ic|xset}} commands (this would be a great addition to the powerdown scripts):
 
  xset s off
 
  xset s off
 
  xset s noblank
 
  xset s noblank
Line 31: Line 32:
 
}}
 
}}
  
The scripts are located at /usr/bin. Should you want to disable certain tweaks, you can easily comment them out by prepending '#'
+
The {{ic|powerdown}} shell script located in {{ic|/usr/bin}} can be customised to your needs. To disable any undesired features simply comment out its appropriate line.
  
 
==Usage==
 
==Usage==

Revision as of 14:40, 29 August 2012

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Powerdown is a bunch of scripts to take the hassle out of maximizing battery-life.

Note: Use at your own risk. It is recommended to read through all the tweaks in order to disable those that might not be compatible with your system.

Installation

powerdownAUR is available from the AUR.

Add the following options to your kernel command line:

pcie_aspm=force i915.i915_enable_rc6=1

Add the following lines to ~/.xinitrc to turn off your screen after 5 minutes of idling by default:

~/.xinitrc
# screen powersave
xset +dpms
xset dpms 0 0 300
Note: Resetting dpms settings will probably enable the default blanking after 10 minutes. If unsatisfactory, add consoleblank=0 to the kernel command line and run the following xset commands (this would be a great addition to the powerdown scripts):
xset s off
xset s noblank
xset s noexpose
xset c on
xset -dpms

The powerdown shell script located in /usr/bin can be customised to your needs. To disable any undesired features simply comment out its appropriate line.

Usage

The following table presents all scripts installed.

Name Function
powerdown, powerup Powers everything down or up.
powernow Displays current power usage and settings.
suspend-to-mem Suspends to RAM.
suspend-to-disk Suspends to HDD, creates a 2GB swap file at the first time doing so.
turn-off Wrapper around poweroff.
usb-bind, usb-unbind Both are probably called by the other scripts.
pm-is-supported, pm-powersave, pm-suspend, pm-hibernate Wrappers with pm-utils syntax (for legacy support?).

After a reboot the scripts can now be run in a terminal.

To run powerdown on startup add the following to /etc/rc.local:

powerdown &


Here's an example for a slightly more sophisticated script that uses either powerdown or powerup depending on your current power supply:

if grep -Fxq "0" /sys/class/power_supply/AC0/online; then
    powerdown
else
    powerup
fi


Modify "/sys/class/power_supply/AC0/online" line if necessary so that it corresponds with your system. Save this as a script and have it run from /etc/rc.local

If it does not run automatically at power state change, add "upower -e" to your ~/.xinitrc

FAQ

I do get more spinups and clicks from my HDD. Where is this setting stored in powerdown?

Set the following tweak to a higher value:

hdparm -B

Packages that are no longer necessary after installation

Source

  1. powertop, powertop2: these packages have no updates for at least 3-4 years. if you think kernel has no changes on power management for 3 or 4 years, go ahead and continue to use them. Replacement: powernow is included in new powerdown. it shows laptop power usage in mWh. the value is usually between 10000 to 25000.
  2. laptop-mode-tools: this is a huge framework on power management. It has dozens of configs you need to setup, which normally no one knows how to control them. I think it is a "troubleware"; to use it properly, you have to google more. most of time, you dont even know what works or not. Replacement: powerdown shows what does not work right in the screen. it contains all the rules optimized that just work.
  3. tuxonice, uswsusp, pm-utils: too hassle to set things up. again, they complicate suspend and resume. the default kernel already support suspends and resume pretty well. Replacement: ps2mem uses default kernel for ram suspend and resume. you just run "sudo suspend-to-mem"; no framework, no setup.
  4. turn-off solves a bug in kernel(even in 3,4 rc that ehci_hcd messes up shutdown when it is set to powersave mode). This is a wrapper for 'poweroff'. You just call it to shut down your arch box.

See also