Jesús Gabriel y Galán <[email protected]> wrote: > > I was trying to modify the status bar to add cpu % usage. The easiest > way I found (or so I thought) was this, which works in the command > line: > > je...@localhost:~$ top -n 1 | awk 'NR==3 {print $2}' > 1.9%us, > Eugh, that truly is horrible.
Have a look at /proc/stat and section 1.8 of Documentation/filesystems/proc.txt in the Linux kernel tree. To be honest, getting CPU 'usage' is pretty pointless as it's either busy, idle or busy waiting on IO. You should be using loadavg really as instantaneous CPU usage tells you nothing. Regards -- Alexander Clouter .sigmonster says: People humiliating a salami!
