Everything works except you have to interrupt the tree, or it will just sit there with the tree forever

This commit is contained in:
Michael 2025-08-10 12:09:01 -04:00
parent 2ac21fb369
commit 27313efa41

View file

@ -12,34 +12,31 @@ pkgs.mkShell {
shellHook = ''
STIME=5
programs=("cbonsai" "cmatrix" "nyancat" "fortuneCow")
programs="cmatrix cbonsai nyancat fortuneCow"
trap 'stty sane; tput cnorm; clear' EXIT
while true; do
choice=$(shuf -n 1 -e "cbonsai" "cmatrix" "nyancat" "fortuneCow")
choice=$(echo "$programs" | tr ' ' '\n' | shuf -n 1)
clear
tput sgr0
case "$choice" in
cbonsai)
timeout "$STIME" cbonsai -t .2 -l
reset
clear
cbonsai -t .2
sleep "$STIME"
;;
cmatrix)
timeout "$STIME" cmatrix
reset
clear
bash -c "cmatrix -u 4 & pid=\$!; sleep $STIME; kill -INT \$pid; wait \$pid"
;;
nyancat)
timeout "$STIME" nyancat
reset
clear
;;
fortuneCow)
fortune | cowsay
sleep "$STIME"
clear
;;
esac
sleep 1
done
'';
}