Skip to content

feat: transparent support for ddcutil on desktop#5201

Closed
jamerrq wants to merge 1 commit intobasecamp:devfrom
jamerrq:feature/desktop-brightness-ddcutil
Closed

feat: transparent support for ddcutil on desktop#5201
jamerrq wants to merge 1 commit intobasecamp:devfrom
jamerrq:feature/desktop-brightness-ddcutil

Conversation

@jamerrq
Copy link
Copy Markdown
Contributor

@jamerrq jamerrq commented Apr 3, 2026

Description

This PR updates the omarchy-brightness-display script to provide transparent, default support for desktop monitors using ddcutil.

Currently, default XF86MonBrightnessDown/XF86MonBrightnessUp keybindings fail on desktops due to the lack of internal backlights exposed through /sys/class/backlight.

By adding a simple has_backlight heuristic, the script now automatically falls back to ddcutil for executing brightness up/down steps.

Details

  • Checks for brightness devices dynamically on script launch.
  • If no laptop backlight is detected, parses the +5% / 5%- step format manually.
  • Caches the value temporarily in /tmp/ddcutil_brightness_omarchy and fires omarchy-swayosd-brightness immediately so that visual OSD feedback is instantaneous.
  • Runs ddcutil setvcp 10 asynchronously in the background.

This brings an out-of-the-box solution for both laptops (native brightnessctl) and desktop monitors (ddcutil), while still allowing users to view the cool SwayOSD notifications.

Copilot AI review requested due to automatic review settings April 3, 2026 17:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@felipe3dfx
Copy link
Copy Markdown
Contributor

Hey @jamerrq — I took a different cut at the same problem in #5282, wanted to flag it here so you and the maintainers see both approaches side by side.

Main differences from yours:

  • Install hook + migration so users don't have to install ddcutil and set up the i2c group / udev rule by hand.
  • Blocking flock (instead of -n) to fix silent drops during rapid bursts.
  • Debounce pattern — one setvcp per gesture — which cuts monitor NVRAM wear and keeps the OSD in sync. KDE PowerDevil does the same thing for the same reasons (D8626).
  • Iteration over all detected i2c buses for multi-monitor setups.

Not trying to replace yours — just want to make sure basecamp sees both takes. Happy to merge ideas in either direction.

@jamerrq
Copy link
Copy Markdown
Contributor Author

jamerrq commented Apr 12, 2026

Hi @felipe3dfx. Thanks for the heads up and for linking your PR.

Your approach is definitely much more robust. I really appreciate the debounce pattern to protect the monitor's NVRAM—that’s an excellent and critical catch that I hadn't considered. Also, dynamic detection of i2c buses and automatically handling the migration/installation hooks makes it a much better fit for Omarchy's "it just works" philosophy.

I'm more than happy to close this PR in favor of #5282 so the maintainers can focus entirely on yours, as it clearly handles all the edge cases properly.

@jamerrq jamerrq closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants