Extracted utility method.

(proposed same to package author)
Adding a patch to the battery display function.

Already fixed in the development version but I'm not running that.