btd - a small Bluetooth manager for BlueZ and PipeWire
For years and years I've used blueman to manage Bluetooth. It's a powerful and feature-rich program, it does a lot, but I only ever needed a few things from it: connect my headphones, have the music play from them, and reconnect them when they drop. After some deliberation I decided that running such a complicated piece of software to manage just that is overkill. So, an opportunity presented itself - dust off my Rust skills, fire up an LLM and code a simple custom tool for myself.

btd is a daemon and command-line tool. It's small in scope: it doesn't replace bluetoothd, and BlueZ still does the actual Bluetooth work. btd replaces blueman and bluetoothctl on top of it:
- Audio follows the newest headset. When a Bluetooth headset connects, btd makes it the default output in PipeWire and moves everything that's playing to it.
- The last used headset reconnects on its own when it drops, retrying with increasing delays. Only that one, so two headsets never compete for the audio.
- Pairing is one command.
btd pairfinds the headset in pairing mode, pairs it, trusts it and connects it. Outside ofbtd pair, nothing can pair with the computer. - Devices are numbered, so
btd connect 2orbtd disconnectis enough - no need to copy MAC addresses. - A rofi menu bound to a key, for when I don't have a terminal open. Results show up as desktop notifications.

It talks to BlueZ over D-Bus using zbus and to PipeWire directly. The command-line tool talks to the daemon over Varlink.
You can find it on my GitHub page: https://github.com/HallowDance/btd
There's a prebuilt binary and a PKGBUILD for Arch-based distros. It's very new and so far I've only tested it on my own computer, so it isn't on the AUR yet. I'll put it there once it has seen a few weeks of daily use.
P.S. btd is GPL-3.0 and was written with the help of Claude.