fix(power): only the backlight class is a screen brightness #81
No reviewers
Labels
No labels
breadbug
bug
displays
enhancement
keybinds
network
phase-1
power
privacy
recovery
search
snapshots
sound
ui
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Breadway/bos-settings!81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/bset-73-backlight-class"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes BSET-73
Closes #74
What
Plain
brightnessctlacts on the first device it finds. On desktops, VMs and external-monitor setups that is a keyboard LED (input1::numlock), so the Power page showed a Brightness slider at 0% that drove the Num Lock light.power.rs: reads and writes usebrightnessctl --class=backlight --machine-readable, parsed byparse_backlight. With no backlight, the Brightness row is hidden (the existingbrightness_pct === nullpath).power_settings.rs: the hypridle dim action isbrightnessctl -c backlight -s set 10%with-c backlight -ron resume. The old skel lines (brightnessctl -s set 10%andbrightnessctl -r) are migrated on read and save, like the existing dpms migration.Tests
only_backlight_class_is_a_screen(LED lines ignored, first backlight wins) anddim_targets_the_backlight_and_migrates_old_lines(timeout read from the old line, rewrite, idempotent).Capability changes
None on machines with a backlight. On machines without one, the Brightness row no longer appears.
Follow-up outside this repo: BOS skel
hypridle.confstill ships the unscoped line. It gets migrated the first time Power settings are saved.Closes #74 (BSET-73)
Review of BSET-73, reviewed head
e1aa6dd27d(based432319): PASS.Criteria
brightnessctl --class=backlight --machine-readable; parse_backlight requires class == "backlight". Test only_backlight_class_is_a_screen covers LED-only (None), LED then backlight (backlight wins), empty, and the real laptop line amdgpu_bl1,backlight,325805,81%,400000.--device <name>without-c backlight, so a leds device with an identical name could in theory match. Not realistic; optional follow-up to add--class=backlight.brightnessctl -c backlight -s set 10%/-c backlight -r. Legacy lines are migrated in migrate_dpms, which timeout_of and render_idle both call. Neither legacy string is a substring of the new one, so the migration is idempotent. Test dim_targets_the_backlight_and_migrates_old_lines covers timeout read from the old line (300), rewrite to 120, no old on-timeout left, idempotent re-render, and fresh render resume line.-c <class>and no op it prints info for every device in that class.Checks on the exact head (clean detached worktree)
e1aa6dd: successMerged with a merge commit as
283ba6b20e(heade1aa6ddon base9b07bcf). Main moved twice during review (#79, #82, neither touching power code). Before merging I re-verified the PR head merged onto the new main in a scratch worktree: frontend check, test and build pass, cargo fmt, clippy and test pass (182 tests). BSET-73 now awaits verification on a machine with a backlight and in a no-backlight VM using the integrated build. Not marked done.