Added new check for apt instead of apt-get

This commit is contained in:
G2-Games 2022-09-18 19:40:42 -05:00
parent b5060b4658
commit f4477e87e1
2 changed files with 13 additions and 3 deletions

View file

@ -79,6 +79,7 @@ then
line=${line%:*} line=${line%:*}
sed -i "${line}d" $zshrc sed -i "${line}d" $zshrc
fi fi
# End older version check #
tput rc el ed tput rc el ed
echo -e "\e[36mUninstalled! \e[0m" echo -e "\e[36mUninstalled! \e[0m"

View file

@ -3,12 +3,21 @@ version=0.2.5
#========Welcome=======# #========Welcome=======#
welcome () { welcome () {
msg="Welcome" # Default 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 if [ "$randgreeting" = "on" ]; then
msg=${greetings[$(($RANDOM % $(echo ${#greetings[@]})))]} msg=${greetings[$(($RANDOM % $(echo ${#greetings[@]})))]}
fi fi
# Print the welcome message # Print the welcome message
echo -en "$msg, ${USRC}${BOLD}$USER${NCOL}. " echo -en "$msg, ${USRC}${BOLD}$usr${NCOL}. "
} }
#=========Time=========# #=========Time=========#
@ -45,7 +54,7 @@ greeting () {
echo -en "$greet ${MORN}morning${NCOL}. " echo -en "$greet ${MORN}morning${NCOL}. "
elif [ $hour -eq 12 ]; then elif [ $hour -eq 12 ]; then
echo -en "It's ${AFTN}noon${NCOL}. " 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}. " echo -en "$greet ${AFTN}afternoon${NCOL}. "
elif [ $hour -le 19 ] && [ $hour -gt 17 ]; then elif [ $hour -le 19 ] && [ $hour -gt 17 ]; then
echo -en "$greet ${EVEN}evening${NCOL}. " 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 updates from different places... wonder if there's a better way
# Check for APT # 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) debian=$(apt-get -s dist-upgrade -V 2> /dev/null | grep '=>' | awk '{print$1}' | wc -l)
fi fi