Repository navigation
Conversation
dfd112f to
5a5e252
Compare
mmahut
left a comment
There was a problem hiding this comment.
The change set looks good, but please:
- Rename to test to
brightness-keyboard-test.sh. It is keyboard-brightness-test.sh, but the repo convention is command-name order, as in brightness-display-test.sh. - Issue #10105 is the same bug and should be closed by this too. Add
Fixes #10105.
|
Thank you - I've made those changes. |
|
Related finding, on the same symptom but a separate path this PR doesn't cover: after a long The system-sleep hook that I've opened #13729 to route the hook through |
|
Reviewed and verified on a disposable Omarchy worker VM, and I pushed one commit to this branch (df749b8). Reproduction. I used the real What I pushed. The lock service runs blank and wake as two separate processes, so a Second opinion. Codex Medium reviewed this in three rounds. It found the race above, then two follow-ups in my fix: the lock was held across the OSD call, and the first version of the race test didn't prove contention and could hang. Its last round on df749b8 was clean. It also agreed this change is the proportionate fix for repeated blanks. Scope and related work. This fixes the double- Next. This is waiting on CI, then on the maintainer. Nothing is needed from you. |
[Low impact] The new manual-change behavior appears safe to merge. SummaryManual keyboard brightness changes now share the lock used by blank and restore.
Reviews (3) · Last reviewed commit: "Preserve manual keyboard backlight chang..." · Reviewed by Greptile |
|
I reproduced the same repeated-blank problem on an ASUS Vivobook S 16 M5606UA with Omarchy 4.0.4-1, kernel 7.2.5-3-omarchy, and A local serialized first-blank guard keeps level 2 through There is another ASUS-specific detail: F4 can be consumed by |
|
Fixed the unsafe lock path and added checks for hardware brightness changes in caf7fc1, including changes to zero. The PR description documents the remaining limitation: a hardware cycle back to the same reported value with current brightness zero cannot be detected without a background monitor. The keyboard regression tests and CLI suite pass. |
|
Thanks for this, @catlee, and for the follow-up in caf7fc1. Since the last review, quattro has merged #15908, which fixes the same repeated-blank bug in What was checked: I read caf7fc1 against quattro at d367a56 and against #15908's commit 0c29fa5. Nothing was run on a worker this time. The head cannot merge, so a reproduction at this head would test code that cannot land as it is. The earlier worker reproduction was at df749b8, before the conflict. The second opinion came from Codex Medium and muse-wonder (via pi, high thinking). Both were given the two diffs. They agree with the reading below, but their independence from it is not guaranteed. What #15908 already covers: it keeps the first saved level across repeated What this PR still does that quattro does not:
What a port would need to keep from quattro: both models flagged behaviour in this head that quattro's version handles better.
What happens next: this waits on the maintainer to choose between two options. One is to close this as covered by #15908 and take the manual-change invalidation, plus the external-change check if wanted, as a small change on top of quattro's script. The other is for you to rework this branch onto quattro's design along those lines. Nothing was pushed to your branch. |
caf7fc1 to
390e475
Compare
|
Thanks for pointing this out. I've reworked this on top of Manual I've left hardware changes that bypass the command out of this revision. I think those need a separate change with hardware testing. The new regression fails on unchanged |
|
Thanks for reworking this onto The bug is real and the approach fits it. The keyboard brightness keys are bound with One case it gets wrong. In Competing fixes. #10366 by @marcindyguda, opened 21 minutes after this one, makes the same change: the same lock for every direction, and it drops the saved level after a manual change. It only drops it when the level actually moves, though, so down at 0 keeps the saved level. It also leaves alone a keyboard that something outside this script, like a firmware-handled key, has lit since the blank. The oldest fix normally wins, but that no-op case is a defect this one has and #10366 doesn't, so #10366 is the one being brought forward. #6760 is older still, but it conflicts with What this one still adds. Two things here are better than #10366: a failed set exits before showing the OSD (#10366 shows a level that never applied), and the lock is closed before the OSD runs (#10366 holds it through the OSD call). Both are handed over to be folded into #10366, crediting you as co-author. Nothing was pushed to this branch. This waits on the maintainer to decide between the two. |
A manual change held the lock through omarchy-osd, which can wait on a stalled shell, so held keys, blank and wake queued behind it. A key the device rejected still showed the level it never set. Both come from omacom#10364. Co-Authored-By: Chris AtLee <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keyboard brightness changes made while locked can be undone on wake. If the lock saves level 3 before blanking and I adjust the brightness to 1, restore brings it back to 3.
Manual adjustments now take the same lock as blank and restore, then clear the saved level after a successful change. Failed adjustments keep the saved level and return before showing the brightness overlay.
This builds on #15908 and keeps its state filename and restore handling. Hardware-key changes that bypass this command are outside this change.
Validation: the new regression fails on unchanged quattro. The keyboard behavior tests, ./test/cli, and Bash syntax checks pass, including manual adjustments to zero, failed adjustments, and a manual adjustment overlapping a blank. Physical keyboard behavior has not been tested for this revision.