Interface to change display brightness?

I have this program published as snap (currently devmode), it changes screen brightness when requested over http. https://github.com/om26er/screen-brightness-server

This along with a Chrome/Firefox extension increases screen brightness of my laptop when Netflix.com goes fullscreen and resets it back when it exists fullscreen.

the hardware-observe interface allows to read current brightness value but (obviously) does not allow to write it. Is there such an interface that I could use to change screen brightness in a “strict” snap ?

For my usecase, I need to write to /sys/class/backlight/intel_backlight/brightness but I guess different GPU drivers have different paths to write to.

@jdstrand ping. Do you think if there is something today that we can use or do we need a special interface for that ?

There is nothing in the current policy that would allow that. If someone wanted to submit a PR to snapd, we could review it. This feels like a new interface, but I’m not sure what the name of it should be.

I wonder if a new interface called display-control would make sense here. @pedronis, @niemeyer, thoughts?

1 Like

‘display-control’ should be quick to implement it and I’ve added it to my list of updates for 2.37 in case someone else doesn’t beat me to it.

FYI https://github.com/snapcore/snapd/pull/6428

3 Likes

This is super exciting, thanks very much for creating that pull request :slight_smile: