Brightness variation ability

Asked by martini

I see option -b for screen brightness.

How can i set different brightness values for "day" and "night", like i do with color temperature?

Question information

Language:
English Edit question
Status:
Answered
For:
Redshift Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
martini (mr-owner-gmail) said :
#1

Will be nice if redshift can execute custom command every time as doing screen adjusting, and can send parameters into it such as current sun position or color temperature. To change wallpapers for example.

Revision history for this message
Olivier Fabre (stqn) said :
#2

Hi Martini.

I've just written a patch to set different brightness for day and night. Currently testing it (seems to work fine) and trying to find a way to submit it (harder!)

Revision history for this message
Olivier Fabre (stqn) said :
#3

Oh well, since Jon is subscribed to this, here's my patch:
http://codepad.org/rbdrWcrb

It adds the support of "-b DAY:NIGHT" to set the brightness. "-b N" (a single value without any ":") is still supported.

Revision history for this message
martini (mr-owner-gmail) said :
#4

Cool! It's a very good news!

Revision history for this message
Jon Lund Steffensen (jonls) said :
#5

Thanks Olivier, your patch looks pretty solid. I'm wondering if calculate_temp_and_brightness() could be replaced by a single method (called twice) to do the interpolation? Line 186 in the patch would then be something like:
int temp = (int)calculate_interpolated_value(elevation, temp_day, temp_night);
float brightness = calulate_interpolated_value(elevation, brightness_day, brightness_night);
IMO that would be cleaner, and less code I think.

Revision history for this message
Olivier Fabre (stqn) said :
#6

Hi Jon, glad to hear you like the patch. Yes, the code will probably look a bit better with a calculate_interpolated_value() function, especially if we extend the patch to support gamma interpolation too ;) (not sure if I need that yet...)

I'm not gonna try this right now (time to sleep!) but if you don't do it yourself I can do it tomorrow.

Revision history for this message
Olivier Fabre (stqn) said :
#7

Here is the new patch:
http://codepad.org/QXOIvLcp

Revision history for this message
Jon Lund Steffensen (jonls) said :
#8

I've committed this to trunk.

Revision history for this message
Olivier Fabre (stqn) said :
#9

Great! Thanks Jon.

Can you help with this problem?

Provide an answer of your own, or ask martini for more information if necessary.

To post a message you must log in.