On Ubuntu, Debian, Arch, Fedora and others, Bluetooth headsets sometimes drop to HFP/HSP hands-free mode.
fbt.sh
simply reconnects the device with one command. This is often enough to make the desktop switch back to A2DP automatically. Zsh tab completion lets you pick the headset by name.
- One-shot reconnect, no profile forcing
- Works with PipeWire and PulseAudio
- Installs to
~/.local/bin
by default, no root - Zsh completion for Bluetooth device names
- Self-update and uninstall options
- bluetoothctl (BlueZ package, usually pre-installed)
- zsh for running the script and completion
- Standard CLI tools: grep, awk, sed, curl
zsh -i <(curl -fsSL https://gist.githubusercontent.com/enoy19/933582120e7782cadbad54100dbcf419/raw/install_fbt.sh)
Follow the prompts, then source ~/.zshrc
or start a new shell.
You can configure WirePlumber, PipeWire, PulseAudio or udev rules to force A2DP every time.
Those setups are great if the bug happens daily. If it is only occasional, they are overkill.
This script is overkill too, but typing fbt <device>
is still easier than writing rules.