I wrote a simple program ramp-io, based on the redshift code, to read and write the xrandr gamma ramps for Linux / X11. This enables me to define my own gamma ramps, and switch ramps quickly from the command line. My preferred ramp is red-inv, dim inverse video with a low colour temperature (more red, less blue), and I set the LCD hardware brightness to maximum to reduce LED PWM flicker. I find this is relatively easy on the eyes for work, compared to the normal glaring white backgrounds.
-
Recent Posts
Recent Comments
Developing CZ, a dia… on Developing CZ, a dialect of C… Earl on ramp-io sswam on getting rid of cancer sswam on getting rid of cancer sswam on Chrome memory abuse, and… Archives
- January 2021
- January 2017
- November 2015
- October 2015
- June 2015
- March 2015
- February 2014
- October 2013
- September 2013
- June 2013
- May 2013
- April 2013
- February 2013
- December 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- December 2011
- July 2011
- June 2011
- May 2011
- March 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
Categories
Meta
Thanks Sam. This helped me make a simple utility to set the colour temperature. It’s not as flexible as yours, but simple enough for my needs. Here’s the basic function:
#include
#include
#include “gamma-randr.h”
/**
* Set colour temperature (1000-25000) and brightness (0.0-1.0) on all screens.
*/
void set_colour_temperature(const int temperature_K, const float brightness)
{
randr_state_t _state;
memset(&_state, 0, sizeof(_state));
randr_state_t *state = &_state;
printf(“Setting temp=%dK, brightness=%1.1f\n”, temperature_K, brightness);
color_setting_t setting;
setting.gamma[0]=1.0;
setting.gamma[1]=1.0;
setting.gamma[2]=1.0;
setting.brightness=brightness;
setting.temperature=temperature_K;
if (randr_init(state) != 0)
die(“failed: randr_init”);
if (randr_start(state) != 0)
die(“failed: randr_start”);
state->crtc_num=-1; // set all screens
randr_set_temperature(state, &setting);
randr_free(state);
}