Follow the T1 ambient light sensor for panel and keyboard backlight - #10331
Open
shawnyeager wants to merge 3 commits into
Open
Follow the T1 ambient light sensor for panel and keyboard backlight#10331shawnyeager wants to merge 3 commits into
shawnyeager wants to merge 3 commits into
Conversation
macOS uses the T1 ALS for auto-brightness. The sensor already shows up as IIO once apple_ib_als is bound; Omarchy only had keypress brightnessctl.
The sensor is in the camera cluster. A blanked panel drops lux, so following it while DPMS is off writes a dimmer target and that is what comes back on wake. Hold last-applied so the next on-sample is from a lit panel.
macOS has Automatically adjust brightness. The ALS loop now honors auto-brightness-off under ~/.local/state/omarchy/toggles, default on. Hardware menu and omarchy toggle als brightness flip it.
Contributor
Author
|
Follow-up on this PR:
|
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.
Why
macOS uses the T1 ambient light sensor for auto-brightness (Displays → Automatically adjust brightness, on by default). Once
apple_ib_alsis bound, Linux already exports IIOin_illuminance_inputin lux. Omarchy only had keypressbrightnessctl, so covering the camera cluster did nothing.This is the userspace follow-on to the T1 driver work. It is not lid/DPMS persist, gmux persist, or the opt-in Studio Display stack.
What
On MacBookPro13,2 / 13,3 / 14,2 / 14,3, a user unit follows illuminance while the lid is open and the internal panel is on:
omarchy-hw-display(gmux on 15-inch, intel_backlight on 13-inch). Floor 8%.omarchy toggle als brightness(also Trigger → Hardware → Auto Brightness). Flag~/.local/state/omarchy/toggles/auto-brightness-off— presence means off, matching other Omarchy toggles. Default is on, like macOS.ExecCondition+ConditionPathExistsGlob).First-run and a DMI-gated migration enable the unit. 13,1 / 14,1 are not T1 and are not in the detector.
Without
apple_ib_alsthe IIO node never appears, so this stays dark until that driver is loaded.Companion package change: omacom/omarchy-pkgs#315.
Test plan
test/shell.d/t1-als-brightness-test.sh(detector, hook, unit, migration, curve 170→42%/81, dark 8%/255, bright kbd 0, lid closed no-op, DPMS-off no-op, auto-brightness-off no-op, Hardware menu entry)test/shell.d/config-test.shRelated
Related: #7064
Related: #8025
#8025 is opt-in IIO auto-brightness aimed at Apple Studio Displays (USB ALS
05ac:1114), panel only, with a Display-panel toggle. It does not default-on for T1, does not drivespi::kbd_backlight, and does not skip a closed lid or DPMS-off internal panel.