Repository navigation
Port arch-ipad-auto-brightness daemon to C99 - #230
Merged
Merged
Conversation
Replaces the 866-line Python 3 desktop/configuration/auto-brightness daemon and CLI with a zero-dependency C99 binary (desktop/configuration/auto-brightness.c, ~57 KB ELF, ~0.5 MiB RSS, linked only with -lm). Preserves the ALS log-lux curve, median + asymmetric exponential smoother, hysteresis/interval policy, smoothstep perceptual gamma ramp, compare-and-set powerd Unix socket IPC, IIO/mock/PTY monitor-sensor sources, SIGHUP config reload, and all CLI commands (on|off|toggle|status|enabled|available|--list|--probe). Assisted-by: LLM
henrikklee
pushed a commit
to grierj/omarchy-a
that referenced
this pull request
Dec 6, 2026
At desktop idle the shell was spawning 8 processes per second because panels/power/Status.qml ran a 1-second omarchy-battery-status timer (which also forked awk) across four live instances (bar, lock screen, control center, and power panel). RotationLock.qml likewise ran four separate 2-second polling timers and four startup busctl probes. - Compute omarchy-battery-status size and rate in pure bash without awk (guarding optional sysfs reads, octal leading zeros, and integer width), keeping the charge_full -> mAh fallback for charge-reporting gauges. - Share one UPower-signal-driven BatteryStatus singleton (30 s fallback, coalesced concurrent refreshes, on-demand refresh when Control Center or Power panel opens). - Share one RotationLockState singleton watching the config directory (and its parent for directory replacement) with one busctl probe and a shared setLocked() helper used by both Control Center and Display settings. [Orchard: cut to the battery and rotation-lock readers, with both of the PR's commits folded into one; the auto-brightness and omarchy-powerd wakeup changes are left out, since those daemons are being ported to C (OrchardLinux#230, OrchardLinux#231), where the same fixes belong.] Assisted-by: LLM
This was referenced Dec 6, 2026
# Conflicts: # CHANGELOG.md # Makefile # desktop/install-tree # release/audit.py # tests/package_tree.py # tests/test_package.py
Contributor
|
Merged, thank you Tom! With this one, all six helpers from your series are C now (#222, #227–#231). That's a big chunk of memory back on every board, and the old Python test suites keep guarding the behaviour. Lovely work. On your branch we merged main in, so auto-brightness builds next to the other C helpers, and we added the changelog line. |
This was referenced Dec 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the 866-line Python 3
desktop/configuration/auto-brightnessdaemon and CLI with a zero-dependency C99 binary (desktop/configuration/auto-brightness.c, ~57 KB ELF, linked only with-lm, POSIX PTY without-lutil).powerdUnix socket IPC, IIO/mock/PTYmonitor-sensorsources,SIGHUPconfig reload, and all CLI commands (on|off|toggle|status|enabled|available|--list|--probe).tests/test_auto_brightness.pyto run all 8 tests (including a real Unix-socket mockpowerd) against the compiled C binary.Tested: 37/37 pass (
test_auto_brightness.py,test_package_staging.py,test_package.py).