From 75e0db828c57fbbcb822d8b2950c59047143a40b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Feb 2018 23:57:33 -0500 Subject: [PATCH] redshift-check: make it redder --- .bin/redshift-check | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.bin/redshift-check b/.bin/redshift-check index 9481c09..b90eadb 100755 --- a/.bin/redshift-check +++ b/.bin/redshift-check @@ -24,6 +24,11 @@ main() { cd / export DISPLAY=:0 + local auth="${HOME}/.Xauthority" + if [[ -e ${auth} ]]; then + export XAUTHORITY=${auth} + fi + while [[ $# -gt 0 ]] ; do case $1 in -x|--reset) rs -x ;; @@ -35,21 +40,22 @@ main() { h=$(date +%H) declare -A temps + local min=2000 temps=( - [20]=5000 - [21]=4500 - [22]=4000 - [23]=3500 - [00]=3000 - [01]=3000 - [02]=3000 - [03]=3000 - [04]=3000 - [05]=3000 - [06]=3500 - [07]=4000 - [08]=4500 - [09]=5000 + [20]=$(( min + 2000 )) + [21]=$(( min + 1500 )) + [22]=$(( min + 1000 )) + [23]=$(( min + 500 )) + [00]=$(( min )) + [01]=$(( min )) + [02]=$(( min )) + [03]=$(( min )) + [04]=$(( min )) + [05]=$(( min )) + [06]=$(( min + 500 )) + [07]=$(( min + 1000 )) + [08]=$(( min + 1500 )) + [09]=$(( min + 2000 )) ) t=${temps[${h}]} -- 2.39.5