Played on my Libra Colour and changed battery to bd71827_bat in the shell script. I've attached the script (renamed to battcalc.sh.txt so rename back) and an image of the popup.
My first pass at the changes screwed up when I copy/pasted the script and the line endings were changed to CRLF. Used Notepad++ to change them to LF and all was happy.