How to connect airpods on Ubuntu OS

auther: It’s quite eazy , but I forget to push the setup button while connecting to PC , which makes me confused for a afternoon LOL …

UI interface

Hint: Make sure push the setup button on the back of charging case until the status light flash white !

1. open bluetooth setting on your laptop

2. make sure status light flash white while connecting airpods

3. connect your airpods!

ui-result

Command line

As an Linux user , using UI interface

to connect bluetooth devices is unacceptable (IJK 😂

Overall , connecting airpods in command line is coooool !!! 😎

bluez

BlueZ is the official Linux Bluetooth stack. It provides, in it’s modular way, support for the core Bluetooth layers and protocols.

install bluez on Ubuntu

sudo apt install bluez 

using bluetoothctl to manage bluetooth devices

run bluetoothctl in terminal

bluetoothctl

result :

terminal-result

Ask what it can do ! 👉 Run help command

terminal-help

To connect our headset , we need to first scan all the devices nearby , find our device ,pair the headset and PC, and connect it.

Note: the [dev] below means the MAC address of device

MAC address :

MAC address of my headset is 4C:B9:10:47:C4:DD , MAC address of your device might in form of XX:XX:XX:XX:XX:XX . Every device has a unique MAC (Hovever , you can change it through software )

command:

  • exit It’s essential to know how to quit (especially in Vim 😈 )

  • deivices List available devices

  • pair [dev] Pair with device

  • paired-deivces List paired devices

  • connect [dev] Connect device

  • disconnect [dev] Disconnect device

connect airpods through command line : final-result

enjoy your music 🎧

recommended song : 1.5 hr study lofi

reference

https://www.makeuseof.com/manage-bluetooth-linux-with-bluetoothctl/ https://ubuntu.com/core/docs/bluez/install-configure/install https://unix.stackexchange.com/questions/96693/connect-to-a-bluetooth-device-via-terminal