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