Repository navigation
Conversation
A write while the screen is locked, the lid is closed, or the process was frozen by suspend is not a brightness-key press. Forgetting the manual pause in those cases lets a dark room light the keys again. A real key change between normal polls still holds until the room light moves.
This branch has not been deployed
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.
Summary
omarchy-brightness-keyboard-autotreats every unexpected keyboard-LED write as a manual brightness-key press, then holds that level until ambient light moves by at least 20 lux. Suspend (and the lock that wraps it) brings the Apple keyboard controller back at 0. In a dark room the sensor stays at 0 lux, so the pause never clears and the keys stay off.This forgets the saved level in two cases that are not a key press:
A brightness-key change between normal 5 second polls still pauses until the room light moves.
Seen on an M2 MacBook: the user service had been running since boot, the machine had suspended, the ambient sensor read 0 lux, and
kbd_backlightstayed at 0 until the service was restarted.Test plan
bash test/shell.d/brightness-keyboard-auto-resume-test.shbash test/shell.d/brightness-keyboard-auto-test.shShift+Brightnessin steady light still holds until the room light changes