Difference between revisions of "Power Management"
| Line 11: | Line 11: | ||
'''$''' sudo nano -w /etc/acpi/default.sh | '''$''' sudo nano -w /etc/acpi/default.sh | ||
=== /etc/acpi/default.sh === | === /etc/acpi/default.sh === | ||
| + | |||
| + | By default, the only action set for the acpi deamon is to initiate shutdown when the power button is pressed. This isn't ideal, especially from within X, where you can use features from your window manager to control your power settings; it's much better to ask what to do in this case. Comment the line containing ''/sbin/init 0'' out. | ||
| + | case "$action" in | ||
| + | power) | ||
| + | # the following line commented out so xfce power manager prompts for action when power button is pres$ | ||
| + | # /sbin/init 0 | ||
| + | ;; | ||
Revision as of 12:35, 23 December 2010
Configuring Hardware - Power Management
If you have a laptop, you will probably want to make a few measures to extend your battery life, such as throttling down your CPU, dimming your LCD backlight, and other things. In this case you will want to make sure the laptop USE flag is set in your /etc/make.conf. If you have a dell laptop, you will also want to add the dell USE flag. Chances are you have already built some of the packages that accept these USE flags, so you may want to rebuild all affected packages on your system.
$ sudo emerge -avDN world
If it hasn't been installed already, you'll want to install the acpi (Advanced Configuration and Power Interface) daemon.
$ sudo emerge -av apcid
Once the package is emerged, we'll start the apci daemon and add it to startup.
$ sudo /etc/init.d/acpid start $ sudo rc-update add acpid default
The Gentoo power management guide suggests you create a battery runlevel to manage your system while running on battery mode. The drawback to this is having to manage multiple runlevels, and having to add new services to both runlevels. Thankfully, power management can be done fairly easily using the default script provided.
$ sudo nano -w /etc/acpi/default.sh
/etc/acpi/default.sh
By default, the only action set for the acpi deamon is to initiate shutdown when the power button is pressed. This isn't ideal, especially from within X, where you can use features from your window manager to control your power settings; it's much better to ask what to do in this case. Comment the line containing /sbin/init 0 out.
case "$action" in power) # the following line commented out so xfce power manager prompts for action when power button is pres$ # /sbin/init 0 ;;