Fall back to DDC/CI for brightness on external monitors#4841
Fall back to DDC/CI for brightness on external monitors#4841justinontheporch wants to merge 3 commits intobasecamp:devfrom
Conversation
Omarchy 3.4.1
On desktops with external monitors, there are no /sys/class/backlight devices, so the brightness keys do nothing. This adds a ddcutil fallback that controls the monitor brightness via DDC/CI (VCP feature 0x10) when no backlight device is found. Performance optimizations for responsiveness on key repeat: - Low sleep multiplier to minimize I2C bus wait times - Cache file to skip DDC reads on rapid keypresses - Background writes so the OSD appears immediately - flock to prevent pile-up of concurrent instances The existing laptop backlight path is untouched — DDC/CI is only used as a fallback when ddcutil is installed and no backlight exists. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a DDC/CI-based brightness control fallback for systems without /sys/class/backlight (typical desktop + external monitor setups), so brightness keys can still function when brightnessctl can’t target a backlight device.
Changes:
- Add a
ddcutilfallback path inomarchy-brightness-displayto read/write VCP0x10brightness when no backlight device is found. - Introduce caching/locking/background writes to reduce perceived latency for rapid key presses.
- Add an additional Hyprland browser keybinding (
SUPER+SHIFT+RETURN).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| config/hypr/bindings.conf | Adds a new Browser binding (not directly related to brightness/DDC fallback). |
| bin/omarchy-brightness-display | Implements DDC/CI brightness fallback with caching, locking, and async writes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Application bindings | ||
| bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" | ||
| bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" tmux new | ||
| bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser |
There was a problem hiding this comment.
This PR is scoped to brightness/DDC fallback, but this change adds a new Browser keybinding (SUPER+SHIFT+RETURN). If this is intentional, please update the PR description; otherwise consider moving this to a separate PR to keep the change focused.
|
Wow, I did not try to have Claude open this PR. Sorry about that. |
Summary
On desktops with external monitors, there are no
/sys/class/backlightdevices, so the brightness keys (XF86MonBrightnessUp/Down) do nothing. This adds addcutilfallback that controls the monitor brightness via DDC/CI when no backlight device is found.ddcutilis installed, uses DDC/CI (VCP feature0x10) to read/write brightnessPerformance optimizations (DDC/CI over I2C is inherently slow):
flock -nto drop concurrent invocations instead of queuing them upPrerequisites for users
DDC/CI requires
ddcutil, thei2c-devkernel module, and i2c device access:Test plan
brightnessctl(no behavior change)/sys/class/backlight): brightness keys control the monitor via DDC/CI with OSD feedbackddcutilinstalled: falls through tobrightnessctlpath (existing behavior)🤖 Generated with Claude Code