28 |
while(<$fh>) { |
while(<$fh>) { |
29 |
chomp; |
chomp; |
30 |
my ( $key, $value ) = split(/:\s+/, $_, 2); |
my ( $key, $value ) = split(/:\s+/, $_, 2); |
31 |
$value =~ s/ m[VW]h*$//; |
$value =~ s/ m[AVW]h*$//; |
32 |
$h->{$key} = $value; |
$h->{$key} = $value; |
33 |
} |
} |
34 |
warn "$f ",dump( $h ) if ( $debug ); |
warn "$f ",dump( $h ) if ( $debug ); |
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 ( -e $sys_fs ) { |
my $sysfs_path = glob "$sys_fs/*_full"; |
104 |
|
if ( $sysfs_path ) { |
105 |
|
|
106 |
my $full = read_file( "$sys_fs/charge_full" ); |
my $full = read_file( $sysfs_path ); |
107 |
my $now = read_file( "$sys_fs/charge_now" ); |
$sysfs_path =~ s/_full/_now/; |
108 |
|
my $now = read_file( $sysfs_path ); |
109 |
$bat = sprintf("%2d%% | ", $now * 100 / $full ); |
$bat = sprintf("%2d%% | ", $now * 100 / $full ); |
110 |
|
|
111 |
} elsif ( $proc_acpi_battery ) { |
} elsif ( $proc_acpi_battery ) { |