creaktive/rainbarf — pull request #4 by tjormola (2013-02-05 10:57:33+00:00)
Title: Fix perl warnings when running with defaults on Linux on a machine with no battery

Currently on Linux desktop machine which has ACPI support thus /proc/acpi/battery exists but no BAT* files there since no battery on the machine, rainbarf will output some warnings. This change will do the battery stats calculation only if BAT* files are really available thus avoiding the warnings.

(12:54:35)(tj@ganga)(~/prj/rainbarf)$ ./rainbarf
Use of uninitialized value $battery{"charging_state"} in string ne at ./rainbarf line 207.
Use of uninitialized value in division (/) at ./rainbarf line 208.
Use of uninitialized value in division (/) at ./rainbarf line 208.