/[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 57 by dpavlin, Thu Jan 10 20:11:42 2008 UTC revision 59 by dpavlin, Fri Jan 18 19:10:10 2008 UTC
# Line 8  use strict; Line 8  use strict;
8  use POSIX qw/strftime/;  use POSIX qw/strftime/;
9  use File::Slurp;  use File::Slurp;
10  use Time::HiRes;  use Time::HiRes;
11  eval "use Data::Dump qw/dump/;";  use Data::Dump qw/dump/;
12    
13  my $dt = 3;  my $dt = 3;
14  my $acpi_every = 10;  my $acpi_every = 10;
# 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    
 my $awesome = 0;  
   
20  $|=1;  $|=1;
21    
22  sub proc2hash {  sub proc2hash {
# Line 96  my $bat; Line 94  my $bat;
94    
95  my $i = 0;  my $i = 0;
96    
 if ( $awesome ) {  
         undef $awesome;  
         open( $awesome, '|-', 'awesome-client' ) || die "can't open awesome-client: $!";  
 }  
97    
98  while ( 1 ) {  while ( 1 ) {
99          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());
# Line 192  while ( 1 ) { Line 186  while ( 1 ) {
186                  $bat, $temp,                  $bat, $temp,
187          );          );
188    
189          if ( $awesome ) {          print $out;
                 print $awesome "0 statusbar_set_text $out";  
         } else {  
                 print $out;  
         }  
190    
191          sleep $dt;          sleep $dt;
192  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26