Hi, Im creating a snap on ubuntu-core and I want to control the monitor via my snap. Is there a way to control the brightness, sleeping or waking the monitor? I couldn’t find any info about this, maybe I am asking the wrong questions. Maybe there is a way to achieve it with ubuntu-frame I don’t know. Any help would be much appreciated.
It depends what you need to achieve, does idle-timeout
(c.f. https://mir-server.io/docs/ubuntu-frame-configuration-options) meet your sleeping & waiting requirements?
Regarding brightness, it depends a lot on the hardware and isn’t currently address by Frame. You could experiment with poking /sys/class/backlight/*/brightness
on your device, but you would likely have permissions issues doing that from a snap.
idle_timeout would sleep the device but I cant figure out how I would wake it afterwards.
And I will be building the image myself, so I don’t think permissions will be of an issue.
Thanks for the reply I would appreciate if you could direct me into the right path.
idle-timeout
turns the display off pending input.
For an example of brightness:
$ ls /sys/class/backlight/*/brightness
/sys/class/backlight/amdgpu_bl5/brightness
$ cat /sys/class/backlight/amdgpu_bl5/brightness
12
$ sudo sh -c "echo 10 > /sys/class/backlight/amdgpu_bl5/brightness"
$ cat /sys/class/backlight/amdgpu_bl5/brightness
10
But that only works for devices exposed in /sys/class/backlight/
- not all outputs have that.