Debounce brightness key bursts

This commit is contained in:
jan
2026-04-25 13:44:43 +02:00
parent dc932b8f64
commit 324505bf08
6 changed files with 102 additions and 10 deletions

View File

@@ -11,6 +11,7 @@ This avoids drift from letting two outputs auto-adjust independently.
- Internal display controlled with `brightnessctl`
- External monitor mirrored with `ddcutil` VCP code `10`
- Compact GTK4/libadwaita OSD for custom brightness shortcuts
- Debounced brightness changes: fast repeated key presses become one final jump
- Optional Wayland top-edge positioning with `gtk4-layer-shell`
- systemd user service for continuous external sync
- Configurable backlight device, DDC bus, monitor model, step size, and sync interval
@@ -53,6 +54,7 @@ The installer writes:
```text
~/.local/bin/brightness-osd
~/.local/bin/brightness-step
~/.local/bin/brightness-up-all
~/.local/bin/brightness-down-all
~/.local/bin/brightness-sync-hg342pcb
@@ -89,8 +91,11 @@ BRIGHTNESS_DDCUTIL_BUS="16"
BRIGHTNESS_SYNC_INTERVAL="1"
BRIGHTNESS_SYNC_MIN_PERCENT="1"
BRIGHTNESS_OSD_VISIBLE_MS="1400"
BRIGHTNESS_APPLY_DEBOUNCE_MS="180"
```
`BRIGHTNESS_APPLY_DEBOUNCE_MS` controls how long the scripts wait for another key press before applying the final brightness. The OSD updates immediately to the target value, but `brightnessctl` runs only once at the end of a quick key-press burst.
After changing DDC or sync values:
```bash