From 09de93676339db2e97e13d56c8b83e10af998944 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 7 Nov 2010 14:31:07 +0000 Subject: system > 50: system: purple system <= 50: system: blue --- cpuload.pl | 9 +++++++-- 1 file 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), }; -- cgit v1.2.3