I'm trying to figure out if there's a way to use a bash or python script to tell if my laptop gets moved. I had the idea of using wifi signal strength to do it, but the problem with that is that you have to be pretty far from the router before the signal drops off.

One idea I had was to somehow use a Raspberry Pi with a cheaper wifi module that would send a weaker signal, and query that to see how far from the Raspi the laptop is.

But, I was wondering if this has been done before, and if so, if there's a way to tell without using wifi (as it seems quite inaccurate).

I had the idea of using the camera, but I haven't been able to set up my integrated webcam with Ubuntu yet, and besides, I'd rather not have it always-on.

  • For this, it seems you pretty much need some kind of dedicated hardware. A GPS chip might do it, to some degree of accuracy, though if you need less than a few meters you need high-end precise positioning. There are various other options available, but all of them require buying hardware.
    – Tom Hunt
    Nov 17, 2015 at 0:19
  • 2
    Or possibly get at the accelerometer, if there is one: stackoverflow.com/questions/2939685/…
    – thrig
    Nov 17, 2015 at 0:24
  • 3
    An accelerometer (which are fairly common in tablets and phones but not in laptops) would be much more sensitive than GPS...and would be able to detect when a laptop is picked up and put back in the same place. It would also detect when a clumsy cat jumps on the laptop. google for USB accelerometer. BTW, with some smart scripting you could use motion detected by an accelerometer to trigger taking a picture with the web cam.
    – cas
    Nov 17, 2015 at 0:24
  • 1
    here's one with a micro-USB interface for about $8 USD. ebay.com.au/itm/… - it's just a circuit board so you'd want to seal it up with silicone or something. i'm surprised at how hard it was to find a cheap USB model. lots of expensive stuff for industrial computing applications. quite a lot of Arduino etc stuff. very few cheap USB models that you can just plug in to a laptop or desktop.
    – cas
    Nov 17, 2015 at 0:39
  • hmmm.....yeah, I saw a couple of $100+ USD ones, but no real cheap ones. I'm currently trying to find the smallest microcontroller I can to plug up to an accelerometer!
    – evamvid
    Nov 17, 2015 at 1:36

1 Answer 1


See https://www.kernel.org/doc/Documentation/misc-devices/lis3lv02d.

The DV7 should have the mentioned accelerometer. I can't come up with a specific implementation but the Thinkpad community came up with some ideas for their model (with a different driver).

Just as a starter: http://www.thinkwiki.org/wiki/Script_for_theft_alarm_using_HDAPS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .