Fix: CPU usage using %cpu

Use %cpu format in ps and drop the percent sign from the output since
the numbers don't usually add up to 100.
This commit is contained in:
Narvin Singh 2020-12-24 11:34:53 -05:00
parent fc8f655bb7
commit 3ee3574351

View File

@ -28,7 +28,7 @@ DT_SYM=''
DT_FMT='%a %d %I:%M%p'
status_cpu() {
ps -ef | awk '{cpu = cpu + $4} END {print cpu "%"}'
ps --no-headers -eo %cpu | awk '{cpu = cpu + $1} END {print cpu}'
}
status_mem() {