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:
parent
fc8f655bb7
commit
3ee3574351
@ -28,7 +28,7 @@ DT_SYM=''
|
|||||||
DT_FMT='%a %d %I:%M%p'
|
DT_FMT='%a %d %I:%M%p'
|
||||||
|
|
||||||
status_cpu() {
|
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() {
|
status_mem() {
|
||||||
|
Loading…
Reference in New Issue
Block a user