summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (venus) <paul@buetow.org>2012-01-21 14:09:20 +0100
committerPaul Buetow (venus) <paul@buetow.org>2012-01-21 14:09:20 +0100
commitb17e7043f3c9e495f29e14c280817d7a4aaff98e (patch)
tree0dadca08516fced576531b555d6723d08e426346
parentb42589078bde82322ab2d813298480f7cb6fefeb (diff)
change format to %02d%s
-rwxr-xr-xloadbars17
1 files changed, 10 insertions, 7 deletions
diff --git a/loadbars b/loadbars
index 7d0834c..41752cb 100755
--- a/loadbars
+++ b/loadbars
@@ -430,7 +430,7 @@ sub main_loop ($@) {
my $all = sum @{$cpuaverage}{qw(user system iowait)};
my $max_all = 0;
- $app->fill($rect_idle, Loadbars::GREY0);
+ $app->fill($rect_idle, Loadbars::BLACK);
$app->fill($rect_iowait, Loadbars::PURPLE);
$app->fill($rect_nice, Loadbars::GREEN);
@@ -476,12 +476,13 @@ sub main_loop ($@) {
$C{togglecpu} ? $current_barnum + 1: $current_corenum);
}
- $app->print($x, $y+=$space, sprintf '%d%s', $cpuaverage->{nice}, 'ni');
- $app->print($x, $y+=$space, sprintf '%d%s', $cpuaverage->{iowait}, 'io');
- $app->print($x, $y+=$space, sprintf '%d%s', $cpuaverage->{user}, 'us');
- $app->print($x, $y+=$space, sprintf '%d%s', $cpuaverage->{system}, 'sy');
- $app->print($x, $y+=$space, sprintf '%d%s', $all, 'al');
- $app->print($x, $y+=$space, sprintf '%d%s', $max_all, 'pk') if $C{togglepeak};
+ $app->print($x, $y+=$space, sprintf '%02d%s', $cpuaverage->{idle}, 'id');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $cpuaverage->{nice}, 'ni');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $cpuaverage->{iowait}, 'io');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $cpuaverage->{user}, 'us');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $cpuaverage->{system}, 'sy');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $all, 'al');
+ $app->print($x, $y+=$space, sprintf '%02d%s', $max_all, 'pk') if $C{togglepeak};
unless ($is_host_summary) {
if (defined $loadavg[0]) {
@@ -545,6 +546,8 @@ sub dispatch_table () {
my $textdesc = <<END;
Explanations:
+ id = Idle cpu usage in %
+ Color: Black
ni = Nice cpu usage in %
Color: Green
io = IOwait cpu sage in %