Sep 20

Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity

Tag: linux,open source,software,ubuntuScott Wegner @ 10:29 am

A couple weeks ago I bought a bluetooth adapter for my computer in hopes that I could easily backup my cellphone contacts on my computer.  I haven’t yet found a program to sync my cellphone data, but I did find a program to use your phone to lock and unlock your screen when you leave and come back to your desk.  With BlueProximity, your cellphone acts as a wireless “key” to your desktop.

Here’s how it works: BlueProximity will use the bluetooth on your cellphone and computer to pair the two.  The bluetooth signal includes a crude “distance” between the two devices.  When your cellphone goes out of range (in your pocket), BlueProximity will automatically trigger your screensaver and can also lock your screen with a password.  BlueProximity keeps monitoring the distance, and when you come back within range, your computer automatically wakes up without ever having to enter a password.

BlueProximity is availible in the Ubuntu repositories, and is very easy to install and set up:

sudo aptitude install blueproximity

Before you run BlueProximity for the first time, make sure your Bluetooth is set up on your computer, and you have paired your cellphone with your desktop.  You can find general Bluetooth options under System > Preferences > Bluetooth.

When you’re ready to run BlueProximity, you can find it under Applications > Accessories > BlueProximity.  BlueProximity runs in the background, and displays a small icon in the taskbar to show its status.  Click on the icon to configure its settings.

In the “Bluetooth Device” tab, you can choose the cellphone or device to pair with and monitor.

  • If you don’t see your cellphone in the list, press “Scan for Devices”.  Make sure your cellphone’s bluetooth is on and discoverable.
  • When your device shows up, you can click on it and press “Use Selected Device”.
  • You can also select the “RFCOMM Channel”, although the default channel, 7, worked for me.  If you have trouble, you may try “Scan channels on device”.

In the next tab, “Proximity Details”, you set the distance and times to lock and unlock your computer.

  • The distance is a numeric value between 0-255 which is a rough range of how far your cellphone is from your computer.  It doesn’t correspond to any specific unit of measure, so you’ll need to test it out to get a feeling for it.
  • At the bottom of the tab, “Measured atm” displays the current distance, as well as the minimum and maximum distances that have been detected.  You can use this as a guide.
  • The duration corresponds to the number of seconds your cellphone needs to be outside of the distance before your computer will lock.  You may need to use some trial and error to find the right value.
  • The “Unlocking” options operate just like the “Locking” options, but opposite.  When your phone is detected within the specified distance for the complete duration, your computer will unlock.

The final preferences tab, “Locking”, controls how BlueProximity will lock and unlock your computer.  It has options for the exact commands which will be invoked, as well as logging options.  Basically, BlueProximity will call gnome-screensaver-command to control the screensaver– turning it on and off appropriately.  For this to work though, you will also need to set up a screensaver.

To check your screensaver settings, go to System > Preferences > Screensaver.

  • In the left pane, choose a screensaver to use.  I prefer ElectricSheep.
  • The option “Activate screensaver when computer is idle” doesn’t apply to BlueProximity, and BlueProximity will work even without it checked.  This refers to whether you want your screensaver to also turn on after a given period.
  • Similarly, the option “Lock screen when screensaver is active” refers to the normal screensaver timeout, and won’t affect BlueProximity.

Once you’ve got BlueProximity and your screensaver configured, everything should be ready to go!  Simply walk away from your computer and watch it automatically fade into your screensaver.  Walk back, and the desktop should automatically wake up.

It’s a pretty fun toy, although not the most useful.  However, for those like myself who tend to walk away from the computer without locking it, you can feel a little better when you have your cellphone in your pocket.

Share:
  • Digg
  • Facebook
  • Reddit
  • StumbleUpon
  • email
  • Twitter

12 Responses to “Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity”

  1. Tiago Faria says:

    Interesting tip! Bookmarked!

  2. Verrouiller votre ordinateur sous Ubuntu avec un téléphone bluetooth | Korben says:

    [...] un tuto assez original que j’ai trouvé chez Automaticable. Il s’agit de verrouiller/ déverrouiller son ordinateur sous Ubuntu avec du [...]

  3. Chris Bauer says:

    Nice article. I use BitPim to sync contacts, photos, ringtones, and mp3s with my phone via a usb cable. I believe BitPim works with bluetooth too, and it’s in the repos!

  4. Scott Wegner says:

    I tried out BitPim, but it seems that Nokia phones are just about completely unsupported. I’ve started using Wammu (frontend to Gammu), and am fairly happy with it. (Check back for a review within the next week or so!)

  5. Stacy says:
  6. KH says:

    Scooter,
    This is pretty cool. I never really thought about making my computer act differently when my phone is close to it. Is there any way you can think of to extend this link? For example, would there be any way to receive text messages through my AIM client when I’m on my computer? Maybe change my AIM status when I step away from the computer before locking it? Just throwing some ideas out there…
    -K

  7. Scott Wegner says:

    @KH: It does seem like there’s a lot of potential here. The idea about texting through AIM sounds like it would take some pretty tight integration with your cellphone and AIM; it would be cool, but I haven’t heard of anything like it before. However, it would be possible to set up some more tasks for when you come in and out of range of your computer. Because BlueProximity’s “Locking” options allow you to specify any command, just about anything is do-able. You could write a shell script which will take care of other syncing tasks before it calls gnome-screensaver-command. For example, how about syncing your cellphone contacts or Evolution calendar every time you come back to your computer?

    I also looked into setting your AIM status, and it’s also very possible. You need to install “libpurple-bin” for the purple-remote utility. Then you could write a shell script like this:

    #!/bin/bash
    # If pidgin's running, stop it
    ps ax | grep -q pidgin
    if [ $? -eq 0 ]; then
        pidgin-remote "setstatus?status=away&message=I've stepped away"
    fi
    
    # Then control gnome-screensaver
    gnome-screensaver-command -l

    Save this file somewhere (make sure it’s executable, “chmod u+x [thefile]“), and set it as the locking command.

  8. Konstantin says:

    Спасибо классная статья ;)

  9. sylvia payze says:

    HELP. I have noticed a open lock icon which flickers on the left side of cellphone screen momemtarily when I send an sms to certain numbers on my contact
    The open lock/closed lock icon in the Nokia booklet says it has “something to do with data packages. Yet I am
    not sending data, only regular sms’s. Is there any way you can help me to find out to which exact IP address this open
    lock data package is being diverted, as it seems my phone is being monitored. The icon is an open lock which flickers
    for a slpit second during transmission of a sms. No one else I know has seen thier phone doing this,

  10. Scott Wegner says:

    Hi Sylvia,

    Sorry to hear you’re having trouble with BlueProximity. Although I’m a very happy user, I’m not actually involved with the BlueProximity project. There are a number of places you may consider asking though:

    BlueProximity Support Forums
    Report a bug in Launchpad
    Ask in the UbuntuForums discussions

    Each of these resources should have very helpful and more informed people ready to take a look at the problem you describe. I recommend you try each of those first.

  11. Hello 2009 and New Years Resolutions | automaticable says:

    [...] Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity [...]

  12. Alte chestii utile prin GNOME « Blogu' lu' Yeti says:

    [...] câteva zile am descoperit un progrămel, blueproximity, a cărui utilitate este discutabilă, dar al cărui factor de coolness nu este. blueproximity [...]

Leave a Reply