Repository navigation
Add a keyboard backlight timeout - #30
Open
flamingspaz wants to merge 2 commits into
Open
flamingspaz wants to merge 2 commits into
flamingspaz wants to merge 2 commits into
Conversation
flamingspaz
force-pushed
the
feat/kbd-backlight-timeout
branch
from
November 6, 2026 23:41
9b418d2 to
62afe30
Compare
The EC has no backlight timeout, so frameworkd fakes one. While a timeout is set it opens every keyboard and pointing device, using only when input happened, never what it was. Once idle for the timeout it remembers the current brightness and fades the backlight out over a second; the next input fades it back in over a tenth of a second. Input during the fade-out reverses it straight away. To stay cheap while the keyboard is in use, it doesn't read input as it arrives. Events queue in the kernel, and the daemon only drains them when the timeout would run out, using their timestamps to work out how long it's really been idle. Devices are only registered with the reactor while the backlight is off, so typing causes no wakeups, and nothing is written to disk per idle cycle. Brightness stays with the desktop and Fn+Space: the timeout reads whatever they last set, does nothing if the backlight is already off, and keeps a brighter level set while idle. It goes through the kernel's LED device rather than framework_lib, whose percent/duty rounding would make each restore slightly dimmer. On shutdown the task is stopped before the brightness is put back, so a fade in progress can't undo it. The Input page gets a "Turn off after" checkbox and seconds box, shown when the daemon finds a keyboard backlight. That also fixes the Overview page always reporting no keyboard backlight outside fixture mode. Closes #24 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerate the catalogs and add German, Spanish, French and Dutch translations (machine translated, like the rest). This is the first plural string, so each catalog also gets its Plural-Forms header, without which msgfmt rejects it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
flamingspaz
force-pushed
the
feat/kbd-backlight-timeout
branch
from
November 6, 2026 23:44
62afe30 to
19ef83d
Compare
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.
Closes #24.
What it does
The Input page gets a Keyboard backlight: Turn off after [N seconds] setting (5–3600 s, default 30). It's only shown when the daemon finds a keyboard backlight, with a note that brightness is still set from the desktop or with Fn+Space.
The EC has no backlight timeout, so
frameworkdfakes one:/dev/input. It skips power buttons, lid switches and sensors, and uses only when input happened, never which key.Brightness goes through the kernel's LED device (
/sys/class/leds/*::kbd_backlight), which the desktop uses too, rather thanframework_lib.framework_librounds percent to duty and back down (50% reads back as 49%), so restoring through it would leave the backlight slightly dimmer each time.Power use
The daemon is always running, so this is built to cost close to nothing:
Other changes
SetKeyboardBacklightTimeout(i seconds), under the existinginputpolkit action.GetInputalso returnskbdBacklightSupportedandkbdBacklightTimeout.evdev0.13 andlibc(for non-blocking opens;libcwas already in the lockfile). Also enables tokio'ssync,timeandnetfeatures.supportsKeyboardBacklightnow comes from the daemon.docs/architecture.mdand updated README notes.Plural-Formsheader thatmsgfmtrequires.daemon/Cargo.tomlwill have a one-line conflict with #29, since both add tokio'stimefeature.Testing
./build.sh -DBUILD_TESTING=ON -DBUILD_GUI=ONin the project's Docker image. No warnings.cargo clippyandcargo fmt --checkare clean.ctest: 3/3 pass. These don't cover the timeout itself.msgfmt --checkpasses for all four catalogs.🤖 Generated with Claude Code