Skip to content

Instantly share code, notes, and snippets.

@eddyb
Last active December 8, 2015 17:38
Show Gist options
  • Save eddyb/bcacfe8cc6c5e3ca169b to your computer and use it in GitHub Desktop.
Save eddyb/bcacfe8cc6c5e3ca169b to your computer and use it in GitHub Desktop.
#!/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