From 27313efa41e9e2549e652757d050b1b358f48a80 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 10 Aug 2025 12:09:01 -0400 Subject: [PATCH] Everything works except you have to interrupt the tree, or it will just sit there with the tree forever --- shell.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/shell.nix b/shell.nix index 4938f24..36919d2 100644 --- a/shell.nix +++ b/shell.nix @@ -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 ''; }