mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
Close #19 fixed cpu percentage
This commit is contained in:
parent
d7d3501fda
commit
71db1fdd1b
|
|
@ -23,7 +23,7 @@ print_cpu_percentage() {
|
|||
usage="$(WMIC cpu get LoadPercentage | grep -Eo '^[0-9]+')"
|
||||
printf "%5.1f%%" $usage
|
||||
else
|
||||
load=`ps -aux | awk '{print $3}' | tail -n+2 | awk '{s+=$1} END {print s}'`
|
||||
load=`top -bn 1 | awk 'NR>7{s+=$9} END {print s}'`
|
||||
cpus=$(cpus_number)
|
||||
echo "$load $cpus" | awk '{printf "%5.2f%%", $1/$2}'
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue