Last active
December 8, 2015 17:38
-
-
Save eddyb/bcacfe8cc6c5e3ca169b to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
while : | |
do | |
g=$(echo " | |
t = $(date "+%S%N")/1000000000; | |
if(t < 5 || t > 58) { | |
t *= 10; | |
if(t==0) { | |
sinc = 1; | |
} else { | |
sinc = s(t)/t; | |
}; | |
if(sinc > 0) { | |
sinc *= 50; | |
}; | |
sinc*2+1 | |
} else { 1 } | |
" | bc -l) | |
if [ "$g" != "$prev_g" ] | |
then | |
xrandr --output VGA1 --gamma $g:$g:$g | |
sleep 0.001 | |
else | |
sleep 0.5 | |
fi | |
prev_g=$g | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment