From f4477e87e1a0c83e60c13ad3017781f5006057eb Mon Sep 17 00:00:00 2001 From: G2-Games Date: Sun, 18 Sep 2022 19:40:42 -0500 Subject: [PATCH] Added new check for apt instead of apt-get --- install.sh | 1 + welcome.sh | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 296ab4e..49bef9a 100755 --- a/install.sh +++ b/install.sh @@ -79,6 +79,7 @@ then line=${line%:*} sed -i "${line}d" $zshrc fi + # End older version check # tput rc el ed echo -e "\e[36mUninstalled! \e[0m" diff --git a/welcome.sh b/welcome.sh index 7e07f71..e49d66d 100755 --- a/welcome.sh +++ b/welcome.sh @@ -3,12 +3,21 @@ version=0.2.5 #========Welcome=======# welcome () { msg="Welcome" # Default + + if command -v whoami &>/dev/null ; then + usr=$(whoami) + elif command -v id &>/dev/null; then + usr=$(id -u -n) + else + usr=$USER + fi + if [ "$randgreeting" = "on" ]; then msg=${greetings[$(($RANDOM % $(echo ${#greetings[@]})))]} fi # Print the welcome message - echo -en "$msg, ${USRC}${BOLD}$USER${NCOL}. " + echo -en "$msg, ${USRC}${BOLD}$usr${NCOL}. " } #=========Time=========# @@ -45,7 +54,7 @@ greeting () { echo -en "$greet ${MORN}morning${NCOL}. " elif [ $hour -eq 12 ]; then echo -en "It's ${AFTN}noon${NCOL}. " - elif [ $hour -le 16 ] && [ $hour -gt 12 ]; then + elif [ $hour -le 17 ] && [ $hour -gt 12 ]; then echo -en "$greet ${AFTN}afternoon${NCOL}. " elif [ $hour -le 19 ] && [ $hour -gt 17 ]; then echo -en "$greet ${EVEN}evening${NCOL}. " @@ -98,7 +107,7 @@ updates () { # Check for updates from different places... wonder if there's a better way # Check for APT - if command -v apt &> /dev/null; then + if command -v apt-get &> /dev/null; then debian=$(apt-get -s dist-upgrade -V 2> /dev/null | grep '=>' | awk '{print$1}' | wc -l) fi