X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fredshift-check;h=b90eadb0c4b23b2896e0ab856b1e7e3aec9ac839;hb=64b0a6dd26e21c1c3eac846738470edbe0350251;hp=9481c09d8a4fe0fbb059f173df666d9cd85c56c1;hpb=d6be6f38bf6c0e2e09fdbbdea8bbba5398117da8;p=home.git 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}]}