summaryrefslogtreecommitdiffstats
path: root/cpustat
blob: 90e1acd610b1270ef3deaea8cc21d881770dd1af (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/zsh
idle=$(mpstat | tail -1 | awk '{ print $12 }')
print $idle
util=${$((100.00-$idle))%.*}

if [[ $util -ge 50 ]];then
    echo -n "CPU: <fc=#f0c040>$util</fc>%"
else
    echo -n "CPU: $util%"
fi