Score:4

How to change xrandr brightness without losing gamma settings?

au flag

KDE's Night Color feature I guess uses xrandr's gamma functionality, but I was hoping to adjust the brightness of my display using it. Unfortunately, doing so like this loses the "night color" because it resets the gamma:

xrandr --output DP-0 --brightness .8

Is there some way to query the currently applied values from xrandr so I can reapply them?

us flag
By the way, does night color work in Wayland session? xrandr does not work in Wayland, so it may be a way to figure out whether night color does use wayland.
Slbox avatar
au flag
Sadly, I can't get really get Wayland to work on my machine.
us flag
There was a typo in my comment. *it may be a way to figure out whether night color does use xrandr*
Score:1
gp flag

To change brightness independently of xrandr:

From my tests on my stock Ubuntu 20.04 system, it seems the input and output of the xgamma tool are completely independent to xrandr. So, if you change the brightness using xgamma -gamma 0.8 then that shouldn't affect the xrandr night light settings :)


To query the currently applied gamma values of xrandr:

xrandr --verbose | grep "Gamma"

I had a look at man xrandr for documentation, and it seems the --verbose flag gives out the details for the gamma.

It does say

Please note that the gamma and brightness informations are only approximations of the complete color profile stored in the server.

and my tests seem to show that the value output by this is not the same as what is passed during input.

For example, if I enter xrandr --output eDP-1 --gamma 2:0.5:0.2 and then xrandr --verbose | grep "Gamma", it outputs:

    Gamma:      0.50:2.0:5.0

I closed Redshift before running these tests, so hopefully that didn't interfere.

There might be some way to figure out a transformation to interpret the value, but I am not sure about that.

armando.sano avatar
in flag
The value to enter in the command line option are the inverse of the value written in the ouput: 1/2.0 = 0.5, 1/0.5 = 2.0, 1/0.2=5.0 (not sure why! In any case that doesn't seem to be a good solution for Night Color, see my answer below)
Score:0
au flag

Only a partial answer to my full question, but it turns out the brightness is applied by adjusting the gamma

Note that it doesn’t change hardware level brightness, it is just a software level filter with adjusted gamma values.

So presumably I can find these values somewhere.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.