Expand description
Monitor Bluetooth device
This block displays the connectivity of a given Bluetooth device and the battery level if this is supported. Relies on the Bluez D-Bus API.
When the device can be identified as an audio headset, a keyboard, joystick, or mouse, use the relevant icon. Otherwise, fall back on the generic Bluetooth symbol.
Right-clicking the block will attempt to connect (or disconnect) the device.
Note: battery level information is not reported for some devices. Enabling experimental
features of bluez
may fix it.
§Configuration
Key | Values | Default |
---|---|---|
mac | MAC address of the Bluetooth device | Required |
adapter_mac | MAC Address of the Bluetooth adapter (in case your device was connected to multiple currently available adapters) | None |
format | A string to customise the output of this block. See below for available placeholders. | " $icon $name{ $percentage|} " |
disconnected_format | A string to customise the output of this block. See below for available placeholders. | " $icon{ $name|} " |
battery_state | A mapping from battery percentage to block’s state (color). See example below. | 0..15 -> critical, 16..30 -> warning, 31..60 -> info, 61..100 -> good |
Placeholder | Value | Type | Unit |
---|---|---|---|
icon | Icon based on what type of device is connected | Icon | - |
name | Device’s name | Text | - |
percentage | Device’s battery level (may be absent if the device is not supported) | Number | % |
battery_icon | Battery icon (may be absent if the device is not supported) | Icon | - |
available | Present if the device is available | Flag | - |
Action | Default button |
---|---|
toggle | Right |
§Examples
This example just shows the icon when device is connected.
[[block]]
block = "bluetooth"
mac = "00:18:09:92:1B:BA"
disconnected_format = ""
format = " $icon "
[block.battery_state]
"0..20" = "critical"
"21..70" = "warning"
"71..100" = "good"
§Icons Used
headphones
for bluetooth devices identifying as “audio-card”, “audio-headset” or “audio-headphones”joystick
for bluetooth devices identifying as “input-gaming”keyboard
for bluetooth devices identifying as “input-keyboard”mouse
for bluetooth devices identifying as “input-mouse”bluetooth
for all other devices