Skip to content

Report combined dual-battery status in the power panel - #7186

Open
unleashed-nick wants to merge 1 commit into
omacom:quattrofrom
unleashed-nick:dual-battery-indicator
Open

unleashed-nick wants to merge 1 commit into
omacom:quattrofrom
unleashed-nick:dual-battery-indicator

Conversation

@unleashed-nick

@unleashed-nick unleashed-nick commented Aug 16, 2026 •

Copy link
Copy Markdown

Fixes #6885.

On dual-battery ThinkPads the bar icon and the power panel disagreed: the icon used UPower's composite DisplayDevice, while omarchy-battery-status (and the panel numbers) took upower -e | grep BAT | head -n 1 — always BAT0. A long charge into the second pack was also treated as holding because timeToFull >= 8 hours.

This keeps one bar icon and makes the numbers match.

  • omarchy-battery-status aggregates every present BAT* pack (combined %, Wh, watts) and emits pack.N.* rows.
  • The panel hero uses the combined pack. A PACKS section lists each battery when there is more than one.
  • Holding only if AC is connected and no pack is taking current. A slow charge no longer counts as a charge limit.
  • Notifications that call omarchy-battery-status get the same combined line.

Verified on a ThinkPad T480 (BAT0 holding at 90%, BAT1 charging): combined 33% / 96Wh / 26.9W, with both packs listed.

Tests

  • test/shell.d/battery-status-test.sh — existing single-pack fixture still passes; added a T480-shaped charging fixture and a both-holding fixture.
  • test/shell.d/power-test.sh — pack parsing, combined energy fraction, and the 20-hour charge not counting as holding.

./test/all: CLI suite green. Shell suite: our files pass. Four other files failed on this machine independently of this change (bar-icon-geometry already fails on clean quattro by 0.59px on the monitor glyph; config/snapper/unowned-system-paths need an omarchy-pkgs checkout).

Screenshots

Before/after of the open power panel:

  • Before (BAT0 only):
screenshot-2026-08-16_15-43-55
  • After (combined + packs):
screenshot-2026-08-16_15-51-45

Filed by Grok 4.6 via Grok Build.

The indicator icon used UPower's composite device while the panel and
omarchy-battery-status read only the first BAT* pack. On dual-battery
ThinkPads that hid the second pack and treated a long charge as holding.

Aggregate every present pack for percentage, watts, and capacity, list
each pack in the panel, and only mark the machine holding when no pack
is taking current.
@YuseiRun

Copy link
Copy Markdown

I believe these PRs are also trying to solve this issue
7138 and 7295

@hilather

Copy link
Copy Markdown

Heads-up from a T460s whose internal pack is present but at 0 V / 0 Wh: aggregating every present BAT* (and UPower DisplayDevice) still counts that cell's energy-full, so the combined % is ~49% with a ~10 hour ETA while the live slice is at 99% / 3 min to full. #7917 skips electrically dead packs instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Battery percent in the top bar shows only BAT0

4 participants