Repository navigation
Add the Apple Silicon battery charge limit to omarchy-mac - #525
Merged
Merged
Conversation
maralcbr
changed the base branch from
mac/13-hw-platform
to
quattro-upstream
September 25, 2026 09:43
# Conflicts: # packages/omarchy-mac/ORIGINS.md # packages/omarchy-mac/README.md
malik-na
approved these changes
Sep 25, 2026
malik-na
left a comment
Member
There was a problem hiding this comment.
LGTM. I found no blocking issues in the six-file change against the PR description and repository conventions.
Validated on an M1 MacBook Air: setting 80 produced 75/80 and saved 80; setting 100 restored 100/100 and saved 100. The restore helper applied a saved 80 on live hardware. With the PR checkout dev-linked and its battery files staged, a warm reboot came back at 75/80 with saved 80; the one-time check then restored 100/100. The final PR head's command, helper, udev rule, and battery test blobs match the tested checkout.
Limits: I did not test a cold boot or install the complete omarchy-mac add-on package transaction.
maralcbr
added a commit
that referenced
this pull request
Sep 25, 2026
Brings in the password sync (#532), audio (#535), display (#533), Wi-Fi resume (#529) and battery charge limit (#525) work. omarchy-drive-password takes #532's version. It already carries what #503 added (no tracing, the new password over stdin), and it has no Apple branch. #503's drive-password-apple-test.sh asserted that the disk password never changes the login or root password, which ticket 19 replaced with a journaled LUKS-first sync for the system disk; drive-password-test.sh covers the shared behaviour, so the Apple copy goes.
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.
Ticket 62 of the Apple Silicon convergence plan. Stacked on #514 (
omarchy-hw-platform).What changed
omarchy battery charge limit [80|100]from Add an Apple Silicon battery charge limit command #497 into theomarchy-macadd-on package, with the same driver semantics: it writes only the end threshold (80 restarts charging at 75, 100 restores full charging) and checks the SMC's readback. Full charging stays the default.omarchy-hw-platformreportsapple-silicon.CHARGE_CONTROL_END_THRESHOLD=in/etc/udev/macsmc-battery.conf, and a package udev rule runs a small restore helper whenmacsmc-batteryappears at boot. The helper reapplies only a saved 80 or 100, only on Apple Silicon, and never fails the udev event. Nothing needs enabling.asahi-scripts20260127.1 already ships93-macsmc-battery-charge-control.rulesplus a path unit that save the threshold to that same file and restore it at boot. Sharing it keeps one saved value instead of two stores that could disagree; our rule keeps persistence working ifasahi-scriptsis ever dropped from the image, and it also restores an explicit 100, which the Asahi rule skips.manual/is untouched: Mac-only user docs belong inmac-manual/(Move the Mac user manual into mac-manual/ #520), so a line for the Mac hardware page can follow there. The package version stays 0.1.0; the recipe pin (Add omarchy-mac for aarch64 edge omarchy-pkgs#626) needs a pkgrel bump or version bump when it picks this up.Testing
packages/omarchy-mac/test/battery-test.sh: status, set/clear with saved value, failed write, ignored write, failed save, invalid input, the root branch (no sudo), missing thresholds, and qualcomm / generic-aarch64 / generic / contradictory-detector fixtures, which leave the battery and saved value untouched. The restore helper covers a simulated reboot, values saved by asahi-scripts, last value wins, unsupported values, missing battery and non-Apple fixtures.udevadm verifychecks the rule when available../test/allpasses in an aarch64 Arch container as non-root and as root (systemd 261). Mutants removing the platform gates, the save, the value check and the no-trailing-newline read are each caught.bin/,omarchy batterylists it andomarchy battery charge limit --helpworks../test/cli,architecture-gates-test.sh,apple-settings-test.shandbattery-status-test.shpass.charge_control_start_thresholdandcharge_control_end_threshold(both 100),charge_behaviour[auto] inhibit-charge, nocharge_types;macsmc_poweris built in. Nothing was written. The driver (Asahi and mainline) gives 75/80 and 100/100 on both the CHWA and CHLS firmware paths.Not yet done on hardware (converged image, tickets 25/26/51):
omarchy battery charge limit 80, reboot and a cold boot, confirmCharge limit: 80% (restart charging at 75%), then100and reboot for 100/100. To check our rule alone, mask the Asahi one first withsudo ln -s /dev/null /etc/udev/rules.d/93-macsmc-battery-charge-control.rules.Second review: two rounds; two minor verified findings (conditional style, untested root branch) fixed, final round clean.