From 08e8113c8bdde811ca127be057dba44a5c704d96 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 29 Apr 2016 10:19:09 +1000 Subject: [PATCH] Better comma hanfling --- neofetch | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index 354ce118..e2403dd8 100755 --- a/neofetch +++ b/neofetch @@ -597,17 +597,25 @@ getuptime () { esac case "$hours" in - 1) hours="1 hour," ;; + 1) hours="1 hour" ;; 0) unset hours ;; - *) hours="$hours hours," ;; + *) hours="$hours hours" ;; esac case "$days" in - 1) days="1 day," ;; - 0) unset days;; - *) days="$days days," ;; + 1) days="1 day" ;; + 0) unset days ;; + *) days="$days days" ;; esac + [ ! -z "$hours" ] && \ + [ ! -z "$minutes" ] && \ + hours+="," + + [ ! -z "$days" ] && \ + [ ! -z "$hours" ] && \ + days+="," + uptime="up $days $hours $minutes" ;; esac