Skip to content

Browse Bluetooth Devices

mcdbus provides a bluetooth_devices shortcut tool that reads from bluez on the system bus. It uses the ObjectManager interface to get all known Bluetooth devices in a single call, then formats them into a sorted table.

“What Bluetooth devices are nearby?”

bluetooth_devices()

The tool returns a table sorted with connected devices first, then paired devices, then everything else alphabetically:

## Bluetooth Devices -- 5 found
| Name | Address | Connected | Paired | Trusted |
|------|---------|-----------|--------|---------|
| WH-1000XM4 | 38:18:4C:XX:XX:XX | yes | yes | yes |
| Keyboard K380 | 34:88:5D:XX:XX:XX | yes | yes | yes |
| Galaxy Buds2 | A0:C5:F2:XX:XX:XX | no | yes | yes |
| iPhone | 7C:04:D0:XX:XX:XX | no | no | no |
| [unknown] | 48:A4:93:XX:XX:XX | no | no | no |

The tool calls org.freedesktop.DBus.ObjectManager.GetManagedObjects on org.bluez at the root path /. This returns every managed object in the bluez hierarchy. The tool filters for objects that have the org.bluez.Device1 interface and extracts:

ColumnSource propertyNotes
NameName or AliasFalls back to “Unknown” if neither is set
AddressAddressBluetooth MAC address
ConnectedConnectedBoolean — active link to this device
PairedPairedBoolean — bonding keys exchanged
TrustedTrustedBoolean — auto-connect permitted

Each Bluetooth device has an object path under /org/bluez/hci0/ (or whichever adapter is active). The path encodes the MAC address with underscores replacing colons:

/org/bluez/hci0/dev_38_18_4C_XX_XX_XX

To read all properties on a specific device:

“Tell me everything about my WH-1000XM4 headphones.”

get_all_properties(
bus="system",
service="org.bluez",
object_path="/org/bluez/hci0/dev_38_18_4C_XX_XX_XX",
interface="org.bluez.Device1"
)

This returns additional properties beyond what the shortcut tool shows:

PropertyWhat it contains
RSSISignal strength in dBm (only present during discovery)
AppearanceGAP appearance value indicating device category
IconIcon hint string (e.g., “audio-headphones”, “input-keyboard”)
AdapterObject path of the Bluetooth adapter this device was seen by
ServicesResolvedWhether service discovery has completed
UUIDsList of Bluetooth service UUIDs the device advertises
ModaliasUSB-style modalias string for driver matching

Some Bluetooth devices report their battery level through the org.bluez.Battery1 interface. To check:

get_all_properties(
bus="system",
service="org.bluez",
object_path="/org/bluez/hci0/dev_38_18_4C_XX_XX_XX",
interface="org.bluez.Battery1"
)

If the device supports it, this returns a Percentage property (0-100). Not all devices report battery level over Bluetooth — it depends on the device firmware and profile support.

The Bluetooth adapter itself (typically hci0) has its own set of properties at /org/bluez/hci0:

get_all_properties(
bus="system",
service="org.bluez",
object_path="/org/bluez/hci0",
interface="org.bluez.Adapter1"
)

This shows the adapter’s name, MAC address, power state, discoverability, and supported features.

If you are unsure of the exact object path for a device, walk the bluez object tree:

list_objects(bus="system", service="org.bluez")

This returns paths like:

/org/bluez
/org/bluez/hci0
/org/bluez/hci0/dev_38_18_4C_XX_XX_XX
/org/bluez/hci0/dev_34_88_5D_XX_XX_XX

Each dev_ path corresponds to a known device. The MAC address in the path matches the Address property with colons replaced by underscores.