Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Battery

A laptop’s batteries, and the batteries of mice, keyboards, controllers, headsets and other devices, from UPower over D-Bus. Without any of them, as on a desktop without wireless devices, it shows nothing.

On battery, dropping past a level shows a short notice on the island, like “Battery at 50% · 2 h 20 min left”, once per discharge: at 80, 50, 20 and 10% by default. At or under the warning level, 50% by default, a bubble with the level stays next to the island until you plug in. At the critical level, 10% by default, the bubble turns red and breathes, and the notice turns red and stays ten seconds, even over an open panel. Plugging the charger in or out shows a notice too, with the time left on battery.

The control center has a card with the level and the time until empty or full. Under it, a line for each battery of a laptop with two, and one for each device that reports its battery to UPower, with its name and level, red when low. When a device drops to 15%, the island says so once, like “MX Master 3 battery low · 15%”, and again only after it charges. A device already low when Mochi starts says nothing; one that connects already low does. Clicking the bubble opens the control center.

# Battery: a laptop's batteries, and the mice, keyboards and controllers that
# report theirs, from UPower. Nothing shows without any.
[module.battery]
# Levels, in percent, that show a short notice on the island when the
# battery drops past them while unplugged. Each shows once per discharge.
# notices = [80, 50, 20, 10]
# At or under this, unplugged, a bubble with the level stays next to the
# island.
# warning = 50
# At or under this, the bubble and the notice turn red, and the notice stays
# for ten seconds, even over an open panel.
# critical = 10
# A notice when the charger is plugged in or out.
# plugged = true
# A notice when a mouse, keyboard, controller or another peripheral drops to
# this level, once until it charges. 0 turns it off.
# peripherals = 15
# The ring look waves while the battery charges. Off keeps it flat. The
# theme's waves, under Motion, can keep every wave flat whatever this says.
# wavy = true

notices = [] turns the level notices off, warning = 0 the bubble, and peripherals = 0 the devices’ notices. The levels count the combined charge of every battery, as UPower’s display device reports it.

mochi ipc battery status prints each battery and device with its level.

On the desktop, the card is a widget too, and so is a ring: the level as a ring with the percent inside, and under it “Charging”, “Fully charged”, “Plugged in” or “On battery”, with how long until full or empty when UPower knows. The ring waves while the battery charges, and turns red when it’s low. wavy = false keeps it flat, as does the theme’s waves = false in [motion].

Bluetooth devices

UPower lists Bluetooth devices that report a battery too, so a Bluetooth mouse shows on this card and on the Bluetooth page. The card is the one list of every battery; the Bluetooth page shows the level next to the device you connect or forget. Only this module says when a battery gets low, so a device gets one notice. When UPower finds one device twice, through the kernel and through BlueZ, the card lists it once.