Fixed Looping

This commit is contained in:
Michael 2025-08-11 00:42:35 -04:00
parent 27313efa41
commit c0f44582a5

View file

@ -11,7 +11,7 @@ pkgs.mkShell {
];
shellHook = ''
STIME=5
STIME=60
programs="cmatrix cbonsai nyancat fortuneCow"
trap 'stty sane; tput cnorm; clear' EXIT
@ -22,8 +22,10 @@ pkgs.mkShell {
tput sgr0
case "$choice" in
cbonsai)
cbonsai -t .2
sleep "$STIME"
cbonsai -l -t 1 & pid=$!
( sleep "$STIME" && kill $pid ) & watcher=$!
wait $pid 2>/dev/null
kill $watcher 2>/dev/null || true
;;
cmatrix)
bash -c "cmatrix -u 4 & pid=\$!; sleep $STIME; kill -INT \$pid; wait \$pid"