Skip to content

Instantly share code, notes, and snippets.

@laserbat
Created January 18, 2019 19:42
Show Gist options
  • Save laserbat/65e0c4b88a5b8471a20897d4839babb0 to your computer and use it in GitHub Desktop.
Save laserbat/65e0c4b88a5b8471a20897d4839babb0 to your computer and use it in GitHub Desktop.
#!/bin/bash
x=1 y=1 z=1 o=$(xrandr|grep primary|cut -d' ' -f1)
f(){ bc<<<"scale=5;x=$1;y=($RANDOM/32767-0.5)/10;if(x+y>0.5&&x+y<1.5)x+=y;print x;";}
trap "xrandr --output \"$o\" --gamma '1:1:1'" EXIT
while true; do
x=$(f $x) y=$(f $y) z=$(f $z)
xrandr --output "$o" --gamma "$x:$y:$z"
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment