2

The code for xrandr is quite messy and I can't quite understand, it also severely lacks documentation. What's the best/cleanest interface to be able to control brightness through libxrandr?

edit: to clarify I want to use the api not the cli command

zee
  • 2,933
  • 2
  • 16
  • 28

1 Answers1

1

$ xrandr | grep " connected" | cut -f1 -d " " to get the name of the monitor

then

$ xrandr --output <name-from-previous> --brightness <desired-brightness>

<desired-brightness> must be between 0 and 1

References: http://sandipbgt.com/2015/10/01/control-screen-brightness-from-commandline-in-ubuntu/

burt
  • 21
  • 2
  • sorry I should have been more clear. I dont want to do it through the cli but rather through the xrandr api – zee Jul 01 '20 at 20:35
  • @zee This is all I could find https://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt#n1906 – burt Jul 01 '20 at 20:46
  • thanks but that isn't quite what I'm looking for, the backlight property doesnt exist on all displays and does not have the same effect as adjusting brightness through the xrandr api – zee Jul 01 '20 at 20:54