We’ve all been there: a hip, Brooklyn (or Brooklyn-esque) coffee shop tappin’ away at the next great American novel. But we’ve all also had to go to the bathroom — but you don’t want to risk a stolen laptop. As Lenin asked with regard to something entirely different, what is to be done?

I built a solution! No, not a classless society that rejects property ownership (after all, how could a laptop that isn’t yours be stolen??) but an alarm that, when set, detects movement and screams — loudly.

The alarm uses the Hard Drive Active Protection System present in some Lenovo and Apple laptops. The alarm piggybacks on the HDAPS’s accelerometer to detect changes in the laptop’s position.

The alarm is an applet for Ubuntu’s Unity desktop environment, though it could be trivially adapted to other desktop managers like GNOME, XFCE or KDE. I use the tp_smapi kernel module to interface with HDAPS.

Check it out on GitHub and feel free to let me know if you have pull requests, bugs, or need help installing. If I figure out how to package .debs, I will eventually submit this as a package to Ubuntu’s powers-that-be.

Obviously, it’s open source: GPL3 and MIT.

Thanks to Janitha for the original alarm code.

PS: Sorry, communists, for using your ideology for my own literary amusement. Please don’t wrest the control of the means of punduction from my hands!