#!/bin/bash
which redshift >/dev/null
if [ $? -ne 0 ] ; then sudo apt install redshift -y >/dev/null 2>&1 ; fi
#Brilo de 0.1 a 1.0
BrilloDia=0.8
BrilloNoche=0.8
#Latitud se puede obtener desde https://justgetflux.com/map.html
Latitud=-34.60
Longitud=-58.38
#Temperatura de color
# 5000K (Luz solar), 4200K (Luz florecente), 3400K (Luz alógena),
# 2700K (Tungsteno), 2300K (Regulador de incandescencia), 2000K (Un mínimo aprox)
TemperaturaColorDia=4200K
TemperaturaColorNoche=3400K
echo Reseteando configuracion
ps -fea | grep redshift | grep -v grep | awk '{print $2}' | while read line ; do kill -9 $line ; done
pkill redshift
redshift -x -m randr >/dev/null 2>&1
echo Seteando configuracion
echo "Brillo $BrilloDia $BrilloNoche
Ubicacion $Latitud:$Longitud
Temperatura $TemperaturaColorDia:$TemperaturaColorNoche"
redshift -b $BrilloDia:$BrilloNoche -l $Latitud:$Longitud -t $TemperaturaColorDia:$TemperaturaColorNoche -m randr >/dev/null 2>&1 &
exit
Version vieja
sudo apt install git redshift python3 python3-distutils -y
cd /tmp
git clone https://github.com/xflux-gui/fluxgui.git
cd fluxgui
sudo python3 download-xflux.py
sudo python3 setup.py install