Module i3status_rs::blocks::bluetooth

source ·
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

KeyValuesDefault
macMAC address of the Bluetooth deviceRequired
adapter_macMAC Address of the Bluetooth adapter (in case your device was connected to multiple currently available adapters)None
formatA string to customise the output of this block. See below for available placeholders." $icon $name{ $percentage|} "
disconnected_formatA string to customise the output of this block. See below for available placeholders." $icon{ $name|} "
battery_stateA mapping from battery percentage to block’s state (color). See example below.0..15 -> critical, 16..30 -> warning, 31..60 -> info, 61..100 -> good
PlaceholderValueTypeUnit
iconIcon based on what type of device is connectedIcon-
nameDevice’s nameText-
percentageDevice’s battery level (may be absent if the device is not supported)Number%
battery_iconBattery icon (may be absent if the device is not supported)Icon-
availablePresent if the device is availableFlag-
ActionDefault button
toggleRight

§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

Structs§

Functions§