Possible fix for Issue #1315 and an update to the battery plugin

I have come up with a solution that seems to work on Debian, I haven't tried it while logged on to a gui but from ssh it seems to work. 

I would definitely check to make sure you it would be safe to use though.  I'm no guru!