Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. Summary
Reviews (1) · Last reviewed commit: "Pin upower locale and parse all time uni..." · Reviewed by Greptile |
|
Codex (GPT-6.2 Sol High), Opus 5.5 High and muse-wonder via pi, thinking high checked the parser against UPower’s source. The C locale preserves decimal readings, and higher conversion precision rounds a 15.5-minute fallback to 16 minutes, a case that still rounds down in #10392. The \ fixture exercises the day conversion with a synthetic input, since UPower reports that duration in hours. The preflight blocked worker verification, and GitHub Actions is waiting for maintainer approval. |
|
your commit is in #21013, on omarchy-battery-status before the Surface cycle count and the charger draw. @dhh @omarchybot if 21013 lands, this can close as superseded. |
|
Codex (GPT-6.2 Sol High) and Opus 5.5 High compared both diffs and agreed the locale and duration fix stands on its own. Reviewer independence is unverified. #21013 carries the same patch and regression tests in commit Worker verification is still blocked by preflight, and GitHub Actions still requires maintainer approval. |
What changes
Fixes two UPower output parsing bugs in
bin/omarchy-battery-status:upower -icallssetlocale(LC_ALL, "")and formatsenergy,energy-full,energy-full-design,energy-rate,capacity, andtime to empty/time to fullusing the user's locale decimal separator (e.g.,13,9 W,27,8 Wh,2,0 hoursunderde_DE,fr_FR,es_ES,pt_BR, etc.). Becauseawkparses dot-decimals only, it truncated every number at the comma (13.9W→13W,0.9W→0Wtriggering falsecharge_idle,100%health →98%).libupower-glibformatstime to full/time to emptyinseconds,minutes,hours, ordays. Line 63 only convertedminute*, turningtime to full: 45 secondsinto45h(and1.5 daysinto1h 30m). Additionally, defaultawkprint(OFMT = "%.6g") truncated15.5 / 60and30 / 3600enough to round down by a minute (15m/0m).Changes
bin/omarchy-battery-status:LC_ALL=Conupower -iandupower -e(matchingpactl,nmcli,rfkill,pacman, etc. elsewhere inbin/).second*($4 / 3600),minute*($4 / 60), andday*($4 * 24) inupower_hours, emitting full precision viaprintf "%.17g".test/shell.d/battery-status-test.sh:upowerstub tests (running underenv -u LC_ALL -u LC_NUMERIC) assertingrate\t13.9W,health\t100%,time\t2h, and sub-1 W0.9W(without falsecharge_idle).45 seconds→1m,15.5 minutes→16m,2.5 hours→2h 30m, and1.5 days→36h.Verification
upstream/quattrowithrate 13W/health 98%/time 2h 5mbeforeLC_ALL=C, andtime 45hbefore theupower_hoursunit fix; passed after both fixes.bash test/shell.d/battery-status-test.sh— 14/14 passedbash test/shell.d/battery-test.sh— 23/23 passedbash -n bin/omarchy-battery-status test/shell.d/battery-status-test.sh— passed./test/cli— passedup_device_to_textunit strings in/usr/lib/libupower-glib.soand checked rounding across all0.5..59.5 minutesand1..59 seconds.Screenshots
No visual change: CLI status helper only.