Keyboard backlight stays off after unlock: second `omarchy-brightness-keyboard off` saves 0 as the restore value
System details
MacBook Pro 18,2 (Apple M1 Max, Asahi, aarch64), Omarchy 4.0.3rc4-2 (from the omarchy-aarch64 repo), kernel 7.1.13-3-2-ARCH. The affected code is identical on v4.0.4 and quattro.
What's wrong?
After unlocking, the keyboard backlight often stays off, even though it was on before the lock. It only comes back after a manual Shift+F1/F2.
Cause: omarchy-brightness-keyboard off saves the current brightness before zeroing (brightnessctl -sd "$device" set 0). The lock plugin can run the blank command twice without a restore in between (the blank timer is re-armed on resume in idleBlankTimer.onTriggered, and on onAuthenticatingPasswordChanged; a suspend while already blanked is the easiest way to hit it). The second off then overwrites the saved value with 0, so omarchy-system-wake → omarchy-brightness-keyboard restore restores a dark keyboard.
Reproduce with the stock scripts, no lock needed:
brightnessctl -d kbd_backlight set 200
omarchy-brightness-keyboard off
omarchy-brightness-keyboard off # saved value is now 0
omarchy-brightness-keyboard restore
cat /sys/class/leds/kbd_backlight/brightness # -> 0, expected 200
cat /run/user/$UID/brightnessctl/leds/kbd_backlight shows the saved value flip from 200 to 0 after the second call.
Real-world trace (lock → blank → unlock, logging LED + saved value every 2s):
21:32:24 locked=no kbd=255 saved=200
21:32:30 locked=yes kbd=0 saved=200 # first blank
21:32:36 locked=no kbd=200 saved=200 # restore -> ok this time
When the blank fires a second time before the restore, saved becomes 0 and unlock leaves kbd=0.
Suggested fix: don't save when the LED is already off, e.g. in bin/omarchy-brightness-keyboard:
if [[ $direction == "off" ]]; then
if (( $(brightnessctl -d "$device" get) > 0 )); then
brightnessctl -sd "$device" set 0 >/dev/null
fi
exit 0
(omarchy-brightness-display off has the same shape and is worth a look.)
Side note for the aarch64 build: omarchy-brightness-keyboard-auto (ambient-light service) treats the restored 0 as a manual override and pauses until lux changes by ≥20, so in a dark room the keyboard stays dark indefinitely. Resetting last_set after the session unlocks would make it self-heal even when the saved value is wrong.
Confirming on a ThinkPad X1 Carbon 7th (Intel, s2idle), Omarchy 4.0.4-1, device tpacpi::kbd_backlight.
Same sequence: lock → blank (off saves the level) → suspend/resume → the re-armed blank timer runs off again before any wake, overwriting the saved level with 0; unlock → restore leaves the keyboard dark.
Evidence: /run/user/1000/brightnessctl/leds/tpacpi::kbd_backlight contained 0, written ~13 s after resume.
The fix in #12960 (only save when the current brightness is > 0) matches what I'd expect.
confimed on Dell XPS
would love to see a fix
Diagnosed against quattro at defbf90e by reading the source. Nothing was run for this issue. The diagnosis is from Claude Opus 5.5 alone: the configured second opinion, Codex Medium, did not run because today's review quota is used up.
The bug is still on quattro. omarchy-brightness-keyboard off saves the current level before setting 0, every time it runs (bin/omarchy-brightness-keyboard:29). The lock screen can blank again without any wake first. After resume, idleBlankTimer re-arms itself instead of blanking (shell/plugins/lock/Service.qml:752), and when it fires again blankProcess runs off with the keyboard already at 0 (:714). That off saves 0, and the restore in omarchy-system-wake then brings back 0. Your stock-script reproduction (off, off, restore) shows the same thing without the lock screen.
This is not the same bug as #6667. There, Dell firmware has already dimmed the keyboard before the first off, so a different fix is needed. #14011 reports the same bug as this one.
Three open pull requests fix this by changing the same script in different ways. Each one keeps the saved level when off runs a second time:
- #10364 keeps its own saved level from the first
offuntil a restore or a manual change. - #10366 skips the save when the keyboard is already at 0, and makes
restoreact only after a blank. - #12960 skips the save only when the keyboard is at 0 because of an earlier
off.
Each was verified separately on a worker against this sequence. #10366 and #12960 already say they close this issue. I tried to add the same link to #10364, but omabot refused because #10364 has changed since it was classified. None of the three fixes #6667.
Choosing between them is up to the maintainer, so this issue is waiting on them. Nothing more is needed from you.
Reproduced on an M3 Pro MacBook (Asahi, white:kbd_backlight): after an idle lock and unlock, the backlight stayed off and the brightnessctl saved level was 0. Would be great to see one of the open fixes merged (e.g. #10364).
This is fixed on quattro by #15908 (commit 0c29fa52d6), merged on 2026-10-29. It is not in a release yet, so 4.0.4 and earlier still have the bug.
omarchy-brightness-keyboard off no longer uses brightnessctl -s. It saves the level in $XDG_RUNTIME_DIR only when nothing is saved yet, and restore uses that value and then deletes it. So the level saved by the first off is kept, however many times the lock blanks before a wake (bin/omarchy-brightness-keyboard:30-55).
What was checked, on a disposable Omarchy worker at quattro 175e63b6:
test/shell.d/brightness-keyboard-test.sh, which came with the fix, passed 8 of 8.- Your
off,off,restoresequence, run with a fakebrightnessctlstarting at 200:quattrorestores 200. With only that script reverted to the version before 0c29fa52d6, it restores 0, which is what you reported.
omarchy-brightness-display off does not have the same problem. It only turns the display off with DPMS and saves no level (bin/omarchy-brightness-display:87). omarchy-brightness-keyboard-auto is not in this repository, so the aarch64 note belongs with the aarch64 build.
Claude Opus 5.5 reviewed this. Codex Medium and muse-wonder via pi (thinking high) gave second opinions. Both agreed it is fixed on quattro pending a release, and neither found anything left unfixed from this issue. They read the same summary as the first review, so they are not fully independent.
#10364, #10366 and #12960 are still open and change the same script in different ways. Whether to close them and this issue is up to the maintainer, so this issue is waiting on them. You do not need to do anything. Once the next release is out, the fix arrives with omarchy update.