Don't print CPU if it's empty

This commit is contained in:
Dylan 2016-05-07 12:42:36 +10:00
parent 0e0df9d03e
commit 16f395c462

View file

@ -1051,8 +1051,7 @@ getcpu () {
# Trim whitespace # Trim whitespace
cpu=${cpu//+( )/ } cpu=${cpu//+( )/ }
# Add CPU info bar [ ! -z "$cpu" ] && prin "$subtitle" "$cpu"
prin "$subtitle" "$cpu"
if [ "$cpu_display" != "off" ]; then if [ "$cpu_display" != "off" ]; then
cpu_usage="$(ps aux | awk 'BEGIN { sum = 0 } { sum += $3 }; END { print sum }')" cpu_usage="$(ps aux | awk 'BEGIN { sum = 0 } { sum += $3 }; END { print sum }')"