Files
btle-proximity/config.toml.example
T
Bastian Mäuser b4e51a58f6 Explain locks with a desktop notification after unlock
After locking, wait for the session to come back (logind Unlock,
ScreenSaver ActiveChanged, or a new session after re-login) and post a
notification saying the phone left Bluetooth range and how long ago.
On by default, off with unlock_notice = false. Hidden test-notice
subcommand exercises the path without a real lock.
2026-11-05 16:17:19 +01:00

52 lines
1.9 KiB
TOML

# MAC address of the paired phone to watch.
# Run `btle-proximity list-paired` to see candidates.
device_mac = "AA:BB:CC:DD:EE:FF"
# Bluetooth adapter to use, e.g. "hci0". First available if unset.
#adapter = "hci0"
# Lock the session after this long without strong evidence of presence.
# Before locking, the daemon additionally probes the phone with a 10s
# connection attempt, which cancels the lock if the phone answers.
# 30s is safe with the companion beacon app (android/): it advertises
# reliably from a foreground service and rotates its payload so the
# daemon always sees fresh evidence. Third-party beacon apps pause
# advertising while the phone sits still — with those, raise this to
# 120s or expect occasional false locks.
missing_after_secs = 30
# Advertisement updates newer than this count as "recently seen".
# Once updates stall past half of this, the radio steps up to the
# suspect duty cycle while the state stays Present.
presence_timeout_secs = 15
# Discovery only reports devices at or above this RSSI (dBm).
rssi_floor = -90
# At or below this RSSI the device counts as out of range (dBm).
rssi_lock = -80
# Scan duty cycle per state: radio on for window_ms, then rest until
# interval_ms has elapsed. window_ms/interval_ms is the radio duty cycle.
[duty.present]
window_ms = 100 # ~2% radio duty while the phone is around
interval_ms = 5000
[duty.suspect]
window_ms = 200 # aggressive probing while confirming absence
interval_ms = 1000
[duty.locked]
window_ms = 100 # rarely polling for the phone's return
interval_ms = 30000
# Optional: command to run instead of `loginctl lock-session`.
#lock_command = "swaylock -f"
# Optional: show a desktop notification after unlocking that explains the
# screen was locked because the phone left Bluetooth range.
#unlock_notice = true
# Optional: log lock actions instead of executing them (for testing).
#dry_run = false