]> git.wh0rd.org - home.git/commitdiff
redshift-check: make it redder
authorMike Frysinger <vapier@gentoo.org>
Wed, 14 Feb 2018 04:57:33 +0000 (23:57 -0500)
committerMike Frysinger <vapier@gentoo.org>
Wed, 14 Feb 2018 04:57:33 +0000 (23:57 -0500)
.bin/redshift-check

index 9481c09d8a4fe0fbb059f173df666d9cd85c56c1..b90eadb0c4b23b2896e0ab856b1e7e3aec9ac839 100755 (executable)
@@ -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}]}