omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Power panel "Time to full" counts to 100% when the battery's charge limit stops charging earlier

Open yodabot829-dev opened this issue 1 month ago • 2 comments

System details

Dell XPS 13 7390 2-in-1 (i7-1065G7), Omarchy 4.0.4-1, kernel 7.2.5-3-omarchy. Charge limit set in the Dell BIOS: start 50%, end 90%.

What's wrong?

omarchy-battery-status passes UPower's time to full straight to the panel. UPower times the charge to 100%, so the panel overstates the wait whenever a charge limit stops charging earlier.

At 20% and charging at a steady 2.52 A:

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "percentage|time to full"
    time to full:        1.5 hours
    percentage:          20%
$ cat /sys/class/power_supply/BAT0/charge_control_end_threshold
90
$ omarchy-battery-status --shell | grep time
time	1h 30m

From sysfs (charge_now 948000 µAh, charge_full 4633000 µAh, current_now 2517000 µA), the time to 100% is 88 minutes, matching UPower. The time to the 90% stop is 77 minutes. The panel shows 1h 30m. The gap grows as the limit drops: with an 80% limit, the panel would show 1h 30m for a 66-minute charge.

Steps to reproduce

  1. Set a charge end threshold below 100% (BIOS, charge_control_end_threshold, or a tool such as TLP or asusctl).
  2. Charge from low.
  3. Compare the panel's "Time to full" with the time the battery takes to reach the threshold.

Expected

While charging toward a limit below 100%, "Time to full" estimates the time to that limit. One way to do it: scale UPower's figure by (end - percentage) / (100 - percentage), reading end from sysfs charge_control_end_threshold (UPower's own threshold can be the udev hwdb default, see #7374).

Related

  • #7374: the panel shows UPower's hwdb limit (75–80%) rather than the real one. Same here: the panel shows 75–80% while sysfs has 50–90%.
  • #16516 adds a "Charge to" choice. Once a limit is on, this estimate is wrong by default.

yodabot829-dev avatar Oct 25 '26 21:10 yodabot829-dev

Fixed on 4.5.0-3, with numbers — worth closing unless a current build still shows it.

MacBookPro11,5, Omarchy 4.5.0-3, linux-omarchy 7.2.15-2, a real limit in sysfs (charge_control_end_threshold = 80 via the SMC BCLM patches), charging at 53.72 %, 36.97 W, energy_full 95.03 Wh.

source figure what it times
UPower time to full 1.2 hours 71 min — to 100 %
omarchy-battery-status 40m to full 41 min — to the 80 % limit

Both match the arithmetic exactly ((80−53.72)/100×95.03/36.97 = 41 min; (100−53.72)/100×95.03/36.97 = 71 min), so the CLI is now scaling UPower's estimate to the limit rather than passing it through. bin/omarchy-battery-status:99-110 does that itself — charge_limit=${threshold_end:-100}, with UPower's figure only as fallback when the energy and rate readings are missing — and the panel consumes that value rather than UPower directly (shell/plugins/panels/power/Model.js:93 documents the --shell field it parses).

So both halves of the report look addressed between 4.0.4 (reported) and 4.5.0-3: the CLI's estimate and the panel's source. The workaround from https://github.com/omacom/omarchy/issues/7374 does not apply here either — the panel showed the real 80 %, not a hwdb default.

If someone can confirm on a current build with a different limit (yours is 90 %, mine 80 %), this one can close.

rand0mdud3 avatar Nov 13 '26 17:11 rand0mdud3

Codex (GPT-6, high effort) read the report, the newer-release follow-up and the current quattro battery script (e6aec9716). The script now calculates charging time to its selected charge limit when energy and rate readings are available; it still reads UPower's threshold before sysfs. Open PR #16685 changes that selection and already references this issue. This was a source review; no physical battery or running panel was tested.

I classified the report as a bug, but the configured second classifier, deepseek-v4p1-flash, returned no usable classification. Classification remains unsettled, so no class or verification labels were added. This review stops here pending classification; it does not establish that the issue is fixed on current releases.

omarchybot avatar Nov 18 '26 16:11 omarchybot