Working on bind to change brightness/temp. Any suggestions?

I'm working on setting up a binding to set brightness/color temperature in a way
similar to the program redshift does with randr. http://jonls.dk/redshift/
I'm just wondering if anyone has done anything similar or has any tips for me.
Just a first look, I see redshift calling xcb_randr_set_crtc_gamma from #include

On Tue, Dec 18, 2012 at 2:14 PM, Ian Kelling
I'm working on setting up a binding to set brightness/color temperature in a way similar to the program redshift does with randr. http://jonls.dk/redshift/ I'm just wondering if anyone has done anything similar or has any tips for me.
Out of curiosity, what is wrong with just using Redshift? It has one-shot and specific temperature options. -- gwern http://www.gwern.net

On 12/18/2012 11:23 AM, Gwern Branwen wrote:
On Tue, Dec 18, 2012 at 2:14 PM, Ian Kelling
wrote: I'm working on setting up a binding to set brightness/color temperature in a way similar to the program redshift does with randr. http://jonls.dk/redshift/ I'm just wondering if anyone has done anything similar or has any tips for me. Out of curiosity, what is wrong with just using Redshift? It has one-shot and specific temperature options.
Redshift does not work for a single monitor in a multi-monitor setup. Perhaps it will be easier/better to modify Redshift so it can do that.

On 12/18/2012 12:43 PM, Ian Kelling wrote:
On 12/18/2012 11:23 AM, Gwern Branwen wrote:
On Tue, Dec 18, 2012 at 2:14 PM, Ian Kelling
wrote: I'm working on setting up a binding to set brightness/color temperature in a way similar to the program redshift does with randr. http://jonls.dk/redshift/ I'm just wondering if anyone has done anything similar or has any tips for me. Out of curiosity, what is wrong with just using Redshift? It has one-shot and specific temperature options.
Redshift does not work for a single monitor in a multi-monitor setup. Perhaps it will be easier/better to modify Redshift so it can do that.
Turns out Redshift does support this (slightly hidden in its documentation), via -m. So now just conditioning it on the window part in Haskell which should be easy.

On Tue, Dec 18, 2012 at 2:14 PM, Ian Kelling
I'm working on setting up a binding to set brightness/color temperature in a way similar to the program redshift does with randr. http://jonls.dk/redshift/
Redshift and f.lux both work fine with xmonad.
Just a first look, I see redshift calling xcb_randr_set_crtc_gamma from #include
, and I'm wondering how to do the equivalent in xmonad.
If for some strange reason you must do it with xmonad (this is not a particularly good idea, especially considering that the Xlib API appears to require callbacks), you want the XRandR bindings for Xlib. I don't see any bindings on Hackage, and neither the Haskell X11 package nor xmonad provides them, so expect to learn how to use hsc2hs. "man 3 Xrandr" for the Xlib API, although the manpage I have locally is rather sparse so you may need to look for more information elsewhere. Alternately, you can "spawn" the xrandr shell command; see the -gamma option. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (3)
-
Brandon Allbery
-
Gwern Branwen
-
Ian Kelling