Re: [wmii] Adding cpu usage to status bar

From: Kris Maglione <>
Date: Tue, 5 May 2009 16:48:53 -0400

On Tue, May 05, 2009 at 10:16:18AM -0700, Manuel Rotter wrote:
>top -b -d 1 -n 2|grep Cpu|awk 'BEGIN { FS = " " } { print $2 }'|tail
>-n 1 | sed 's/us,//g')
>This should echo the right cpu -n 1 seems to be not
>We also had another Way of doing it, probably more reliable, but i am
>sorry, i can't tell you that. It has to do something with /proc/stat,
>but for me this was enough.

The only real problem I have with this is that the wall time of
top -n 1 is ~.5sec on my machine, and it has to compute a lot of
data other than overall CPU utilization. I don't think it's
suitable for a status script when used as such.

Kris Maglione
Saying that Java is good because it works on all platforms is like
saying anal sex is good because it works on all genders.
Received on Tue May 05 2009 - 20:48:53 UTC

This archive was generated by hypermail 2.2.0 : Tue May 05 2009 - 21:00:08 UTC