/[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 81 by dpavlin, Tue Jul 22 01:16:52 2008 UTC revision 89 by dpavlin, Tue Sep 16 18:10:06 2008 UTC
# Line 100  while ( 1 ) { Line 100  while ( 1 ) {
100          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());          my $s = strftime("%Y-%m-%d %H:%M:%S", localtime());
101    
102          if ( $i % $acpi_every == 0 ) {          if ( $i % $acpi_every == 0 ) {
103                  if ( $proc_acpi_battery ) {                  if ( -e $sys_fs ) {
104    
105                            my $full = read_file( "$sys_fs/charge_full" );
106                            my $now = read_file( "$sys_fs/charge_now" );
107                            $bat = sprintf("%2d%% | ", $now * 100 / $full );
108    
109                    } elsif ( $proc_acpi_battery ) {
110    
111                          my $state = proc2hash( "$proc_acpi_battery/state" );                          my $state = proc2hash( "$proc_acpi_battery/state" );
112    
# Line 124  while ( 1 ) { Line 130  while ( 1 ) {
130                                          $state->{'present rate'} / 1000                                          $state->{'present rate'} / 1000
131                                  );                                  );
132                          }                          }
                 } elsif ( -e $sys_fs ) {  
                         my $full = read_file( "$sys_fs/charge_full" );  
                         my $now = read_file( "$sys_fs/charge_now" );  
                         $bat = sprintf("%2d%% | ", $now * 100 / $full );  
133                  }                  }
134          } else {          } else {
135                  $bat =~ s/!(\|\s)$/ $1/;                  $bat =~ s/!(\|\s)$/ $1/;

Legend:
Removed from v.81  
changed lines
  Added in v.89

  ViewVC Help
Powered by ViewVC 1.1.26