Is there a better way to display cpu usage in tmux?

Viewed 9058

Here's a solution which may consume a lot of cpu usage (stolen from this article):

There's a difference in my Ubuntu 12 ec2 server, I have to use top -bn1 instead of top -ln.

Here's my related .tmux.conf file:

set -g status-right '#[fg=yellow]#[(getCpuUsage.sh)]'

It actually calls top every 2 seconds and outputs a whole lot of information. I think there should be a way involving less cpu consumption or use some flag to limit the output of top to only cpu usage.

4 Answers
  1. stat top command.
  2. press 1.
  3. Press 0 then
  4. Press "t" twice.

It will display bar graph of the CPU usage. You can change the color by +z. Then color number in the list.

Related