From 9f6901aed383a7babd369381ff1572d64db1f846 Mon Sep 17 00:00:00 2001 From: Alexandros Frantzis Date: Sat, 24 Apr 2010 11:48:46 +0300 Subject: Add support for changing the temperature of a specific CRTC (randr only). --- src/redshift.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/redshift.c') diff --git a/src/redshift.c b/src/redshift.c index 9c3f404..c553abb 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -221,6 +221,7 @@ print_help(const char *program_name) " color temperature)\n" " -r\t\tDisable initial temperature transition\n" " -s SCREEN\tX screen to apply adjustments to\n" + " -c CRTC\tCRTC to apply adjustments to (randr only)\n" " -t DAY:NIGHT\tColor temperature to set at daytime/night\n"), stdout); fputs("\n", stdout); @@ -253,6 +254,7 @@ main(int argc, char *argv[]) float gamma[3] = { DEFAULT_GAMMA, DEFAULT_GAMMA, DEFAULT_GAMMA }; int use_randr = -1; int screen_num = -1; + int crtc_num = -1; int transition = 1; int one_shot = 0; int verbose = 0; @@ -260,7 +262,7 @@ main(int argc, char *argv[]) /* Parse arguments. */ int opt; - while ((opt = getopt(argc, argv, "g:hl:m:ors:t:v")) != -1) { + while ((opt = getopt(argc, argv, "g:hl:m:ors:c:t:v")) != -1) { switch (opt) { case 'g': s = strchr(optarg, ':'); @@ -342,6 +344,9 @@ main(int argc, char *argv[]) case 's': screen_num = atoi(optarg); break; + case 'c': + crtc_num = atoi(optarg); + break; case 't': s = strchr(optarg, ':'); if (s == NULL) { @@ -432,7 +437,7 @@ main(int argc, char *argv[]) #ifdef ENABLE_RANDR if (use_randr < 0 || use_randr == 1) { /* Initialize RANDR state */ - r = randr_init(&state.randr, screen_num); + r = randr_init(&state.randr, screen_num, crtc_num); if (r < 0) { fputs(_("Initialization of RANDR failed.\n"), stderr); if (use_randr < 0) { -- cgit v1.2.3-70-g09d2