Power page brightness slider controls a keyboard LED when there is no backlight #74

Closed
opened 2026-10-13 20:00:49 +08:00 by Breadway · 2 comments
Owner

How it was found: clicking through the 98be903 build in a headless BOS live VM on 2026-10-13 (no /sys/class/backlight). Power & battery showed a Brightness slider at 0%.

Confidence: high. In the VM, plain brightnessctl (no args) picks the first device it finds, which was Device 'input1::numlock' of class 'leds': Current brightness: 0 (0%). src/src/commands/power.rs brightness_device() / brightness_pct() parse that output without checking the class.

Bug: on desktops, VMs and external-monitor-only setups, the screen brightness slider shows and drives a keyboard LED (numlock/capslock/kbd_backlight) instead of being hidden. "No controllable backlight found" never triggers. The 0% reading also looks like the screen is off.

Fix: use brightnessctl --class=backlight (or -c backlight, and -l -m to list) for get, set and device detection. Return None when no backlight-class device exists so the Brightness row hides. Also check power_settings.rs hypridle dim commands brightnessctl -s set 10%, which have the same device choice.

**How it was found:** clicking through the 98be903 build in a headless BOS live VM on 2026-10-13 (no /sys/class/backlight). Power & battery showed a Brightness slider at 0%. **Confidence:** high. In the VM, plain `brightnessctl` (no args) picks the first device it finds, which was `Device 'input1::numlock' of class 'leds': Current brightness: 0 (0%)`. src/src/commands/power.rs `brightness_device()` / `brightness_pct()` parse that output without checking the class. **Bug:** on desktops, VMs and external-monitor-only setups, the screen brightness slider shows and drives a keyboard LED (numlock/capslock/kbd_backlight) instead of being hidden. "No controllable backlight found" never triggers. The 0% reading also looks like the screen is off. **Fix:** use `brightnessctl --class=backlight` (or `-c backlight`, and `-l -m` to list) for get, set and device detection. Return None when no backlight-class device exists so the Brightness row hides. Also check power_settings.rs hypridle dim commands `brightnessctl -s set 10%`, which have the same device choice.
Author
Owner

PR: #81

PR: https://git.breadway.dev/Breadway/bos-settings/pulls/81
Author
Owner

Verified on merge 283ba6b (PR #81): svelte-check 0/0, npm test, build, fmt, clippy -D warnings, cargo test 182 passed incl. only_backlight_class_is_a_screen and dim migration test. Reviewer confirmed brightnessctl -m format from upstream source. Live VM (no backlight) on the PR head: Brightness row hidden, existing dim timeout still read. Reviewer nit (set_brightness --device without --class) is non-blocking.

Verified on merge 283ba6b (PR #81): svelte-check 0/0, npm test, build, fmt, clippy -D warnings, cargo test 182 passed incl. only_backlight_class_is_a_screen and dim migration test. Reviewer confirmed brightnessctl -m format from upstream source. Live VM (no backlight) on the PR head: Brightness row hidden, existing dim timeout still read. Reviewer nit (set_brightness --device without --class) is non-blocking.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos-settings#74
No description provided.