summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (venus) <paul@buetow.org>2012-01-21 13:50:50 +0100
committerPaul Buetow (venus) <paul@buetow.org>2012-01-21 13:50:50 +0100
commitb42589078bde82322ab2d813298480f7cb6fefeb (patch)
treef80cb665c2cc0a49a8a6afc3693c5c9a56a8290d
parent8d6d600827bd41015b852bc7a253de4772b6743d (diff)
some color cleanup
-rwxr-xr-xloadbars47
1 files changed, 17 insertions, 30 deletions
diff --git a/loadbars b/loadbars
index ecbb9bd..7d0834c 100755
--- a/loadbars
+++ b/loadbars
@@ -42,7 +42,6 @@ use constant {
YELLOW0 => SDL::Color->new(-r => 0xff, -g => 0xa0, -b => 0x00),
YELLOW => SDL::Color->new(-r => 0xff, -g => 0xc0, -b => 0x00),
SYSTEM_PURPLE => 30,
- USER_WHITE => 99,
USER_ORANGE => 70,
USER_YELLOW0 => 50,
NULL => 0,
@@ -450,23 +449,16 @@ sub main_loop ($@) {
$max_all = sum @{$cpumax}{qw(user system)};
$max_all = 100 if $max_all > 100;
- $app->fill($rect_peak, $max_all > Loadbars::USER_WHITE ? Loadbars::WHITE
- : ($max_all > Loadbars::USER_ORANGE ? Loadbars::ORANGE
+ $app->fill($rect_peak, $max_all > Loadbars::USER_ORANGE ? Loadbars::ORANGE
: ($max_all > Loadbars::USER_YELLOW0 ? Loadbars::YELLOW0
- : (Loadbars::YELLOW))));
+ : (Loadbars::YELLOW)));
}
- $app->fill($rect_user, $all > Loadbars::USER_WHITE ? Loadbars::WHITE
- : ($all > Loadbars::USER_ORANGE ? Loadbars::ORANGE
+ $app->fill($rect_user, $all > Loadbars::USER_ORANGE ? Loadbars::ORANGE
: ($all > Loadbars::USER_YELLOW0 ? Loadbars::YELLOW0
- : (Loadbars::YELLOW))));
- $app->fill($rect_system, $cpuaverage->{system} > Loadbars::SYSTEM_PURPLE
- ? Loadbars::PURPLE
+ : (Loadbars::YELLOW)));
+ $app->fill($rect_system, $cpuaverage->{system} > Loadbars::SYSTEM_PURPLE ? Loadbars::PURPLE
: Loadbars::BLUE);
- $app->fill($rect_user, $all > Loadbars::USER_WHITE ? Loadbars::WHITE
- : ($all > Loadbars::USER_ORANGE ? Loadbars::ORANGE
- : ($all > Loadbars::USER_YELLOW0 ? Loadbars::YELLOW0
- : (Loadbars::YELLOW))));
my ($y, $space) = (5, $font_height);
my @loadavg = split ';', $AVGSTATS{$host};
@@ -552,24 +544,19 @@ sub dispatch_table () {
my $hosts = '';
my $textdesc = <<END;
-Explanation text display:
- ni = Nice cpu usage in %
- us = User cpu usage in %
- sy = System cpu sage in %
- io = IOwait cpu sage in %
- al = sy+us+io in %
- pk = Max sy+us+io peak of last avg. samples in %
+Explanations:
+ ni = Nice cpu usage in %
+ Color: Green
+ io = IOwait cpu sage in %
+ Color: Purple
+ us = User cpu usage in %
+ Color: Yellow, dark yellow if al>50%, orange if al>50%
+ sy = System cpu sage in %
+ Blue, purple if >30%
+ al = sy+us+io
+ pk = Max sy+us+io peak of last avg. samples
avg = System load average (desc. order: 1, 5 and 15 min. avg.)
-Explanation colors:
- Green: ni
- Purple: io
- Blue: sy
- Purple: sy if >30%
- Yellow: us
- Darker yellow: us if sy+us+io cpu is >50%
- Orange: us if sy+us+io cpu is >70%
- White: us if sy+us+io cpu is >99%
- 1px horizontal line: Maximum sy+us+io cpu of last 'avg' samples
+ 1px horizontal line: Maximum sy+us+io of last 'avg' samples
END
# mode 1: Option is shown in the online help menu (stdout not sdl)