Redscreen - Night Vision Filter for Linux

Redscreen is a simple script that uses the xcalib monitor calibration tool to put a red color filter on your X server display.

Download the script, put it somewhere in your execution path, and chmod +x it. Run the script without arguments to go into redscreen mode. Give it the 'off' argument to return back to normal.

Running the script with 'dim' will restore the color but leave the brightness low- useful if you need to duck out of full red mode to check something without completely blinding yourself. Running it with 'inv' will invert the palette.

The xcalib program is kind of wierd in that it doesn't allow setting levels to an absolute value. The only way I could find to set the monitor to a consistent value with it is to clear the settings to the default before doing the modification. As such (user beware!) there is a little bit of a flash when running the script. I suggest you blink while changing between red and dim modes.


#!/bin/csh
# redscreen.csh Tue Jun 24 16:59:21 PDT 2014 malakai@jeffrika.com

# Usage
if ($1 == "-h") then
	echo "$0 [-h | dim | inv | off]"
	exit
endif

# Return to normal settings
if ( $1 == "off" ) then
	xcalib -clear
	exit
endif

if ($1 == "inv" ) then
	xcalib -i -a
	exit
endif

# Make the screen darker
if ($1 == "dim" ) then
	xcalib -clear
	xcalib -co 30 -alter
	exit
endif

# Turn the screen red
# xcalib    
xcalib -clear
#xcalib -co 60 -alter
xcalib -green .1 0 1 -alter
xcalib -blue .1 0 1 -alter
xcalib -red 0.5 1 40 -alter

Author: < malakai@jeffrika.com > 2014
Jeffrika Heavy Industries and Mining Concern, LLC