Storage [Q] Custom rom to reboot automatically

I would like to know if there is any custom rom to reboot my Moto G automatically. The issue is that i smashed my power button. When i run out of battery it would be great if it would reboot when its connected it to the power supply.