Ayatana Indicators Wiki

Ubuntu has various interfaces dealing with power. These include a panel in System Settings (“Battery” for devices seldom plugged in, “Power” otherwise), a battery menu, alerts for low battery, and the ability to suspend or hibernate.

Use case

Phone

Tablet

PC

See charge level

(./) indicator, settings

(./) indicator, settings

See time when last full

(./) settings

/!\

See charge history

(./) settings

(./) settings dialog (less room in settings)

See time remaining

{X} (too variable)

(./) indicator, settings

Configure screen blanking

{X} (combined with locking)

(./) settings

Configure auto-suspend

{X} (combined with locking)

(./) settings

Configure lid/cover behavior

{X} (no lid)

{X} (no lid/cover)

(./) settings

Confirm charging has begun

/!\

/!\

Confirm discharging has begun

/!\

/!\

Be warned of low battery

(./) notification bubble, alert

(./) notification bubble, alert

Information about chargeable things

How long a device will run on battery, in hours and minutes, is much more interesting than what percentage charge the battery has left. For example, a 100%-charged battery may last wildly different durations depending on how old the battery is, what OS version is running, and what apps are running.

On a PC, Ubuntu can make a reasonable estimate of time remaining while the PC remains awake. Unfortunately, on phones and tablets, this isn’t practical — because battery drain varies so much when the display is on vs. off, when the phone is in vs. out of range, calls are in progress and so on.

Therefore, Ubuntu should treat devices with and without a SIM card differently when presenting battery charge, as follows.

Icon

{attachment:icons.jpg}

Wherever it is represented, a chargeable thing should be represented by an outline icon that most closely matches the component or device: a battery, a mouse, or otherwise a generic box.

If it is a battery that is either missing or of unknown charge level, it should use the generic battery icon.

If the thing is fully charged and not discharging, the icon interior should feature a plug emblem (bug Bug:850011).

If it is discharging, or if it is not known whether it is charging or discharging (bug Bug:1470080), the icon interior should be filled from left to right approximately as much as the remaining charge. If it has less than 30 minutes left on a PC, or less than 20% left on a phone or tablet (bug Bug:1410495), the fill should be red rather than monochrome.

And if it is charging, the icon interior should feature a lightning bolt emblem. Depending on clarity and space available, the icon interior may also be filled from left to right approximately as much as the amount charged.

Percentage

Wherever a component’s percentage charge is shown, it should be rounded to zero decimal places and have no trailing space, for example “99%” or “100%”.

Color

The color for a component’s charge level should follow a gradient from bright green (#00ff00) for 100% to bright red (#ff0000) for 0%. (This color should not be used in the indicator, however, as it would be present so much of the time as to be distracting.)

Time remaining

The time is relevant for a component if “Show Time in Menu Bar” is checked (as it should be by default), and either (a) the component is charging, or (b) the component is discharging and the estimated time is less than 24 hours. (A time greater than 24 hours is probably a mistaken calculation.)

The brief time-remaining string for a component should be:

The expanded time-remaining string for a component should be the same as the brief time-remaining string, except that if the time is estimable:

The accessible time-remaining string for a component should be the same as the expanded time-remaining string, except that the H:MM time should be rendered as “H hours M minutes”, or just as “M minutes” if the time is less than one hour.

Handling multiple batteries

If a device has multiple batteries and uses only one of them at a time, they should be presented as separate items inside the battery], but everywhere else they should be aggregated. Their percentages should be averaged, weighted by the capacity of each (bug Bug:1430542). If any are discharging, the aggregated time remaining should be the maximum of the times for all those that are discharging, plus the sum of the times for all those that are idle. Otherwise, the aggregated time remaining should be the the maximum of the times for all those that are charging.

For example, if your notebook has two internal batteries — one fully charged, and one that will discharge in 22 minutes — and your wireless mouse battery is estimated to discharge in 27 minutes, then the menu title should represent the mouse. Even though the internal battery will lose power first, the mouse is the device that will lose power first.

Settings

The contents of the System Settings panel varies a lot depending on the hardware and software. Phones and tablets are typically used unplugged, and plugged in only temporarily to charge, so separate settings for when plugged in would be more confusing than useful. But notebook and desktop PCs are often used when plugged in, and desktop PCs may not have a battery at all.

{attachment:power-settings.narrow.png}

{attachment:power-settings.wide.png}

“Brightness” should navigate to a mirror of the “Brightness” screen (bug Bug:1289470), “Bluetooth” to the “Bluetooth” screen, and “Wi-Fi” to the “Wi-Fi” screen.

“Wi-Fi” should be followed by a “Hotspot” switch item whenever a hotspot has been set up (bug Bug:1458046).

{attachment:power-settings-menu.png}

The “Show status in the menu bar:” menu should have options “When a battery or chargeable device is present” (bug Bug:1298088), “When something is charging or discharging”, and “Never”. By default, the setting should be “When a battery or chargeable device is present”. (If the menu disappeared whenever the thing was fully charged, this would make it difficult to realize that it was fully charged.)

Indicator and menu

The battery indicator exists to indicate how much time you have left when a rechargeable thing (battery, UPS, mouse, iPod, Bluetooth phone, etc) is discharging, and conversely how much longer it will be before everything fully charges. On the PC, the battery menu exists to give you more detailed information, and to let you access power].

On the PC, everything that is accessible in the battery menu should also be accessed in the settings panel, because the menu may not be present.

{attachment:power-menu.png}

{attachment:phone-battery-indicator.png}

Presence

On a phone or tablet, the indicator should always be present, because these devices almost always rely on battery.

On a PC, if you are logged in, the menu should be present depending on the]. If you are not logged in (at the login screen, lock screen, or standalone installer session), the menu should be present as if the setting was “When battery is present”.

Title

Regardless of form factor, the indicator should tell you at a glance what you need to know most: which component will lose power soonest (and optionally when), or otherwise which component will take longest to charge, optionally how long it will take, and optionally its current charge level. More detailed information can be accessed inside the menu itself. On a phone or tablet, the component in question will almost always be the phone or tablet itself, though it may be an external keyboard.

The menu title should begin with the icon of the thing it is representing.

On the PC, if the] and/or “Show Percentage in Menu Bar” is checked, the icon should be followed by brackets. If the time is relevant, the brackets should contain the] for that component. If “Show Percentage in Menu Bar” is checked (as it should not be by default), the brackets should contain the percentage] for that device. If both conditions are true, the time and percentage should be separated by a space.

Regardless, the accessible name for the whole menu title should be the same as the accessible name for that thing’s component inside the menu itself.

For example, if both “Show Time in Menu Bar” and “Show Percentage in Menu Bar” are checked:

PC

The menu should contain:

  1. One item for each battery, regardless of whether it is present. (If there are more than one, they should be listed alphabetically in order of sysfs path, but not showing that sysfs path.)

  2. One item for each UPS.
  3. One item for each connected wireless mouse or keyboard (bug Bug:1100546).

  4. One item for each other connected component with known charge level, for example a music player or phone.
  5. A separator, if you are logged in and the menu has any previous items.
  6. A “Show Time in Menu Bar” checkmark item, if you are logged in.
  7. A “Show Percentage in Menu Bar” checkmark item, if you are logged in.
  8. A “Power Settings…” item, if you are logged in (so that you can’t wander around System Settings while logged out, or use power settings to hinder others from logging in).

(If you are not logged in, and there are no chargeable components, the menu would contain nothing at all. But that does not matter, because in that case the].)

The menu item for each chargeable component should consist of two elements.

  1. The icon representing that thing.
  2. Text representing the name of the component (“Battery”, “Mouse”, “UPS”, “Alejandra’s iPod”, etc) and the charge status in brackets:

    • X (not present)” if it is a battery that has been removed;

    • X (charged)” if it is fully charged and not discharging;

    • X (expanded])” if it is charging, or discharging with less than 24 hours left;

    • X” if it is discharging with 24 hours or more left.

The accessible label for the menu item should be the same as the visible label, except with the accessible] instead of the expanded time-remaining string.

If you are logged in, selecting the item for a chargeable component should open the “Device Information” window for that component (bug Bug:1255655). If you are not logged in (at the login screen or standalone installer session), the item should be insensitive.

The “Power Settings…” item should open the System Settings “Power” panel.

Unfortunately the Linux kernel does not provide real-world identifiers for multiple batteries in a computer; they have only serial numbers, and labels of the form “BAT0” and “BAT1”. So we cannot show useful distinguishing labels like “Battery (front slot)” in the menu.

Session variations

This is a summary only; the specifications of individual items are authoritative.

In the guest session and live session, the menu should be identical to the normal session.

In the standalone installer session and at the login screen:

Phone and tablet

{attachment:phone-battery-indicator.png}

The “Charge level” item should be insensitive, showing the charge status of the phone’s battery. If a Bluetooth headset is connected and its charge level is known, “Charge level” should instead be “Internal battery”, and it should be followed by a similarly insensitive “Bluetooth headset” item showing the charge status of the headset.

The brightness slider (bug Bug:1289470) should exactly mirror the one in the Brightness settings panel.

“Battery Settings…” should navigate to the].

Warnings

{attachment:battery-low-pc.png}

{attachment:battery-low-phone.png}

When the device’s battery/batteries are discharging and reach — or begin discharging and already have — 1 hour or less remaining (PC) or 20% or less remaining (phone/tablet), a notification bubble should appear with primary text “Battery low” (sentence case) and secondary text of the form “1 hour remaining” (PC) or “20% remaining” (phone/tablet).

{attachment:battery-critical-pc.png}

{attachment:battery-critical-phone.png}

When the device’s battery/batteries are discharging and reach — or begin discharging and already have — 30 minutes or less remaining (PC) or 10% or less remaining (phone/tablet), an alert should appear with “Battery Low” (Title Case) as its title (PC) or primary text (phone/tablet) (bug Bug:1296431).

On the PC, the primary text should be of the form “This computer’s battery is running low (about 29 minutes remaining).” or “This computer’s batteries are running low (about 29 minutes remaining).”. The secondary text should be “Unless you connect the computer to power, it will hibernate soon.” or “Unless you connect the computer to power, it will shut down soon.”, depending on the current setting.

On the phone/tablet, the secondary text should be of the form “10% remaining”.

Either way, the only button should be “OK” (bug Bug:883857).

Hibernating or powering off automatically

The device should follow the action chosen in “When power is critically low:” (if it is present), or power off (if it is not), if both of these things are true:

Test case: Unplug the device. Wait for battery to go below 2%; it should suspend, hibernate, or power off. Wake it up; it should not immediately suspend or power off again.

State changes

When a sleeping phone/tablet is connected to or disconnected from power, its display should turn on for the same duration (5~10 seconds) as if a hardware button had been pressed with no further input (bug Bug:1348538).

In addition, when a phone/tablet is connected to power and you are not in Silent Mode, a brief sound should play to confirm that charging is in progress.

Neither of these should happen for a PC, because it is very often powered off completely at the moment when it is connected to power, and doing it only when it was powered on would seem inconsistent.

Comparisons

Ayatana Indicators Wiki: AyatanaIndicatorPower (last edited 2021-02-09 14:03:03 by localhost)