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

Brandon Allbery allbery.b at gmail.com
Tue Dec 18 21:29:49 CET 2012

On Tue, Dec 18, 2012 at 2:14 PM, Ian Kelling <ianowl at gmail.com> 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/

Redshift and f.lux both work fine with xmonad.

> Just a first look, I see redshift calling xcb_randr_set_crtc_gamma from
> #include <xcb/randr.h>, 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

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20121218/1195d386/attachment.htm>

More information about the xmonad mailing list