Battery threshold (Lua)

Battery threshold example
This Lua script will execute the system 'beep' command when the battery value drops below a certain threshold. Use it like so (beeps when battery goes below 6%):