summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-07 14:31:07 +0000
committerPaul Buetow <paul@buetow.org>2010-11-07 14:31:07 +0000
commit09de93676339db2e97e13d56c8b83e10af998944 (patch)
tree9e9ad031ef2cd1a09d0fc3d544928bc61ba6db22
parent90f64eefd2969d3b445d418c91ea1d4a17292810 (diff)
system > 50: system: purple
system <= 50: system: blue
-rwxr-xr-xcpuload.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpuload.pl b/cpuload.pl
index e2e4f57..74b8a01 100755
--- a/cpuload.pl
+++ b/cpuload.pl
@@ -231,12 +231,16 @@ sub graph_stats ($$) {
$rect_iowait->y($y);
my $system_n_user = sum @load_average{qw(user system)};
+
$app->fill($rect_iowait, $colors->{black});
$app->fill($rect_nice, $colors->{green});
$app->fill($rect_system, $colors->{blue});
- $app->fill($rect_user, $system_n_user >= 90
+ $app->fill($rect_system, $load_average{system} > 50
+ ? $colors->{purple}
+ : $colors->{blue});
+ $app->fill($rect_user, $system_n_user > 90
? $colors->{red}
- : ( $system_n_user >= 70
+ : ( $system_n_user > 70
? $colors->{orange}
: $colors->{yellow}));
@@ -265,6 +269,7 @@ sub display_stats () {
yellow => SDL::Color->new(-r => 0xff, -g => 0xa0, -b => 0x00),
green => SDL::Color->new(-r => 0x00, -g => 0x90, -b => 0x00),
blue => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0xff),
+ purple => SDL::Color->new(-r => 0xa0, -g => 0x20, -b => 0xf0),
black => SDL::Color->new(-r => 0x00, -g => 0x00, -b => 0x00),
};