first things first:
$ echo 'alias bt="bluetoothctl"' >> ~/.zshrc
turn bluetooth on, scan for devices:
$ bt power on
$ bt scan on
Discovery started
[CHG] Controller A4:42:3B:0B:7B:14 Discovering: yes
[NEW] Device 00:0A:45:0B:3B:9E ATH-M50xBT
[NEW] Device 70:7E:09:5D:6C:5E 70-7E-09-5D-6C-5E
[NEW] Device 67:4E:26:6A:61:85 67-4E-26-6A-61-85
[NEW] Device 9C:95:6E:DA:43:AF 9C-95-6E-DA-43-AF
[CHG] Device 00:0A:45:0B:3B:9E Name: BLE_ATH-M50xBT
[CHG] Device 00:0A:45:0B:3B:9E Alias: BLE_ATH-M50xBT
...
pay attention to [NEW]
sections, look for your device name, such as a headphones of mine: [NEW] Device 00:0A:45:0B:3B:9E ATH-M50xBT
.
make sure to put device in the pair mode, otherwise you'll be able to pair but not connect, which is kinda weird.
then, pair and connect:
bt pair 00:0A:45:0B:3B:9E
bt trust 00:0A:45:0B:3B:9E
bt connect 00:0A:45:0B:3B:9E
now you should hear a sound from a headphones/speaker, able to type on a bluetooth keyboard, and so on.
usually, you'll use bt connect <mac>
and bt disconnect <mac>
commands to attach/detach devices when needed.
to re-pair the device, delete it first, then repeat the pair-trust-connect sequence:
bt remove 00:0A:45:0B:3B:9E
# make sure to put device in the pairing mode!
bt pair 00:0A:45:0B:3B:9E
bt trust 00:0A:45:0B:3B:9E
bt connect 00:0A:45:0B:3B:9E
bt info
is also useful:
$ bt info 00:0A:45:0B:3B:9E
Device 00:0A:45:0B:3B:9E (public)
Name: BLE_ATH-M50xBT
Alias: BLE_ATH-M50xBT
Class: 0x00240418
Icon: audio-headphones
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
WakeAllowed: no
LegacyPairing: no
...
UPD1: if you jump between devices a lot, or often on the go, consider creating a shell alias to quickly connect to your headphones when you open a laptop in a cafe.
if you use Ulauncher, take a look at the Bluetooth-quick-connect plugin, it works well.
UPD2: and i have to admit that, yey, finally, it's 2025, and we can just use consumer-grade bluetooth devices with linux desktops, relatively painless.