Last active
March 10, 2018 08:09
-
-
Save xarinatan/9fc93b84e2c7fd371fc8be83d4df488b to your computer and use it in GitHub Desktop.
Bash script to manage Redshift with 5 different zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#This bash file will run in a loop until killed, and edit the color temperature throughout the day based on the times below. | |
while true; do | |
curTime=$(date +"%k") | |
if (( $curTime >= 9 && $curTime < 18 )); then #between 9am and 6pm | |
redshift -x #Reset all settings | |
elif (( $curTime >= 18 && $curTime < 21 )); then | |
redshift -O 4200k #Set color temp of 4200k | |
elif (( $curTime >= 21 && $curTime < 23 )); then | |
redshift -O 2300k #etc | |
elif (( $curTime >= 23 || $curTime >= 0 && $curTime < 6 )); then | |
redshift -O 1000k | |
elif (( $curTime >= 6 && $curTime < 9 )); then | |
redshift -O 2000k | |
fi | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
no transitions though, since oneshot mode doesn't seem to support that.