X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fbattery.pl;h=9a6a9760b1705652953d0c40d454937538aefd62;hb=020f30113df431a611f9a6ec9d963f1da38bb8ec;hp=41956ac43fb431dd9862d45a08e1a38ed5e56882;hpb=614f9080ac810a2f4c0a5244bca856f3358e625e;p=config%2Fdotfiles.git diff --git a/bin/battery.pl b/bin/battery.pl index 41956ac..9a6a976 100755 --- a/bin/battery.pl +++ b/bin/battery.pl @@ -37,7 +37,7 @@ while (<$file>) { /^POWER_SUPPLY_([A-Z_]+)=(.+)$/; $battery{$1} = $2; } -close $file; +close $file or die $!; my $charge = int($battery{CHARGE_NOW} / $battery{CHARGE_FULL} * 100);