We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a85770 + 44d326b commit a81b74eCopy full SHA for a81b74e
scripts/cpu.sh
@@ -39,7 +39,7 @@ get_cpu_color(){
39
get_cpu_usage() {
40
if is_osx; then
41
if command_exists "iostat"; then
42
- iostat -c 2 -w "$refresh_interval" | tail -n 1 | awk '{ print 100-$6 }'
+ iostat -c 2 -w "$refresh_interval" | tail -n 1 | awk '{ print 100-$(NF-3) }'
43
else
44
top -l 2 -s "$refresh_interval" -n 0 | sed -nr '/CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p' | tail -n 1 | awk '{ print 100-$0 }'
45
fi
0 commit comments