Get the latest tech news
How to trigger a command on Linux when power switches from AC to battery
In this blog post, you will learn how to trigger a command when a laptop is disconnected from power supply
If nothing happens, looks at systemd logs to see if something is wrong in udev, like a syntax error in the file you created or an incorrect path for the script. Lock user sessions Hibernate Proper shutdown Instant power off (through sysrq) Destroy LUKS master key to make LUKS volume unrecoverable + Instant power off While BusKill is an effective / unusual product that is certainly useful for a niche, protecting a running laptop against thieves is an extra layer when being outside.
Or read this on Hacker News