1
votes

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

1
You could have a look at what xbacklight does. - Nate Eldredge
afaik xbacklight and xrandr --brightness do different things - zee

1 Answers

0
votes

$ 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/