Skip to content

brightness: let users choose which devices the shell controls - #4286

Open
yevhen-sychov wants to merge 1 commit into
duxlabs-dev:masterfrom
yevhen-sychov:brightness-controlled-devices
Open

yevhen-sychov wants to merge 1 commit into
duxlabs-dev:masterfrom
yevhen-sychov:brightness-controlled-devices

Conversation

@yevhen-sychov

@yevhen-sychov yevhen-sychov commented Nov 15, 2026 •

Copy link
Copy Markdown

Description

On my MacBook Pro 16 (T2) there are two backlight devices: gmux_backlight for the screen and appletb_backlight for the Touch Bar. tiny-dfr dims the Touch Bar when idle and brings it back on touch, and every time it does that DMS shows the brightness OSD. So the OSD pops up constantly. DMS also picks the Touch Bar as the default device, so the brightness keys change the Touch Bar instead of the screen. There's no way to tell DMS to ignore a device right now.

This adds a "Brightness" card to the Displays settings page. "Control all devices" is on by default, so nothing changes for existing users. If you turn it off, you get a toggle for each device and DMS only controls the ones you leave on. Unchecked devices don't show the OSD, aren't in the control center slider, can't be picked as the default device and are ignored by IPC.

It's stored as brightnessControlledDevices in session.json, next to the other per-device brightness settings. The filtering happens in one place in BrightnessService, so nothing else had to change. QML only, no changes to core or the socket protocol.

A few things that might come up in review:

  • New devices stay unchecked while "Control all" is off. The description under the toggle says so.
  • If every checked device is unplugged, DMS controls whatever is present instead of nothing, so brightness never stops working.
  • Devices are matched by id. DDC ids are i2c bus numbers that can change, but pins and lastBrightnessDevice already work the same way.

The code was written with Claude. I reviewed it and tested it on my machine.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Screenshots / video

Brightness card on the Displays page

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dux-docs to document any new behaviors: docs(dms): document controlled brightness devices dux-docs#211

Tested on v2.1.2 + this patch: with the Touch Bar unchecked the OSD no longer pops up and the brightness keys control the screen. make test-qml and the pre-commit hooks pass.

@github-actions github-actions Bot added feature ui Quickshell UI under quickshell/ labels Nov 15, 2026
yevhen-sychov pushed a commit to yevhen-sychov/dux-shell that referenced this pull request Nov 15, 2026
Backport of duxlabs-dev#4286 onto v2.1.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bbedward

Copy link
Copy Markdown
Member

/claude review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

One UI issue in the device list's fallback state. The rest looks good.

  • If every checked device is missing, all rows show as checked and clicking one does nothing, quickshell/Modules/Settings/DisplayConfigTab.qml:422
    Docs pending: new brightnessControlledDevices session setting and the Displays → Brightness card (no dux-docs PR linked)
    Checked: BrightnessService filtering across full-state and single-device updates, OSD suppression, current/IPC device and group reselection, pins, IPC handlers, SessionSpec/ConfigProfiles persistence and reload cost, settings card bindings, i18n, regenerated search index, tests. Model: claude-opus-5-5.

@yevhen-sychov

yevhen-sychov commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

hello

If every checked device is missing, all rows show as checked and clicking one does nothing, quickshell/Modules/Settings/DisplayConfigTab.qml:422

merged suggested by claude code

Docs pending: new brightnessControlledDevices session setting and the Displays → Brightness card (no dux-docs PR linked)

created pr, pls check as well

@yevhen-sychov
yevhen-sychov force-pushed the brightness-controlled-devices branch from 064a26b to 196ea89 Compare November 19, 2026 10:07
@bbedward

Copy link
Copy Markdown
Member

Please rebase

@yevhen-sychov
yevhen-sychov force-pushed the brightness-controlled-devices branch from 196ea89 to b0388e6 Compare November 24, 2026 19:06
@yevhen-sychov

Copy link
Copy Markdown
Author

Please rebase

done

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yevhen-sychov
yevhen-sychov force-pushed the brightness-controlled-devices branch from b0388e6 to 1cfb8e4 Compare November 24, 2026 19:09
@bbedward

Copy link
Copy Markdown
Member

/claude review

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

No issues found. The earlier fallback-row finding is fixed, and dux-docs#211 is now linked.
Checked: BrightnessService filtering (full state, single-device updates, OSD suppression, current/IPC device and group reselection, unplugged-device fallback), SessionData/SessionSpec/ConfigProfiles persistence, the settings card toggle logic and bindings, consumers of BrightnessService.devices (control center, OSD, bar, island, IPC), i18n, deprecated shims, the regenerated search index, tests. Model: claude-opus-5-5.

@bbedward

Copy link
Copy Markdown
Member

The pinned brightness devices largely already deal with this, so I wonder if we can solve the issue by just making pins also control which output an OSD displays on? Rather than adding more settings and such

@yevhen-sychov

Copy link
Copy Markdown
Author

The pinned brightness devices largely already deal with this, so I wonder if we can solve the issue by just making pins also control which output an OSD displays on? Rather than adding more settings and such

#4415 yeah it may be, and probably a better placemenen overall.

this can be closed if 4415 is ok

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ui Quickshell UI under quickshell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants