I want to share another script which I created to notify me if my laptops battery is getting low and shut down the system if it gets too critical. Here it is on pastbin.
I personally run this on from my users
$HOME/.config/openbox/autostart.sh. You have to adjust it a bit to you system, but I have used it for years in conjunction with laptop-mode-tools (as power-saving features) and notify-send-broadcast (if you want to run it as startup-script as root) and never needed anything else.