Summary

To maintain simplicity, Ubuntu's power management interface allows configuration only of those options that people are likely to want to change (with other options having sane defaults, not configurable graphically). We will present battery and power information for the computer itself and also any other battery-powered devices which hal can tell us about.

Rationale

There should be simple, reliable, and understandable methods of:

Currently people need to edit text files in /etc to enable suspend to RAM, and to select which services will be restarted. Also, it's currently impossible to configure how the system should behave in various situations, such as on lid close. All of these points should be configurable graphically.

Use cases

Design

Power Manager Interface

The gnome-power-manager package provides us with a notification-area icon which displays information about the battery status. It should be possible to get it to provide a popup of the current status on a given keypress (many laptops have a battery key which would be ideal for this).

Shutdown confirmation alert

Pressing the power button on the computer puts up the shutdown alert immediately.

The Alert provides for shutting down the computer, rebooting it, putting it to sleep, etc.

Power Management preferences

By using the gnome-power-manager preferences applet we reduce the development work needed at the expense of one or two of our use-cases being incomplete. In particular, Candace's iMacs won't sleep when noone is logged in and Courtney will still be at the mercy of her malicious sister.

Implementation

For Ubuntu, gnome-power-manager will be used. With a small amount of work, this should be suitable for Xubuntu - KDE already has a runtime configuration system. The gnome-power-manager package provides us with almost all of the functionality we desire. Where it diverges from our requirements, it is likely that it simply hasn't tried to address those points yet. I anticipate a reasonably large diff between upstream and Ubuntu in the first instance.

A small amount of work is required for this to be possible:

Further details

dbus has had the at_console policy patched to check that the user is at the foreground console. This requires libpam-foreground to be part of the default pam session. This is the case as of current dapper.

This way only the 'active' user can do power management stuff but it doesn't address the issue of preventing certain users from messing with power settings. However we believe this is an acceptable situation for the first pass (the best you could do is prevent any power management stuff from occuring when a certain user is logged in).

diagram.png

Future work

RichardHughes: g-p-m already detects UPS's using HAL. At the moment only APC UPS's are supported, but it's pretty trivial to convert a NUT plugin to a HAL addon for other makes. g-p-m treats them like external batteries, doing the usual (hibernate/shutdown etc) when they get critical, with warnings when they get low. What else would you want to configure, other than the time before shutting down?

Outstanding issues

RichardHughes: I was proposing using the root user preferences, i.e. safe defaults.

Proposals outside of the specification's remit


CategorySpec

PowerManagementConfiguration (last edited 2008-08-06 16:31:02 by localhost)