Repository navigation
Integrate overlapping battery warnings, charger status, and power panel updates - #21013
chessing234 wants to merge 19 commits into
Conversation
A pack whose gauge reads high, such as an uncalibrated replacement, can cut out above 10%, so the only warning never came. The shell now warns once at 20%, UPower's own PercentageLow, and once more at 10%. Each level is latched through AC flaps as before, and climbing back above one re-arms it. Fixes omacom#20084
A battery-low hook still running from the 20% warning made the 10% one return early, and its level was already latched, so it was lost for the rest of the discharge. Hold it and send it when the running warning exits.
The Surface Pro 11's battery manager reports cycle_count 0: its ADSP firmware keeps no count. The Surface EC does, and microsoft-surface-pro-11-support writes it to /run/surface-pro-11-battery/cycle-count. omarchy-battery-status takes that file when the battery's own count is 0 or missing; a real count still wins and a file that isn't a number is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Send a transient toast when line power arrives after the machine has been on battery. A flip shorter than two seconds is ignored, so a USB-C renegotiation or a UPower reading that settles at startup does not announce a charger that was not just plugged in.
A USB-C blip during the confirm wait was clearing the on-battery clock, so plugging back in within two seconds never qualified. A confirmation already earned stays pending across that blip and is dropped only if the machine stays on battery through the window.
A rejected hardware write leaves the one-time top-up marker in place. Refresh the state when the process exits without rechecking the same charge reading. A new battery event can still restore the limit. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Wait for Quickshell to handle the failed write before watching for a retry, and wait for the successful write to clear the marker. Bound both waits so slow startup or D-Bus calls do not fail a working implementation. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…he bars' motion within the motion rules
Keep immediate reads for panel opens, power source changes and charge-limit updates. Poll the remaining battery telemetry every 30 seconds while the panel is open. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The 20% and 10% warnings and the charger announcement were joined into one battery model. The old boolean latch was unused, and the usage checks reused the device helper's name.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; all previous findings are fixed, and no new actionable issues were found. SummaryThis PR combines battery warnings, charger notices, battery readings, and power-panel updates.
|
|
Thanks for bringing these fixes together. For now, I’ll keep #20879 and #21006 open and keep both patches up to date with |
|
Thanks @chessing234 for pulling these together and keeping the original commits. On Greptile's first finding ("Queued battery warning never sends"): it doesn't happen on Quickshell 0.3.2, where One behavior change from #20264 to flag: when a charger dismisses the warning, Two ways to settle it:
I'd lean toward the first, but either is fine with me. If #21013 lands I'll close #20264 as superseded. |
|
ready for a look @dhh @ryanrhughes |
|
Thanks for the time you put into this. Some of the fixes you added on top catch real bugs in the original PRs. I'm closing it anyway, along with the other Integrate PRs. Each bundle puts several people's work in one branch. We can't review it one change at a time or revert a single piece. Merging it would also leave every original PR open. That's why our PR template asks for one problem per PR. None of the bundles ran on an Omarchy install either. Please post each fix on the PR it belongs to, so its author can pick it up. If two PRs conflict, a comment on the later one helps us most. A small fix of your own, tested on a real install, is always welcome. Smaller and proven gets merged. Thanks! |
Why one branch
These pull requests all change how the shell reads one battery: the warning service,
omarchy-battery-status, and the power panel. Separately they conflict inService.qml,BatteryModel.js, andbattery-test.sh. The 20% warning and the dismiss-on-recovery work do not fit together if each keeps its own latch, and the charger announcement was inserted in the middle of the usage-history helpers.Incorporated pull requests
Original commits are cherry-picked. They are not squashed into one author.
omarchy-battery-status.Fixes on top
lowBatteryWarnedAt, covers 20% and 10%. It is not persisted, so a restart while the battery is still low warns again. The unusednotifiedLowBatteryflag from the single-threshold version is gone. Dismissing because charging clears that latch. Dismissing because the level climbed does not, so a discharge that is still low does not warn again.at, in one script, so the file did not parse. The hour helper ishourAt.Conflicts
Service.qmlhad both the threshold list and the dismiss/rearm path. Both stayed.BatteryModel.jshad the usage-history functions andshouldAnnounceChargerConnectedwritten into the same brace. Both functions stayed, and both are exported.battery-test.shkept the warning, dismiss, usage, charger, and charge-limit sections.Tests
test/shell.d/battery-test.shpassed, including both thresholds, dismiss and rearm, usage history, and the charger toast steps. The charge-limit Quickshell fixture skipped here (nodbus-run-session).test/shell.d/power-test.shpassed, including the charger share.battery-status-test.shdid not get throughomarchy-i18non this Mac because/bin/bashis 3.2 and that script usesmapfile. No Omarchy shell was running, so the power panel was not screenshotted.Closure of the original pull requests is left to the maintainers.
Made with Cursor