testei no ubuntu 18.04 3 funcionou
BlueProximity is an app that lets you quickly lock and unlock your Linux laptop or PC using a Bluetooth device, like a smartphone or tablet.
You set a device, the proximity at which to lock/unlock, and carry on as normal.
When your phone goes out of range of your laptop or PC for a configurable amount of time your session locks. When you’re back within range it unlocks.
All seamless. All automatic. No need to enter a password or wiggle a cursor.
Is it security prudent? Heck no! But security isn’t the selling point here. It’s all about convenience.
Consider this app a curio, an interesting thing to play around with, rather than a viable, predictable or (even) sensible unlocking mechanism.
BlueProximity is an old, old app. So old that Ubuntu’s choice of lock screen tech — *waves at Unity Greeter* — has fast superseded it. This means BlueProximity does not work with the Unity desktop.
It does, however, work just dandy with Ubuntu GNOME, which is what I have used to test the app as described in the rest of this guide.
Using it with other Linux distributions, flavours, desktops may vary.
Install & Configure BlueProximity on Ubuntu 16.04 LTS
The first thing you need to do before installing any additional apps is to pair your phone or tablet with your Ubuntu laptop or PC.
You don’t need anything special here, just remember to make sure that your phone/tablet is visible before you try connecting to it. It is crazy how many people forget to do this step!
Open up GNOME Control Center, head to Bluetooth, and click on the name of the device you want to use. Follow the on-screen prompts for the rest.
The next step is to install the BlueProximity app.
Thankfully this is easy; the app is available to install from the Ubuntu repos in both Ubuntu 14.04 and Ubuntu 16.04 LTS. To fetch it via the command line run:
sudo apt-get install blueproximity
That’s it. You’re done.
Now comes the headache-inducing section.
Because BleuProximity is an old app its system tray applet is no longer supported by modern desktop environments. You can get it to show up, however, by using a third-party patch.
Whilst you can skip this, if you do you won’t be able to reconfigure the app using the GUI without deleting your entire config file and starting over. And that’s even more hassle.
If you’d rather have access to the BlueProximity indicator (and I think you would) you need to run the following commands in a new terminal.
The first command grabs the indicator patch…
…And the second applies it to BlueProximity:
sudo patch /usr/share/blueproximity/proximity.py < proximity.patch
With your smartphone or tablet already paired with your GNOME desktop you can go ahead and launch BlueProximity from the GNOME Activities Overlay.
You’ll see a tray item appear (in the lower left if you’re not using the Top Icons extensions) and, the first time you run it, a configuration window will open:
Here’s where things start to get a little YMMV.
First: click the ‘Scan for Devices’ button.
This should (hopefully) list connected Bluetooth devices. Select your smartphone/tablet and click ‘Use selected device’. This will auto-fill the MAC address box with the device’s pertinent info.
Next, head into the next tab titled “Proximity Details”.
Here is where you set up how close your device has to be in (or out) of range to trigger the lock screen.
- The distance (within which the app will trigger an action) is in metres.
- The duration (the time in which the app monitors the range) in seconds.
‘Measured atm’ lets you see a live, auto-updating gauge on how close your configured device currently is (again in metres). If this line is maxed out at 255 it means something has gone wrong and you need to skim back a few steps and reconnect.
It should go without saying (but I’ll say it anyway) that the “locking distance’ must be greater than the unlocking distance.
As I work from a coffee shop I chose something nice and intimate: a radius of 5 metres (when my device goes past this my computer locks). To unlock I simply need to move my device to within 2 metres of my laptop.
When set, close the preferences window entirely and test it out by taking your authorised device and moving beyond your set distance for the set duration.
The screen will lock.
Now move back towards your device, again making sure that you’re within the correct distance for the correct duration, et voila: the screen will unlock.
‘Sorry, the bluetooth device is busy connecting…’ Error
If you also see an error reading ‘Sorry, the bluetooth device is busy connecting…‘ don’t fret: you can still set things up. You have to go the long way around and manually enter the MAC address of the device and find an active/open RFCOMM Channel.
That’s all there is to it.
A few notes:
- You can pause proximity locking from the system tray applet, though its icon makes it hard to tell the state
- BlueProximity needs to be running for the feature to work, so remember to open it before you walk away
- If you phone’s battery dies while the screen is locked you’re stuffed…
- …Only kidding. You can always log in using your password.