Skip to content

SolverNA/bt-lock-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bt-lock-guard

Locks your KDE screen when your Bluetooth device (phone/watch) leaves range. Shows a system tray icon with real-time signal graph, toggle switch, and threshold slider.

Phone moves away β†’ RSSI drops below threshold
        ↓
bt-lock-daemon detects N consecutive misses
        ↓
Screen locks (qdbus / loginctl)
        ↓
Phone returns β†’ unlock β†’ grace period β†’ monitoring resumes

Features

  • System tray icon (near Wi-Fi/clock in KDE panel)
  • Click β†’ popup with:
    • Toggle switch β€” enable / disable guard instantly
    • Threshold slider β€” set lock distance (-100 to -30 dBm)
    • Real-time RSSI graph β€” 60-second history with dBm values
  • Per-session config β€” changes take effect immediately
  • Grace period after unlock (lets Bluetooth reconnect before re-arming)
  • Works with any Bluetooth device: phone, watch, tag

Install

One-liner (Arch/Manjaro, Debian/Ubuntu/Kali, Fedora)

curl -fsSL https://raw.githubusercontent.com/SolVerNA/bt-lock-guard/master/install.sh | sudo bash

The installer:

  1. Detects your package manager and installs dependencies
  2. Scans for nearby Bluetooth devices and shows a numbered list
  3. You pick your phone/watch by number β€” no manual MAC entry needed
  4. Starts the daemon and tray automatically

From source

git clone https://github.com/SolVerNA/bt-lock-guard
cd bt-lock-guard
# Install files + start tray, then pick device from GUI:
sudo make install
# β€” or specify MAC directly:
sudo make install MAC=AA:BB:CC:DD:EE:FF

Arch Linux / Manjaro (manual)

sudo pacman -S bluez bluez-utils python-pyqt5 python-dbus
sudo systemctl enable --now bluetooth.service
git clone https://github.com/SolVerNA/bt-lock-guard
cd bt-lock-guard
sudo make install MAC=AA:BB:CC:DD:EE:FF

Debian / Ubuntu / Kali (manual)

sudo apt-get install bluez python3-pyqt5 python3-dbus
git clone https://github.com/SolVerNA/bt-lock-guard
cd bt-lock-guard
sudo make install MAC=AA:BB:CC:DD:EE:FF

Changing device from the tray

Click the tray icon β†’ "Scan & pick device" at the bottom of the popup.
The tray will scan for 8 seconds, show a list of nearby Bluetooth devices, and let you switch with one click β€” no reinstall needed.

Requirements

Package Arch / Manjaro Debian / Ubuntu
Bluetooth daemon + tools bluez bluez
l2ping, hcitool bluez-utils included in bluez
Qt5 tray UI python-pyqt5 python3-pyqt5
D-Bus bindings python-dbus python3-dbus
  • systemd + KDE Plasma (X11 or Wayland)

Threshold guide

dBm Distance (approx) Use case
-40 ~1m (same room) Very tight β€” desk only
-60 ~3–5m Same room
-70 ~5–10m Leave room
-80 ~10–15m Leave apartment
-90 ~20m+ Leave building

Start at -80 dBm and adjust using the live graph in the tray popup.

Logs

# Daemon
journalctl --user -u bt-lock-daemon@AA:BB:CC:DD:EE:FF -f

# Tray
journalctl --user -u bt-lock-tray -f

Uninstall

git clone https://github.com/SolVerNA/bt-lock-guard
cd bt-lock-guard
sudo make uninstall

Or if you already have the repo cloned:

sudo make uninstall

Config is kept at ~/.config/bt-lock-guard/config.json.

License

MIT β€” SolVerNA

About

πŸ”΅ Lock your KDE screen when your phone or watch leaves Bluetooth range. System tray with real-time RSSI graph, toggle switch, and threshold slider. Protects against physical access attacks.

Topics

Resources

License

Stars

Watchers

Forks

Contributors