diff options
| -rw-r--r-- | lib/Loadbars/Constants.pm | 1 | ||||
| -rw-r--r-- | lib/Loadbars/Main.pm | 27 |
2 files changed, 12 insertions, 16 deletions
diff --git a/lib/Loadbars/Constants.pm b/lib/Loadbars/Constants.pm index c9913ae..f7cda36 100644 --- a/lib/Loadbars/Constants.pm +++ b/lib/Loadbars/Constants.pm @@ -17,6 +17,7 @@ use constant { LIGHT_BLUE0 => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xcc ), BLUE => SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0x88 ), GREEN => SDL::Color->new( -r => 0x00, -g => 0x90, -b => 0x00 ), + LIGHT_GREEN => SDL::Color->new( -r => 0x00, -g => 0xb0, -b => 0x00 ), ORANGE => SDL::Color->new( -r => 0xff, -g => 0x70, -b => 0x00 ), PURPLE => SDL::Color->new( -r => 0xa0, -g => 0x20, -b => 0xf0 ), RED => SDL::Color->new( -r => 0xff, -g => 0x00, -b => 0x00 ), diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index 0ee36bc..0fcf2da 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -761,17 +761,12 @@ sub loop ($@) { my $diff_stat_r = net_diff $now_stat_r->[0], $prev_stat_r->[0]; - #$net_max_bytes = $diff_stat_r->{b} if $diff_stat_r->{b} > $net_max_bytes; - #$net_max_bytes = $diff_stat_r->{tb} if $diff_stat_r->{tb} > $net_max_bytes; - - my $net_per = percentage $net_max_bytes, $diff_stat_r->{b}; - my $tnet_per = percentage $net_max_bytes, $diff_stat_r->{tb}; my $net_per = percentage $net_max_bytes, $diff_stat_r->{b}; my $tnet_per = percentage $net_max_bytes, $diff_stat_r->{tb}; my %heights = ( - NetFree => $net_per * ( $C{height} / 100 ), - NetUsed => ( 100 - $net_per ) * ( $C{height} / 100 ), + NetUsed => $net_per * ( $C{height} / 100 ), + NetFree => ( 100 - $net_per ) * ( $C{height} / 100 ), TNetFree => $tnet_per * ( $C{height} / 100 ), TNetUsed => ( 100 - $tnet_per ) * ( $C{height} / 100 ), ); @@ -800,27 +795,27 @@ sub loop ($@) { $rect_tnetfree->x( $x + $add_x + $half_width ); $rect_tnetfree->y($y); - $app->fill( $rect_netused, Loadbars::Constants->LIGHT_BLUE ); - $app->fill( $rect_netfree, Loadbars::Constants->BLACK ); + $app->fill( $rect_netused, Loadbars::Constants->BLACK ); + $app->fill( $rect_netfree, Loadbars::Constants->LIGHT_GREEN ); - $app->fill( $rect_tnetused, Loadbars::Constants->LIGHT_BLUE0 ); + $app->fill( $rect_tnetused, Loadbars::Constants->LIGHT_GREEN ); $app->fill( $rect_tnetfree, Loadbars::Constants->BLACK ); if ( $C{showtext} ) { my $y_ = 5; - $app->print( $x + $add_x, $y_, 'Rx:' ); + $app->print( $x + $add_x, $y_, 'Rxb:' ); $app->print( $x + $add_x, $y_ += $sdl_font_height, - sprintf '%02d', - ( 100 - $meminfo{ram_per} ) + sprintf '%02d%%', + ( $net_per ) ); - $app->print( $x + $add_x, $y_ += $sdl_font_height, 'Tr:' ); + $app->print( $x + $add_x, $y_ += $sdl_font_height, 'Trb:' ); $app->print( $x + $add_x, $y_ += $sdl_font_height, - sprintf '%02d', - ( 100 - $meminfo{swap_per} ) + sprintf '%02d%%', + ( $tnet_per ) ); } |
