Made battery segment work on MacOSX

The battery segment were not working on my Macbook Pro because there are no ACPI, here is a working version using native apple tools
There is no need in using `shell=True` anywhere here. Note that there may be a shell that does not have `type` (hello `tcsh`).