So lately I've been hanging out a lot at Coffee Station and on campus using my Laptop. Doing this, one of the biggest annoyances I had was whenever I had to leave the area to get a coffee or something, I risk leaving the Laptop unattended. Using a cable lock every time was annoying, so instead I wrote a anti theft alarm script that utilizes the Laptop's built in accelerometer. Originally it's meant to be used for the HDAPS, or Hard Disk Active Protection System, to detect shock and prevent data corruption, but I will be using it for a different purpose. Here is a demo video...
This is how it works. Whenever I am about to leave the laptop, I start the script which locks the laptop and start the gnome screensaver. Any small bumps or tilting up to 20 degrees of the laptop will produce a small chirp sound where the volume is directly proportional to how tilted it is (so the more you tilt it, the more loud it becomes) as a initial warning to anyone who bumps or laptop or for small movements. Any movement beyond 20 degrees of tilt will start the alarm at the highest volume (and the ThinkPad speakers are Loud). The script monitors the gnome screensaver status, so the only way to stop the alarm or to unarm the system is to log in using the password or a finger swipe which the gnome screensaver.
If you want to get this working on your linux laptop, make sure you have HDAPS on your laptop and Tp_smapi installed. There are other anti theft implementations that use the HDAPS data you can find here, but none of them integrated well with the gnome screensaver or have the initial warning feature. That's all for now, hope you found this useful.
Update Nov 8, 2008
Fork of my script for Kubuntu/KDE written by Colin Verot.