--- trunk/dwm-status.pl 2009/02/03 18:41:06 105 +++ trunk/dwm-status.pl 2010/03/29 21:34:11 134 @@ -16,7 +16,7 @@ my $disk_blk_size = 512; my $debug = shift @ARGV; -my $awesome = 1; +my $awesome = 0; $|=1; @@ -154,13 +154,14 @@ foreach ( split(/\n/, $net) ) { s/^\s+//; - s/:\s+/:/; + s/:\s*/ /; my @n = split(/\s+/, $_, 17); - next unless ( $n[0] =~ s!(eth\d|ath\d):!! ); + #next unless ( $n[0] =~ s!(eth\d|ath\d):!! ); + next unless $n[1] =~ m{^\d+$}; warn dump( @n ) if ($debug); - $rx += $n[0]; - $tx += $n[8]; + $rx += $n[1]; + $tx += $n[9]; } warn "rx: $rx tx: $tx\n" if ($debug); @@ -186,18 +187,21 @@ my $d_write = ( $d_w - $ld_w ) / $dt; ( $ld_r, $ld_w ) = ( $d_r, $d_w ); - my $out = sprintf("%s | %s |%5s D %-5s|%5s > %-5s| %s%s\n", - $s, + my $out = sprintf("%s |%5s D %-5s|%5s > %-5s| %s%s | %s", $load, unit( $d_read ), unit( $d_write ), unit( $net_rx ), unit( $net_tx ), $bat, $temp, + $s, ); - print $out; + print "$out\n"; if ( $awesome ) { open(my $fh, '|-', 'awesome-client') || die "can't pipe to awesome-client: $!"; - print $fh "0 widget_tell mystatusbar dwm-status text $out\n"; + print $fh + $awesome == 3 ? qq{mytextbox.text="$out"\n} + : "0 widget_tell mystatusbar dwm-status text $out\n" + ; close($fh); }