Skip to content

The battery reading: on a change, not every second - #294

Draft
cDurham wants to merge 1 commit into
OrchardLinux:mainfrom
cDurham:battery-poll-interval
Draft

cDurham wants to merge 1 commit into
OrchardLinux:mainfrom
cDurham:battery-poll-interval

Conversation

@cDurham

@cDurham cDurham commented Dec 4, 2026 •

Copy link
Copy Markdown

The shell ran omarchy-battery-status every second, in three places, each run starting bash + awk. Now it runs when UPower reports the charger going in or out or the percentage moving, plus every 30s as a fallback.

Tested on an iPad mini 2 (J85), idle desktop: from ~1 run/s to 3 runs in a minute. Unplug/replug flips the icon straight away.

Trade-off: the charge rate (watts) outside the open power panel can be up to 30s old.

🤖 Generated with Claude Code

@cDurham
cDurham force-pushed the battery-poll-interval branch from a98a16a to 92fefc8 Compare December 4, 2026 18:27
@cDurham cDurham changed the title The battery reading: every half minute, and at once on a charger change The battery reading: on a change, not every second Dec 4, 2026
The shell ran omarchy-battery-status once a second for as long as it ran,
in each of the three places that show the battery. Each run starts bash and
one or two awk: several process launches every second on a two-core tablet,
only to redraw a percentage that moves once in minutes.

Read it when UPower says the charger went in or out or the percentage
moved, and every 30 seconds besides, so discovery still does not depend on
UPower. The open power panel reads every second as before.

Assisted-by: LLM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Chris Durham <47431093+cDurham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant