Optimize _lp_battery: no sed

Optimize _lp_battery to use less external commands.