Software Development with Linux

Automatically lock your screen when you leave with BlueProximity on Kubuntu 10 10

FRI, 01 APR 2011

To stay on the security topic (had to look at that a lot recently), here's how to install and use BlueProximity on Kubuntu 10.10.

But first of all, what is BlueProximity and what does it do?  From BlueProximity's website : "This software helps you add a little more security to your desktop. It does so by detecting one of your bluetooth devices, most likely your mobile phone, and keeping track of its distance. If you move away from your computer and the distance is above a certain level (no measurement in meters is possible) for a given time, it automatically locks your desktop (or starts any other shell command you want). Once away your computer awaits its master back - if you are nearer than a given level for a set time your computer unlocks magically without any interaction (or starts any other shell command you want)."

While I usually always lock my desktop when I leave my computer, BlueProximity will ensure that is it locked even if I forget it.  Since I sometime works from public places (coffee shop, etc.) or at friends houses, I don't want to leave the screen on when I'm not working on it.

But now, here is how to install and use it on Kubuntu 10.10 :

  1. Make sure that your computer's bluetooth adaptor is turned on.

  2. On my System76 panp4n laptop, I had to hit Fn-F12.
  3. Install BlueProximity.

  4. sudo apt-get install blueproximity
  5. Starts Applications > Settings > System Settings.

  6. Under Network Connectivity, click Bluetooth.

  7. Check Enable KDE Bluetooth integration.

  8. Pair your mobile phone with your computer.

  9. Things will vary depending on your mobile phone, but the general procedure is to make your computer's bluetooth adaptor visible to other and start a bluetooth discovery on your mobile phone. When (if) asked for, choose to have the pairing permanent.
  10. Start BlueProximity.

  11. Under Bluetooth device, click Scan for devices.

  12. Select your mobile phone.

  13. Click Use selected device.

  14. Under Proximity Details, configure as you see fit.

  15. Depends upon your physical environment and hardware.
  16. Change the Locking command for this one.

  17. qdbus org.kde.screensaver /ScreenSaver Lock
  18. Click on Close (otherwise it will stay in simulation mode).

And your done!  Now, whenever you leave your computer, it should get locked automatically.  You'll have to unlock it as usual once you came back.