PowerManagementConfiguration

Differences between revisions 25 and 26
Revision 25 as of 2005-11-08 03:40:23
Size: 7661
Editor: 201_220_103_66-WIFI_HOTSPOTS
Comment: fix italics
Revision 26 as of 2005-11-10 05:24:33
Size: 8046
Editor: dhcp-0-20-af-d2-7c-3
Comment: integrate mpt's suggestions, clarify action plan
Deletions are marked like this. Additions are marked like this.
Line 31: Line 31:
Hubert has different ideas, about how Power Preferences should work by default. He should be able to change the option that make sense.  Hubert has different ideas, about how Power Preferences should work by default. He should be able to change the option that make sense.
Line 33: Line 33:
Bob runs the IT department of a company. He hands out a bunch of laptops with Ubuntu preinstalled. Bob is anal so he doesn't want the employees messing around with the power settings.

Bob is having a good day and decides that he wants some users that he trusts able to change the power settings on their laptops.

Joe has an evil sibling with whom he shares a laptop. His sibbling likes to play practical jokes like setting up cron jobs to spontaneously shut down or suspend the system if Joe is logged in. Joe is unaffected by these pranks.
Line 36: Line 41:
In its current state, gnome-power-manager is insufficient for our purposes. The primary problem is that it runs as a gnome session daemon. This causes a number of problems:
 * Kubuntu and Xubuntu get no love
 * power management doesn't work when at the login screen
 * security issues are introduced if any user (logged in or not) can ask the system to immediately suspend (as is the current case with g-p-m).

The plan is to attempt to work with upstream to address these changes. Specifically, we have asked the following:
 * We require a system policy daemon running as root.
 * Users in group power-config will be able to change power config without password.
 * Users not in this group are prevented from modifying the settings.
 * Use dbus to talk to system daemon, which will make certain they are in the right group.
 * We prefer to have each user able to specify their own settings.
 * If each user can set their own settings then there must be a clear way to set defaults (for new users, login screen) possibly only accessible to admin user.
 * If each user can set their own settings then the new settings must be activated when the user logs in and the default settings must be restored on user logout.

If upstream is willing to work with us then gnome-power-manager will be shipped. If we can't get gnome-power-manager into an acceptable state on time then we will fall back on the default action of continuing with our current power management scripts with a configuration interface added on.
Line 41: Line 61:
+-------------------------+
| _Preferences      | -> system power preferences
|(o) No text |
|( ) Remaining time |
|( ) Remaining percentage |
+-------------------------+
+-----------------------------+
| _Power Preferences... | -> system power preferences
|(o) No text     |
|( ) Remaining time     |
|( ) Percentage Charge |
+-----------------------------+
Line 48: Line 68:

(NB: RyanLortie is currently working on this patch for battstat-applet)
Line 52: Line 74:
+-------------------------------------------------------------------------+
|
|
| [ ]                           |
| [ ? ] Are you sure you want to power off?                           |
| [ ]                           |
+-------------------------------------------------------------------------+
| (_Log Out)
(_Restart) (S_witch User) (_Sleep) (_Cancel) ((_Power Off)) |
+-------------------------------------------------------------------------+
+-----------------------------------------------+
|
|
| [ ] |
| [ ? ] Are you sure you want to power off? |
| [ ] |
+-----------------------------------------------+
|
(_Restart) (_Sleep) (_Cancel) ((_Power Off)) |
+-----------------------------------------------+
Line 62: Line 84:
* Power button -> pop up the power off dialog
* all options in dialog are accessible with single (no need to hold alt) keypress.
* possibly remove switch user
* have ability to remove some items for certain users (admin may not want users shutting down, for example)
* default is poweroff, accessible by pressing enter
* this poweroff dialog might replace the global logout dialog
 * Power button -> pop up the power off dialog
 * dialog box must be there -very- fast. don't do fading screen effect if we can't do it quickly (NB: gnome logout dialog does it slow but gnome-screensaver can do it quickly. find out why.)
 * all options in dialog are accessible with single (no need to hold alt) keypress.
 * default is poweroff, accessible by pressing enter
 * button order is important here. this is according to the gnome HIG. the only negotiable items are the restart and sleep buttons.
Line 74: Line 95:
| Sleep |
| |
|
Running on batteries: |
| Put computer to sleep after: +---------||---+ |
| 50min |
|
|
| Options |
| [x] Suspend on lid close: |
| [x] require password when |
| waking from sleep/hibernate |
| |
|
Warnings |
| Issue warning:                 +---------||---+       |
| 15 min remaining |
|
|
+-----------------------------------------------------------+
|   When Running on batteries:        |
| Dim the displayer after: +---------||---+ |
| 50min |
| Turn the display off after: +---------||---+ |
| 50min
|
| Put computer to sleep after: +---------||---+   |
| 50min   |
|
|
| Options   |
| [x] Suspend on lid close:   |
| [x] require password when   |
| waking from sleep/hibernate   |
| [x] notify when battery is done charging |
| |
| Battery Low
Warning |
| Issue warning when time left falls to: +---------||---+ |
| 15 min remaining   |
|
|
+-------------------------------------------------------------+
Line 107: Line 131:

=== Backend ===

 * We require a system daemon running as root.
 * Users in group power-config will be able to change power config without password.
 * Users not in this group are prevented from modifying the settings.
 * Use dbus to talk to system daemon, which will make certain they are in the right group.
 * We prefer to have each user able to specify their own settings.
 * If each user can set their own settings then there must be a clear way to set defaults (for new users, login screen) possibly only accessible to admin user.
 * If each user can set their own settings then the new settings must be activated when the user logs in and the default settings must be restored on user logout.

{{{XXX:smurf: OK, that's the user interface. I can implement that in 1h using glade. :-) But how do we actually implement the back-end? That was discussed in the BoF AFAIR, and it should be reflected here.}}}

== Outstanding issues ==

MatthewPaulThomas:
 * "Remaining percentage" doesn't really make sense when the battery is charging.
 * "Preferences" should have a "...", since the implied action is "change my preferences".
 * There should not be a single alert that has ''six'' buttons along the bottom; that's just scary! DapperDesktopPlan talks about a Log Out / Switch button on the screen, which would be a counterpart to the Shut Down / Restart button on the computer itself.
 * Should there be a slider for turning off the screen separately from hibernation? (XP and OS X have that.)
 * There's no preferences for automatic sleep/shutdown when running on mains power (''e.g.'' I went away on holiday and forgot to turn off the computer).
 * It's not obvious what happens when "Suspend on lid close" is turned off.
 * If a password is required when waking the computer, should it automatically be required when unlocking the screensaver? Or when opening the lid when "Suspend on lid close" is turned off? If not, why not?
 * "Issue warning:" about what? (Yes, I know, but Aunt Tillie doesn't.) And what's the use case for turning off this option?
 * What's the point of "one tab"?
 * we intentionally don't consider, for example, putting the computer to sleep when on AC.
 * the lock-on-sleep option has no effect on the normal behaviour of the screensaver.

Summary

GNOME Power Preferences should by default only propose controversial options (ie: if we suspend when the lid closes). Other options have sane defaults which we should select for the user and not ask them about. For example, the following events are assumed to behave as follows:

  • power button press -> logout dialog

  • suspend press (if exists) -> suspend

  • ac unplugged -> so what? (do nothing -- but go into laptop mode!)

Scope and rationale

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

  • shutting down the computer
  • putting the computer into a low-power-use state
  • going into a low-power-use state after some period of inactivity
  • blanking the screen, instead of using a power-sapping screensaver, when running on battery power
  • preventing data loss when the battery runs out.

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

Michael just installed Ubuntu 6.04, he doesn't care about Power Preferences, he wants it to just work and do the right thing (tm).

Hubert has different ideas, about how Power Preferences should work by default. He should be able to change the option that make sense.

Bob runs the IT department of a company. He hands out a bunch of laptops with Ubuntu preinstalled. Bob is anal so he doesn't want the employees messing around with the power settings.

Bob is having a good day and decides that he wants some users that he trusts able to change the power settings on their laptops.

Joe has an evil sibling with whom he shares a laptop. His sibbling likes to play practical jokes like setting up cron jobs to spontaneously shut down or suspend the system if Joe is logged in. Joe is unaffected by these pranks.

Implementation Plan

In its current state, gnome-power-manager is insufficient for our purposes. The primary problem is that it runs as a gnome session daemon. This causes a number of problems:

  • Kubuntu and Xubuntu get no love
  • power management doesn't work when at the login screen
  • security issues are introduced if any user (logged in or not) can ask the system to immediately suspend (as is the current case with g-p-m).

The plan is to attempt to work with upstream to address these changes. Specifically, we have asked the following:

  • We require a system policy daemon running as root.
  • Users in group power-config will be able to change power config without password.
  • Users not in this group are prevented from modifying the settings.
  • Use dbus to talk to system daemon, which will make certain they are in the right group.
  • We prefer to have each user able to specify their own settings.
  • If each user can set their own settings then there must be a clear way to set defaults (for new users, login screen) possibly only accessible to admin user.
  • If each user can set their own settings then the new settings must be activated when the user logs in and the default settings must be restored on user logout.

If upstream is willing to work with us then gnome-power-manager will be shipped. If we can't get gnome-power-manager into an acceptable state on time then we will fall back on the default action of continuing with our current power management scripts with a configuration interface added on.

Panel Icon

There will be exactly one power status icon on the panel (either applet or notification icon) that will show the current battery charge status to the user. The icon will only show "primary" battery status (we make no attempt to deal with wireless mouse batteries, for example). The icon will not have its own preference dialog, but rather, a pulldown menu. The preferences item in this menu will lead to the global power preferences dialog (same dialog that is accessed via the System -> Preferences menu).

+-----------------------------+
|    _Power Preferences...    | -> system power preferences
|(o) No text                  |
|( ) Remaining time           |
|( ) Percentage Charge        |
+-----------------------------+

(NB: RyanLortie is currently working on this patch for battstat-applet)

Power Off Dialog

+-----------------------------------------------+
|                                               |
| [     ]                                       |
| [  ?  ] Are you sure you want to power off?   |
| [     ]                                       |
+-----------------------------------------------+
| (_Restart) (_Sleep)  (_Cancel) ((_Power Off)) |
+-----------------------------------------------+
  • Power button -> pop up the power off dialog

  • dialog box must be there -very- fast. don't do fading screen effect if we can't do it quickly (NB: gnome logout dialog does it slow but gnome-screensaver can do it quickly. find out why.)
  • all options in dialog are accessible with single (no need to hold alt) keypress.
  • default is poweroff, accessible by pressing enter
  • button order is important here. this is according to the gnome HIG. the only negotiable items are the restart and sleep buttons.

Power Preferences Dialog

If Suspend is supported:

+-----------------Power Preferences-------------------------+
|   When Running on batteries:                                |
|    Dim the displayer after:        +---------||---+         |
|                                              50min          |
|    Turn the display off after:     +---------||---+         |
|                                              50min          |
|    Put computer to sleep after:    +---------||---+         |
|                                              50min          |
|                                                             |
| Options                                                     |
|   [x] Suspend on lid close:                                 |
|   [x] require password when                                 | 
|       waking from sleep/hibernate                           |
|   [x] notify when battery is done charging                  |
|                                                             |
| Battery Low Warning                                         |
|    Issue warning when time left falls to:  +---------||---+ |
|                                         15 min remaining    |
|                                                             |
+-------------------------------------------------------------+ 
  • one tab
  • if suspend is unsupported then:
    • - hide suspend time slider - hide suspend-on-lid-close option
  • time until automatic suspend
  • checkbox for suspend on lid close
    • - defaults to on if suspend is whitelisted for laptop
  • checkbox for "require password when waking from sleep/hibernate"
    • - defaults to off if user is autologin - essentially, invoke the screensaver just before suspending
  • sliders for battery low in TIME (not percentage)
    • - warnings issued for battery low - automatic shutdown for battery critical
      • - automatic shutdown may be disabled by hidden gconf key
  • we intentionally don't consider, for example, putting the computer to sleep when on AC.
  • the lock-on-sleep option has no effect on the normal behaviour of the screensaver.

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