bern-auto-shutdown is an ultra lightweight daemon that automatically shuts down your computer when the battery level gets below a certain level and the charger is not plugged in. The default battery level that triggers the shutdown is 15%. It is primarily intended for computers that spend most of their time on the charger, this is why the assembly version of the program has a simpler loop with less jumps when the battery is plugged in.

Download source code