Skip to content

Preserve keyboard backlight across repeated blanks - #10364

Open
catlee wants to merge 1 commit into
omacom:quattrofrom
catlee:fix/keyboard-backlight-restore
Open

Preserve keyboard backlight across repeated blanks#10364
catlee wants to merge 1 commit into
omacom:quattrofrom
catlee:fix/keyboard-backlight-restore

Conversation

@catlee

@catlee catlee commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

My keyboard backlight turns off when Omarchy blanks the screen, which is expected. It was not turning back on when I woke the screen.

Omarchy used brightnessctl -s to save the current level before turning the backlight off. The blank command can run more than once, so a second call saved 0 over the original level. restore then brought the keyboard back to 0.

This change treats a runtime file as the snapshot for one blank and restore cycle. The first blank saves the current level, including 0. Later blank calls leave that snapshot alone. Restore applies it once and deletes it. Successful manual brightness changes also delete it, so they remain in effect.

If the snapshot cannot be saved, the keyboard is not turned off. A failed manual brightness change also leaves the snapshot intact.

The behavioral test covers:

  • starts on, blanks more than once, restores to the previous level
  • starts off, blanks more than once, remains off
  • manually turns off, then remains off after blank and restore
  • failed state saves and failed manual brightness changes

I also ran Bash syntax checks for the command and test.

Fixes #7650

Related to #6667

@catlee
catlee force-pushed the fix/keyboard-backlight-restore branch from fc949e2 to dfd112f Compare September 5, 2026 21:08
@catlee
catlee force-pushed the fix/keyboard-backlight-restore branch from dfd112f to 5a5e252 Compare September 5, 2026 21:43
@catlee
catlee marked this pull request as ready for review September 5, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard backlight stays off after unlock: brightness-keyboard off saves 0 over the good value

1 participant