diff options
| author | Paul Buetow <paul@buetow.org> | 2011-01-11 10:21:26 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2011-01-11 10:21:26 +0000 |
| commit | f1fcc8dfb0106abad4d11e88e09f0180aad4149e (patch) | |
| tree | a62a6912be158c9c98d6061491ab5c49fabfe6fd /loadbars.pl | |
| parent | 2f68a9f853b538d0a40ae79d9e68aa91a056e38d (diff) | |
color border limits are now constants
Diffstat (limited to 'loadbars.pl')
| -rwxr-xr-x | loadbars.pl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/loadbars.pl b/loadbars.pl index e6f1ad3..41f8c44 100755 --- a/loadbars.pl +++ b/loadbars.pl @@ -67,6 +67,11 @@ use constant { WHITE => SDL::Color->new(-r => 0xff, -g => 0xff, -b => 0xff), 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_RED => 90, + USER_ORANGE => 70, + USER_YELLOW0 => 50, }; $| = 1; @@ -329,13 +334,13 @@ sub graph_stats ($) { $app->fill($rect_iowait, BLACK); $app->fill($rect_nice, GREEN); $app->fill($rect_system, BLUE); - $app->fill($rect_system, $load_average{system} > 30 + $app->fill($rect_system, $load_average{system} > SYSTEM_PURPLE ? PURPLE : BLUE); - $app->fill($rect_user, $system_n_user > 99 ? WHITE - : ($system_n_user > 90 ? RED - : ($system_n_user > 70 ? ORANGE - : ($system_n_user > 50 ? YELLOW0 + $app->fill($rect_user, $system_n_user > USER_WHITE ? WHITE + : ($system_n_user > USER_RED ? RED + : ($system_n_user > USER_ORANGE ? ORANGE + : ($system_n_user > USER_YELLOW0 ? YELLOW0 : (YELLOW))))); $app->update($_) for $rect_nice, $rect_iowait, $rect_system, $rect_user; |
