summaryrefslogtreecommitdiff
path: root/loadbars.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-01-14 21:41:00 +0000
committerPaul Buetow <paul@buetow.org>2011-01-14 21:41:00 +0000
commit0766eea0db0a3d07b0ace36c68ff29bc35fe95a9 (patch)
tree44daad57e314880aeb11e7f140dc8b3fd0cb9537 /loadbars.pl
parent2908ae83e8d4d5a394df97ba4464d446e267411e (diff)
a few cosmetic code fixes
Diffstat (limited to 'loadbars.pl')
-rwxr-xr-xloadbars.pl42
1 files changed, 20 insertions, 22 deletions
diff --git a/loadbars.pl b/loadbars.pl
index 28854c4..7ea3fc9 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -169,6 +169,8 @@ BASH
}
} until $sigstop;
+
+ return undef;
}
sub get_rect ($$) {
@@ -203,17 +205,19 @@ sub get_load_average ($@) {
sub wait_for_stats () {
sleep 1 until %STATS;
+ return undef;
}
sub draw_background ($$) {
my ($app, $rects) = @_;
-
-
my $rect = get_rect $rects, 'background';
+
$rect->width($CONF{width});
$rect->height($CONF{height});
$app->fill($rect, BLACK);
$app->update($rect);
+
+ return undef;
}
sub null ($) {
@@ -284,8 +288,15 @@ sub draw_rects ($$$$$$$$) {
return undef;
}
-sub graph_stats ($) {
- my ($app) = @_;
+sub thr_display_stats () {
+ my $app = SDL::App->new(
+ -title => $CONF{title},
+ -icon_title => $CONF{title},
+ -width => $CONF{width},
+ -height => $CONF{height}.
+ -depth => DEPTH,
+ -resizeable => 0,
+ );
wait_for_stats;
@@ -366,7 +377,6 @@ sub graph_stats ($) {
delete $STATS{'0SUMMARY;cpu'} if exists $STATS{'0SUMMARY;cpu'};
}
-
for my $key (sort keys %STATS) {
my ($host, $name) = split ';', $key;
@@ -419,31 +429,18 @@ TIMEKEEPER:
return undef;
}
-sub thr_display_stats () {
- my $app = SDL::App->new(
- -title => $CONF{title},
- -icon_title => $CONF{title},
- -width => $CONF{width},
- -height => $CONF{height}.
- -depth => DEPTH,
- -resizeable => 0,
- );
-
-
- graph_stats $app
-}
-
sub send_message ($$) {
my ($thread, $message) = @_;
$MSG = $message;
$thread->kill('USR2');
+
+ return undef;
}
sub set_togglecpu_regexp () {
$CONF{cpuregexp} = $CONF{togglecpu} ? 'cpu ' : 'cpu';
-
return undef;
}
@@ -694,7 +691,8 @@ sub main () {
stop_threads $display, @threads;
say "Good bye";
- exit 0;
+
+ return 0;
}
-main;
+exit main;