From bb9afe7a510b6c3a9920ba64f975e57998c4854b Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 21 Jan 2023 20:00:39 -0800 Subject: [PATCH] Only show pfetch and fortune at start of terminal session --- hosts/home.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hosts/home.nix b/hosts/home.nix index 13aa901..2296151 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -162,14 +162,17 @@ in command rm -f -- "$tempfile" 2>/dev/null } - pfetch - while true; do - f=`fortune` - if [ ''${#f} -lt 128 ]; then - echo "''${f}" - break - fi + if [ -z $TERMINAL_STARTED ] && [ -z $IN_NIX_SHELL ]; then + pfetch + while true; do + f=`fortune` + if [ ''${#f} -lt 128 ]; then + echo "''${f}" + break + fi done + TERMINAL_STARTED=1 + fi ''; }; }