]> git.wh0rd.org Git - home.git/blob - .bin/redshift-check
globalize redshift
[home.git] / .bin / redshift-check
1 #!/bin/bash
2 cd
3 export DISPLAY=:0
4
5 case $1 in
6 --reset) exec redshift -x ;;
7 esac
8
9 h=$(date +%H)
10
11 declare -A temps
12 temps=(
13         [20]=5000
14         [21]=4500
15         [22]=4000
16         [23]=3500
17         [00]=3000
18         [01]=3000
19         [02]=3000
20         [03]=3000
21         [04]=3000
22         [05]=3000
23         [06]=3500
24         [07]=4000
25         [08]=4500
26         [09]=5000
27 )
28
29 t=${temps[${h}]}
30 if [[ -z ${t} ]]; then
31         exec redshift -x
32 else
33         exec redshift -O ${t}k
34 fi