Finding Your Phone, the Linux Way

If you have a Nokia N900, you can set it up so that it helps you find it the next time you lose it. The methods shown here, with modifications, can be used on other Linux phones as well.

I decided it would make the most sense to watch for three different actions:

  • The phone changing networks.

  • The keyboard being opened or closed.

  • Low power.

If the network changes, that probably means the phone is on the move (maybe I left it in a car). If the keyboard is opened or closed, someone is using or looking at the phone. Finally, if the phone is just sitting there, eventually the batteries will drain away (and I'd like to find the phone before all power is gone).

The three lines in dbus-scripts-settings that watch for those actions are the following:

/home/user/ * * * * * CONNECTED
/home/user/ * * org.freedesktop.Hal.Device \
                           Condition ButtonPressed cover
/home/user/ * * battery_low

The script is called each time one of those events occurs. The dbus-scripts Wiki page ( has more information on formatting the configuration lines.

See the script (Listing 1) for details of what it does. One thing I found in testing is that some of the commands I can run on the command line do not work at all when called from a script by the dbus-scripts dæmon. These include the mplayer command and setting the phone to nonsilent mode. Thankfully, other commands work fine when called from the script.

The final piece of the puzzle was getting the N900 to send at least some of the data it gathered to another phone via SMS. I found a good Python script for sending SMS messages at

With the SMS script in place and called by the script, all I have to do is create the special file on my Web server, and suddenly my N900 starts sending my designated backup phone (my wife's cell phone) SMS messages whenever one of the events I configured happens.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

how about an Andriod way?

Boo's picture

how about an Andriod way?