/[scripts]/trunk/dwm-status.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/dwm-status.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 56 by dpavlin, Tue Oct 2 16:32:17 2007 UTC revision 57 by dpavlin, Thu Jan 10 20:11:42 2008 UTC
# Line 17  my $disk_blk_size = 512; Line 17  my $disk_blk_size = 512;
17    
18  my $debug = shift @ARGV;  my $debug = shift @ARGV;
19    
20    my $awesome = 0;
21    
22  $|=1;  $|=1;
23    
24  sub proc2hash {  sub proc2hash {
# Line 94  my $bat; Line 96  my $bat;
96    
97  my $i = 0;  my $i = 0;
98    
99    if ( $awesome ) {
100            undef $awesome;
101            open( $awesome, '|-', 'awesome-client' ) || die "can't open awesome-client: $!";
102    }
103    
104  while ( 1 ) {  while ( 1 ) {
105          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());
106    
# Line 177  while ( 1 ) { Line 184  while ( 1 ) {
184          my $d_write = ( $d_w - $ld_w ) / $dt;          my $d_write = ( $d_w - $ld_w ) / $dt;
185          ( $ld_r, $ld_w ) = ( $d_r, $d_w );          ( $ld_r, $ld_w ) = ( $d_r, $d_w );
186    
187          printf("%s | %s |%5s D %-5s|%5s > %-5s| %s%s\n",          my $out = sprintf("%s | %s |%5s D %-5s|%5s > %-5s| %s%s\n",
188                  $s,                  $s,
189                  $load,                  $load,
190                  unit( $d_read ), unit( $d_write ),                  unit( $d_read ), unit( $d_write ),
# Line 185  while ( 1 ) { Line 192  while ( 1 ) {
192                  $bat, $temp,                  $bat, $temp,
193          );          );
194    
195            if ( $awesome ) {
196                    print $awesome "0 statusbar_set_text $out";
197            } else {
198                    print $out;
199            }
200    
201          sleep $dt;          sleep $dt;
202  }  }
203    

Legend:
Removed from v.56  
changed lines
  Added in v.57

  ViewVC Help
Powered by ViewVC 1.1.26