3

I'd like to have a redshift-style effect on my laptop screen but where I truly remove all green and blue light, leaving only red. I've experimented with redshift, which doesn't seem to take it all the way, only redder, but neither it seems does xcalib... I had thought I could get this by running this:

xcalib -blue 1 0 1 -a
xcalib -green 1 0 1 -a

But that seems to turn the screen orange rather than red -- perhaps it reduces the contrast in both directions (so makes the bottom end brighter too?). I'm confident that I'm right, and that that isn't a trick of the light, because if i run instead

xcalib -red 1 99 1 -a

...then my black terminal turns definitely the sort of red that I wanted.

Is there any way that I can achieve what I want -- effectively, cut out all blue and green light?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
justme
  • 131
  • 1

1 Answers1

0

You can.

I'm using xrandr & the following script to adjust gamma and brightness on all connected monitors, depending of time of day.

#!/bin/bash

current_hour=$(date +%k)
red_gamma=1.0
green_gamma=1.0
blue_gamma=1.0
brightness=1

if (( current_hour >= 6 && current_hour <= 18 )); then
  # Daytime: normal blue light emissions, slight reduction in brightness
  red_gamma=1.0
  green_gamma=1.0
  blue_gamma=1.0
  brigthness=0.9
else
  # Nighttime: reduce blue light emissions & brightness
  red_gamma=1.0
  green_gamma=0.7
  blue_gamma=0.4
  brightness=0.5
fi

xrandr | grep " connected" | awk '{print $1}' | xargs -i xrandr --output {} --gamma $red_gamma:$green_gamma:$blue_gamma --brightness $brightness

You can also use "xgamma" for the same thing if you don't want to use xrandr.

usage:  xgamma [-options]

where the available options are:
    -display host:dpy       or -d
    -quiet                  or -q
    -screen                 or -s
    -version                or -v
    -gamma f.f              Gamma Value
    -rgamma f.f             Red Gamma Value
    -ggamma f.f             Green Gamma Value
    -bgamma f.f             Blue Gamma Value
JazzCat
  • 274
  • 2
  • 14