mirror of
https://github.com/rwxrob/dot
synced 2024-11-14 18:12:56 +00:00
27 lines
499 B
Plaintext
27 lines
499 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
p=3.14
|
||
|
i=0
|
||
|
|
||
|
reset () {
|
||
|
/usr/bin/reset
|
||
|
printf "\033[H\033[2J\033[0m"
|
||
|
exit
|
||
|
}
|
||
|
|
||
|
trap "setterm --cursor on; stty echo; echo ${clear}; exit; trap -- - SIGINT SIGTERM" SIGTERM SIGINT
|
||
|
trap reset EXIT
|
||
|
trap reset SIGINT
|
||
|
|
||
|
stty -echo
|
||
|
setterm --cursor off
|
||
|
|
||
|
while true; do
|
||
|
i=$(bc -l <<< "$i+0.04")
|
||
|
r=$(bc -l <<< "128+127*s($i)")
|
||
|
g=$(bc -l <<< "128+127*s($i+$p*(1/3))")
|
||
|
b=$(bc -l <<< "128+127*s($i+$p*(2/3))")
|
||
|
printf "\033[48;2;${r%%.*};${g%%.*};${b%%.*}m\n"
|
||
|
sleep .01
|
||
|
done
|