AvengeMedia / AvengeMedia/DankMaterialShell

Allow brightness ipc call to receive multiple devices

Open
#664 2 comments 1 reaction 0 assignees View on GitHub
feature request
Dominant language
QML
Stars
8.1k
Forks
515
Avg merge
1d 8h
Merged PRs (30d)
102

Description

## Feature Description

I'm using NixOS Asahi in my M2 MacBook Pro, that laptop technically has 2 screens, one is the main monitor and the other one is the keyboard function row.

When I run `ipc call brightness list`, I will get the following list:

```
Available devices:
backlight:228600000.dsi.0 (backlight)
backlight:apple-panel-bl (backlight)
leds:input10::misc (leds)
leds:input10::mute (leds)
leds:input10::sleep (leds)
leds:input10::suspend (leds)
leds:kbd_backlight (leds)
```

`backlight:apple-panel-bl` is the main monitor and `backlight:228600000.dsi.0` is the function row.

I want to be able to do one call to `ipc call brightness increment 5` to set the brightness for both backlight panels once, basically, I want to be able to do something like this:

`ipc call brightness increment 5 "backlight:apple-panel-bl,backlight:228600000.dsi.0"`

Where the devices can be a list separeted by `,` or some other character.

I tried just binding the key to run 2 commands

```
ipc call brightness increment 5 backlight:apple-panel-bl
ipc call brightness increment 5 backlight:228600000.dsi.0
```

But this will make the brightness widget that shows in the bottom flicker since it will try to render them both at the same time.

Another alternative route is allow the user to tell if the widget should be shown or not, that way, I could achieve the same doing something like this:

```
ipc call brightness increment 5 backlight:apple-panel-bl ""
ipc call brightness increment 5 backlight:228600000.dsi.0 "silent"
```

Where `silent` is telling dms to set the brightness but without showing the widget.

A third option would be to dms know that a widget is already showing and "stack" them on top of each other, kinda like notifications do. This would be probably more useful for people with 2 or more real monitors.

## Use Case

Allowing to handle brightness of multiple monitors in one ipc call

## Compositor

Is this feature specific to one compositor?

- [x] All compositors
- [ ] niri
- [ ] Hyprland
- [ ] dwl (MangoWC)
- [ ] sway

Contributor guide

Open the contributing guide

Research direction

Start with the IPC brightness entry points used by `ipc call brightness list` and `ipc call brightness increment`, then inspect how the brightness widget reacts to updates. Done means one call can target both listed backlight devices and the widget does not flicker or render duplicate updates.

Written by the indexing model from the issue text.

Assessment

Domain
api, desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.