A small Bluetooth manager for Sway and wlroots-based desktops, using a
wofi popup interface.
bluwofi communicates directly with BlueZ over D-Bus through the
bluer Rust crate. It does not require a
GTK Bluetooth applet or a full desktop environment.
wofibased Bluetooth management menu- Direct BlueZ D-Bus communication
- Connect, disconnect, pair, and remove devices
- Device discovery from the menu
- Optional desktop notifications
- Waybar status integration
- Background auto-reconnect daemon
- Small TOML configuration file
bluetoothdrunning:
systemctl status bluetoothwofiinstalled and available in$PATHnotify-send(optional, provided bylibnotifyor a notification daemon such asmako)- Rust toolchain (
rustup) make
Clone the repository:
git clone https://github.com/CtxtArc/bluwofi.git
cd bluwofiBuild and install:
make
sudo make installBy default, files are installed to:
/usr/local/bin
/usr/local/lib/systemd/user
You can change the installation prefix:
sudo make install PREFIX=/usrFor package maintainers, DESTDIR is supported:
make install DESTDIR=/tmp/packageThe installed binaries are:
bluwofi
bluetooth-reconnectd
If you only want to build without installing:
cargo build --releaseThe binaries will be located at:
target/release/bluwofi
target/release/bluetooth-reconnectd
Remove installed files:
sudo make uninstallOptional configuration file:
~/.config/bluwofi/config.toml
All fields are optional. Missing values use the defaults below:
# How long a manual "Scan for devices" stays open, in seconds.
scan_duration_secs = 5
# After manually disconnecting a device, how long the reconnect daemon
# waits before trying again.
reconnect_cooldown_secs = 120
# Interval between reconnect daemon scans.
daemon_poll_interval_secs = 20
# Timeout for individual connection attempts.
daemon_connect_timeout_secs = 8Both bluwofi and bluetooth-reconnectd read the same configuration file.
Run the menu:
bluwofiThe main menu provides:
- Bluetooth adapter power toggle
- Device scanning
- Known devices sorted with connected devices first
Selecting a device opens available actions:
- Connect
- Disconnect
- Pair & Connect
- Remove
Notifications are shown for connection, disconnection, pairing, and errors.
Disable notifications with:
bluwofi --no-notifyAdd a key binding to:
~/.config/sway/config
Example:
bindsym $mod+b exec bluwofiWithout notifications:
bindsym $mod+b exec bluwofi --no-notifybluwofi can output a JSON status line:
bluwofi --statusExample:
{
"text": "\uf293 AirPods Pro",
"tooltip": "AirPods Pro (82%)",
"class": "connected"
}The Bluetooth icons use Font Awesome glyphs. A Nerd Font or Font Awesome font is required for them to display correctly.
Add a module to your Waybar configuration:
Then add:
"custom/bluetooth"to one of:
modules-leftmodules-centermodules-right
The project includes a second binary:
bluetooth-reconnectd
The daemon periodically checks for devices that are:
- paired
- trusted
- currently disconnected
and attempts to reconnect them.
Run it manually:
bluetooth-reconnectdDisconnecting a device from the bluwofi menu creates a cooldown marker.
During this cooldown period, the daemon will not attempt to reconnect that device.
This prevents reconnecting something that was intentionally disconnected.
Disconnects caused by devices leaving range or powering off are not treated as manual disconnects.
A service file is included:
systemd/bluetooth-reconnectd.service
Enable it:
systemctl --user daemon-reload
systemctl --user enable --now bluetooth-reconnectdCheck its status:
systemctl --user status bluetooth-reconnectdFollow logs:
journalctl --user -u bluetooth-reconnectd -fSome possible future additions:
- Per-device-type icons (headphones, mouse, phone, etc.)
- Better battery reporting
- Audio profile switching
- More device filtering options
- Additional configuration options
