sb-cpu: fix spacing when no temperature shown
This commit is contained in:
parent
44f1d24434
commit
29b0a33569
|
@ -4,7 +4,8 @@
|
|||
n_cpu=$(grep -c 'cpu[0-9]\+' /proc/stat)
|
||||
cache=$XDG_RUNTIME_DIR/cpubarscache
|
||||
|
||||
temp="$(sensors | awk '/CPU/ {printf ("%.f°C", $2)}' | tr -d "+") "
|
||||
temp="$(sensors | awk '/CPU/ {printf ("%.f°C", $2)}' | tr -d "+")"
|
||||
[ -n "$temp" ] && temp="${temp} "
|
||||
|
||||
new=$(awk '/cpu[0-9]+/ { printf "%d %d\n", $5, ($2 + $3 + $4 + $5) }' /proc/stat 2>/dev/null)
|
||||
|
||||
|
@ -19,7 +20,6 @@ printf "%b" " $temp<span ${bggray}>"
|
|||
first=true
|
||||
IFS='
|
||||
'
|
||||
|
||||
for i in $(seq "$n_cpu"); do
|
||||
old_idle=$(echo "$old" | awk -v i="$i" 'NR==i { print $1 }')
|
||||
old_total=$(echo "$old" | awk -v i="$i" 'NR==i { print $2 }')
|
||||
|
|
Loading…
Reference in New Issue