How to trigger a command on Linux when power switches from AC to battery
After thinking about BusKill product that triggers a command once the USB cord disconnects, I have been thinking at a simple alternative. BusKill official project website When using a laptop connected to power most of the time, you may want it to power off once it gets disconnected, this can be really useful if you use it in a public area like a bar or a train. The idea is to protect the laptop if it gets stolen while in use and unlocked. Here is how to proceed on Linux, using a trigger on an