--- trunk/dwm-status.pl 2008/10/25 21:42:24 95 +++ trunk/dwm-status.pl 2008/10/26 23:12:16 96 @@ -100,12 +100,12 @@ my $s = strftime("%Y-%m-%d %H:%M:%S", localtime()); if ( $i % $acpi_every == 0 ) { - if ( -e $sys_fs ) { + my $sysfs_path = glob "$sys_fs/*_full"; + if ( $sysfs_path ) { - my $path = glob "$sys_fs/*_full"; - my $full = read_file( $path ); - $path =~ s/_full/_now/; - my $now = read_file( $path ); + my $full = read_file( $sysfs_path ); + $sysfs_path =~ s/_full/_now/; + my $now = read_file( $sysfs_path ); $bat = sprintf("%2d%% | ", $now * 100 / $full ); } elsif ( $proc_acpi_battery ) {