Giter Club home page Giter Club logo

blueproximity's Introduction


BlueProximity

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.

Python Version Download from

Note from the maintainer of this fork

This current version (1.3.3) only upgraded the original code to make it run in Python 3 / GTK+ 3. I have respected the original work from Lars Friedrichs as much as possible. In the future, if there's interest on this software I might continue developing it under a new name. Just let me know :-)

Description from the original author

If you move away from your computer and the distance is above a certain level 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).

See the doc/ directory or the website which both contain a manual with screenshots.

Please note that there might still some bugs, use the sourceforge site to keep track of them or tell me about new ones not mentioned there. Please read the whole manual - it's short enough, hopefully easy understandable and hey - it even got some pretty pictures in there too :-)

Installation

Note from the maintainer of this fork (RGM):

For the moment, this application hasn't been packaged for installation as a .deb or .rpm. If you know how to do it, please reach out and I'll include such packages!

Arch Linux Package (maintained by: Laurent OF Fough)

Installation via yay|trizen, etc: (* Package is marked as conflicting with the Python2 version, to avoid having both installed)

  • $ yay -S blueproximity-py3-git

Development setup

Create a virtual environment for Python 3.8 and install the required libraries using the requirements.txt file.

cd my-blueproximity-project/
virtualenv --python=python3.8 venvs/venv3.8
source venvs/venv3.8/bin/activate
pip3 install -r requirements.txt

Configuration

Note from the 'maintainer' of this fork (RGM):

The only important configuration for this version is to set the correct path where the software will be installed. If you download this software and you run it as a local user from a folder in your home directory, then you don't have to change anything. But if you're creating an installation package for a distribution, please take care of setting the right path in the variable dist_path that you will find at the beginning of the proximity.py script.

Release History

  • 1.3.3 Bug fixes
  • 1.3.2 Fixed README.md (this file) mistake
  • 1.3.1 Bug fix
  • 1.3.0 Updated application so it now runs in Python 3 and GTK+ 3

About the maintainer of this fork

Rodrigo Gambra โ€“ @TiktaalikDev โ€“ [email protected]

License

Distributed under the GPL v.2 license. See COPYING for more information.

 Blueproximity - Desktop application to lock/unlock your screen automatically based on detecting
                 how close it's another Bluetooth device (e.g. your mobile phone).

 Copyright (C) 2007 Lars Friedrichs <[email protected]>

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <https://www.gnu.org/licenses/>.

https://github.com/tiktaalik-dev/blueproximity/

Contributing

  1. Fork it (https://github.com/tiktaalik-dev/blueproximity/)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Acknowledgements

Here's a list on contributors to the source:

  1. Lars Friedrichs (Author)
  2. Tobias Jakobs (GUI optimizations)
  3. Zsolt Mazolt (GUI and KDE stuff)
  4. Rodrigo Gambra-Middleton (Upgrade to run in Python3 and GTK+ 3. Maintainer of this fork)
  5. Dan Bader for providing a free README.md template for this documentation. See https://dbader.org/blog/write-a-great-readme-for-your-github-project

blueproximity's People

Contributors

kuczera avatar laurentfough avatar stuartlangridge avatar tiktaalik-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blueproximity's Issues

Will it work when the phone screen locks

The original blueproximity was not working when the phone screen is locked (OnePlus 5 and Linux Mint 19.3 ). When the phone screen locks, it's not able to determine the distance which locks the computer also. So I was not able to use it b'cos when I was working all of sudden the laptop gets locked. Is this fixed in this new version? Also any plans for supporting BLE devices like MiBand. It'll be a great value addition. I'm sure there are lot of takers for this.

Last question? How to install this in Linux Mint 20? Should I just copy the scripts and run?

Kind: bug. Cannot create new configuration.

Traceback (most recent call last):
  File "/home/alexgluck/files/git_repos/private/blueproximity/proximity.py", line 434, in dlgNewDo_clicked
    newconfig = self.wTree.get_widget("entryNewName").get_text()
AttributeError: 'Builder' object has no attribute 'get_widget'

OS: Fedora 33 Workstation, python 3.9.1

Step to reproduce:

  1. Run /usr/bin/python3.9 proximity.py
  2. Press "Create" button
  3. Write "asdasdasd"
  4. Press "Create" button in dialog form

Installation and requirements for fedora 33:

sudo dnf install -y bluez-libs-devel python3-gobject python3-gobject-base xapps python3-xapp python3-bluez python3-configobj
git clone $BLUEPROXIMITY_REPO folder ; cd folder ; /usr/bin/python3 proximity.py

No icon on GNOME Shell with AppIndicators extension installed

I'm trying to use your BlueProximity fork on Ubuntu 20.04 with GNOME Shell (which has the AppIndicator / KStatusNotifier extension installed), but the GUI only runs the first time. Subsequent runs don't show the BlueProximity GUI and since there's also no tray icon showing up, it can't be used properly.

Application does not measure distance/unable to work properly

Hi,

I am using your updated version since September 2021 on my ubuntu 20.04 and it worked quite good.
Now i have switched to fedora 35, and installed the app with version 1.3.3, copied the configuration from the previous installation and the app will not work the same way as on the previous installation.

[sp@spyros-thinkpad ~]$ python --version
Python 3.10.1

The distance bar is not changing, stuck at 255 (max left). Icon is "disconnected".

Steps that I did:

  1. Pair the phone
  2. Open first time the application
  3. Edit the config file with the settings from the previous working OS
  4. restart application

After quite a while of testing, switching channels, testing the scan mode, nothing worked. I even went on the debug mode to see if there was a problem on the python script, but I do not have the time to decypher the code and find the bug.

I will post my config file so you can have a look. I have removed the last 4 characters from my phones mac address.

device_mac = D0:9C:7A:D5:XX:XX
device_channel = 12
lock_distance = 8
lock_duration = 12
unlock_distance = 6
unlock_duration = 3
lock_command = 'xdg-screensaver lock && sleep 1 && xset dpms force off && pb push -d 1 "Screen locked at $(date +%H:%M:%S) on $(date +%d/%m/%Y)"'
unlock_command = pb push -d 1 "Screen unlocked at $(date +%H:%M:%S) on $(date +%m/%d/%Y)" && xdg-screensaver reset && xset dpms force on
proximity_command = xset dpms force on
proximity_interval = 89
buffer_size = 1
log_to_syslog = True
log_syslog_facility = local7
log_to_file = True
log_filelog_filename = /home/sp/blueproximity.log

Error when clicking on use selected device

Traceback (most recent call last):
File "proximity.py", line 830, in btnSelect_clicked
self.wTree.get_widget("entryMAC").set_text(mac)
AttributeError: 'Builder' object has no attribute 'get_widget'

starting blueproxility create a loop of connect/disconnect on my device

when I start blueproximity (version 1.3.3) the app load correctly, install in task bar ( I have installed snixembed from https://git.sr.ht/~steef/snixembed for some other use and it works well for the taskbar)

but then, as soon as I activate the bluetooth, there is a loop of connect/disconnect of my phone (samsung).
So I got constant notifications, every seconds, of connect, then disconnect.
This is very annoying, and it populate the screen of notifications.
Moreover, it do not list my devices in the know or discovered devices.

I have then removed my device from the knows devices, so it not connect/disconnect loop, but blueproximity still not able to discover the device. even if I put the MAC address on the "MAC address" field
If I re-associate my device with my computer Blueproximity can then discover it, but it start looping again in a connect/disconnect state.

So in that state I can not use Blueproximity.

Flashing icon in notification area

I'm getting a flashing (shows then disappears) matching the interval set here:

glib.timeout_add(500, self.updateState)

I'm getting

(proximity.py:3367389): Gdk-CRITICAL **: 13:42:33.029: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

at the same time.

Adding some tracing to updateState - the alert for gdk is not happening until a delay AFTER the updateState runs, but that may be due to event loop handling.

Any ideas?

Unlock screen after standby

Is there a way to use blueproximity to unlock my screen after the computer wakes from standby? It seems that the unlock isn't working if my phone is already present when the computer wakes from standby. However, if I briefly leave and return with my phone, then the screen gets unlocked.

So it seems as if the program is still working, however, for some reason the unlock command isn't issued when the phone is first detected.

No interface

Hi @tiktaalik-dev,

Super silly issue to have, but I can't work it out.

  • "python3 proximity.py" runs but does not launch a window to use the application.....

Output from terminal:-
" Using config file 'standard.conf'.
<_io.TextIOWrapper name='/home/gareth/blueproximity.log' mode='a' encoding='UTF-8'>"

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.