Feb. 1, 2009, 9:27 p.m.
posted by void
Put Your Laptop to Sleep
Close the lid and save some power. Part of proper power management is the ability to put your laptop to sleep. ACPI sleep is defined as a state where the system is still technically powered on, but the screen and hard disk are powered down and the computer is using just enough power to keep the contents of RAM alive. The Ubuntu development team has devoted an immense amount of effort toward getting ACPI power management working properly. As it stands, Ubuntu is power-management-friendly right out of the box, thanks to the recent addition of the gnome-power-manager package. It turns out there's not much required to get most modern laptops to sleep and wake up correctly. Getting Some SleepThe Dapper Drake release of Ubuntu Linux includes the new gnome-power-manager package, which enables ACPI sleep much like the system-tray power applet in Windows. Finally, sleep "just works" in Linux. The gnome-power-manager applet is configured to start automatically, and it lives in GNOME's panel notification area. If you right-click on the little battery icon, you'll see a menu pop up, as shown in Figure. gnome-power-manager in action
This deceptively simple little application gives you a lot of control over your laptop's sleep behavior. If you click on Preferences, you'll see the Power Management Preferences dialog box shown in Figure. In this dialog's Sleep tab, you can configure different behavior depending on whether you're plugged into AC power or running on battery. One of the most interesting features is your ability to control the backlight brightness of your laptop's screen depending on the machine's power state. It happens to work out that a large consumer of power in a laptop is the screen's backlight, so being able to automatically turn down that lamp while on battery will help squeeze more runtime out of the system while it's unplugged. The Sleep tab of gnome-power-manager
The Options tab (see Figure) is where you can set the default type of sleep you wish for the system to use, as well as what actions will engage the sleep mechanism. For this hack, the default sleep type is set to Suspend, which refers to ACPI sleep. (Hibernate [Hack #39]">Figure) is where you can set the default type of sleep you wish for the system to use, as well as what actions will engage the sleep mechanism. For this hack, the default sleep type is set to Suspend, which refers to ACPI sleep. (Hibernate [Hack #39] is a totally different type of sleep mechanism.) If you wish, under the Actions section of the dialog box, you can set the system to automatically sleep when the laptop lid is closed. This is a very handy feature if you're on the go: simply shut the lid and run off to your next appointment; then open the lid later, and the machine will wake up without any intervention. gnome-power-manager's Options tab
The Advanced tab of the dialog (Figure) controls the notification icon's behavior. If you want the icon to appear only when you're charging or discharging, or you want to turn off the icon altogether, here's where you change those settings. gnome-power-manager's Advanced dialog
When you have all your settings configured to your liking, simply click the Close button, and the dialog box will close, saving your configuration changes. Testing ACPI SleepYour system is now ready for you to test sleep mode. Ensure that your system is running on battery; then simply shut the lid of the laptop and see what happens. You should hear the hard disk power down, and one of the power LEDs should indicate a power-state change by blinking or some other method. Hopefully, your machine went to sleep properly. Now you need to see if it wakes up correctly. Simply open the lid, and the computer should start waking up. When it's ready for use, you'll be prompted for your system password by gnome-screensaver. Enter your password, and your system should be in the exact same state as it was when you powered it off. Thanks to the hard work of the Ubuntu developers, something that used to be extremely difficult to accomplish in Linux has been made very easy. |
- Comment
