#!/bin/ksh
#this script automatically reddens your monitor
#with the use of 'sct' - you need it for this to
#work.

#change 'step' to a higher number for a faster
#transition
step=20 #must be larger than 1 and end in 0

#change 'default' to your desired temperature
#you might want to consider putting the same
#number into your .xsession/.xinitrc
#ie: sct 3400
default=3400

#put to crontab -e:
#0 * * * * -n DISPLAY=:0 ksh /path/to/this/file

datum=$(date +%H)


smooth() {
       old=$1; new=$2;
       until (( new == old )); do
               old=$((old-step))
               print $old
               sct $old
       done
}

case $datum in
18) smooth $default 3100;;
19) smooth 3100 2800;;
20) smooth 2800 2200;;
21) smooth 2200 1800;;
22) smooth 1800 1600;;
23) smooth 1600 1200;;
*) sct $default;;
esac