diff --git a/neofetch b/neofetch index 8a9078af..56cf6cec 100755 --- a/neofetch +++ b/neofetch @@ -589,23 +589,23 @@ getuptime () { days=$((uptime / 86400)) # Format the output like Linux's "uptime -p" cmd. - case "$mins" in - 0) ;; - 1) uptime="up $mins minute" ;; - *) uptime="up $mins minutes" ;; - esac + if [ "$mins" == 1 ]; then + uptime="up $mins minute" + elif [ "$mins" != 0 ]; then + uptime="up $mins minutes" + fi - case "$hours" in - 0) ;; - 1) uptime="up $hours hour, ${uptime/up }" ;; - *) uptime="up $hours hours, ${uptime/up }" ;; - esac + if [ "$hours" == 1 ]; then + uptime="up $hours hour, ${uptime/up }" + elif [ "$mins" != 0 ]; then + uptime="up $hours hours, ${uptime/up }" + fi - case "$days" in - 0) ;; - 1) uptime="up $days day, ${uptime/up }" ;; - *) uptime="up $days days, ${uptime/up }" ;; - esac + if [ "$days" == 1 ]; then + uptime="up $days day, ${uptime/up }" + elif [ "$days" != 0 ]; then + uptime="up $days days, ${uptime/ up}" + fi ;; "Windows")