Skip to content

Bluetooth

Displays the current bluetooth status. Clicking on the widget opens a popout displaying list of available devices and connection controls.

Screenshot of bluetooth widget

Configuration

Type: bluetooth

NameTypeDefaultDescription
format.not_foundstringFormat string to use for the widget button when bluetooth adapter not found.
format.disabledstring OffFormat string to use for the widget button when bluetooth adapter is disabled.
format.enabledstring OnFormat string to use for the widget button when bluetooth adapter is enabled but no devices are connected.
format.connectedstring {device_alias}Format string to use for the widget button when bluetooth adapter is enabled and a device is connected.
format.connected_batterystring {device_alias} • {device_battery_percent}%Format string to use for the widget button when bluetooth adapter is enabled, a device is connected and {device_battery_percent} is available.
popup.max_height.pixelsinteger330The maximum number of pixels the window can reach before scrolling. Leave blank to allow the popup to grow indefinitely.
popup.max_height.devicesintegernullSee popup.max_height.pixels, but the limit is set in number of devices. Specify either pixels or devices
popup.headerstring Enable BluetoothFormat string to use for the header of popup window.
popup.disabledstring{adapter_status}Format string to use for the message that is displayed when the adapter is not found or disabled.
popup.device.headerstring{device_alias}Format string to use for the header of device box.
popup.device.header_batterystring{device_alias}Format string to use for the header of device box when {device_battery_percent} is available.
popup.device.footerstring{device_status}Format string to use for the footer of device box.
popup.device.footer_batterystring{device_status} • Battery {device_battery_percent}%Format string to use for the footer of device box when {device_battery_percent} is available.
adapter_status.not_foundstringNo Bluetooth adapters foundThe value of {adapter_status} formatting token when adapter not found.
adapter_status.enabledstringBluetooth enabledThe value of {adapter_status} formatting token when adapter is enabled.
adapter_status.enablingstringEnabling Bluetooth...The value of {adapter_status} formatting token when adapter is enabling.
adapter_status.disabledstringBluetooth disabledThe value of {adapter_status} formatting token when adapter is disabled.
adapter_status.disablingstringDisabling Bluetooth...The value of {adapter_status} formatting token when adapter is disabling.
device_status.connectedstringConnectedThe value of {device_status} formatting token when device is connected.
device_status.connectingstringConnecting...The value of {device_status} formatting token when device is connecting.
device_status.disconnectedstringDisconnectThe value of {device_status} formatting token when device is disconnected.
device_status.disconnectingstringDisconnecting...The value of {device_status} formatting token when device is disconnecting.
icon_sizeinteger32Size to render icon at (image icons only).
JSON
{
"end": [
{
"type": "bluetooth",
"icon_size": 32,
"format": {
"not_found": "",
"disabled": " Off",
"enabled": " On",
"connected": " {device_alias}",
"connected_battery": " {device_alias} • {device_battery_percent}%"
},
"popup": {
"max_height": {
"devices": 5
},
"header": " Enable Bluetooth",
"disabled": "{adapter_status}",
"device": {
"header": "{device_alias}",
"header_battery": "{device_alias}",
"footer": "{device_status}",
"footer_battery": "{device_status} • Battery {device_battery_percent}%"
}
},
"adapter_status": {
"not_found": "No Bluetooth adapters found",
"enabled": "Bluetooth enabled",
"enabling": "Enabling Bluetooth...",
"disabled": "Bluetooth disabled",
"disabling": "Disabling Bluetooth..."
},
"device_status": {
"connected": "Connected",
"connecting": "Connecting...",
"disconnected": "Disconnect",
"disconnecting": "Disconnecting..."
}
}
]
}
TOML
[[end]]
type = "bluetooth"
icon_size = 32
[end.format]
not_found = ""
disabled = " Off"
enabled = " On"
connected = " {device_alias}"
connected_battery = " {device_alias} • {device_battery_percent}%"
[end.popup]
max_height.devices = 5
header = " Enable Bluetooth"
disabled = "{adapter_status}"
[end.popup.device]
header = "{device_alias}"
header_battery = "{device_alias}"
footer = "{device_status}"
footer_battery = "{device_status} • Battery {device_battery_percent}%"
[end.adapter_status]
not_found = "No Bluetooth adapters found"
enabled = "Bluetooth enabled"
enabling = "Enabling Bluetooth..."
disabled = "Bluetooth disabled"
disabling = "Disabling Bluetooth..."
[end.device_status]
connected = "Connected"
connecting = "Connecting..."
disconnected = "Disconnect"
disconnecting = "Disconnecting..."
YAML
end:
- type: bluetooth
icon_size: 32
format:
not_found: ""
disabled: " Off"
enabled: " On"
connected: " {device_alias}"
connected_battery: " {device_alias} • {device_battery_percent}%"
popup:
max_height:
devices: 5
header: " Enable Bluetooth"
disabled: "{adapter_status}"
device:
header: "{device_alias}"
header_battery: "{device_alias}"
footer: "{device_status}"
footer_battery: "{device_status} • Battery {device_battery_percent}%"
adapter_status:
not_found: "No Bluetooth adapters found"
enabled: "Bluetooth enabled"
enabling: "Enabling Bluetooth..."
disabled: "Bluetooth disabled"
disabling: "Disabling Bluetooth..."
device_status:
connected: "Connected"
connecting: "Connecting..."
disconnected: "Disconnect"
disconnecting: "Disconnecting..."
Corn
{
end = [
{
type = "bluetooth"
icon_size = 32
format.not_found = ""
format.disabled = " Off"
format.enabled = " On"
format.connected = " {device_alias}"
format.connected_battery = " {device_alias} • {device_battery_percent}%"
popup.max_height.devices = 5
popup.header = " Enable Bluetooth"
popup.disabled = "{adapter_status}"
popup.device.header = "{device_alias}"
popup.device.header_battery = "{device_alias}"
popup.device.footer = "{device_status}"
popup.device.footer_battery = "{device_status} • Battery {device_battery_percent}%"
adapter_status.not_found = "No Bluetooth adapters found"
adapter_status.enabled = "Bluetooth enabled"
adapter_status.enabling = "Enabling Bluetooth..."
adapter_status.disabled = "Bluetooth disabled"
adapter_status.disabling = "Disabling Bluetooth..."
device_status.connected = "Connected"
device_status.connecting = "Connecting..."
device_status.disconnected = "Disconnect"
device_status.disconnecting = "Disconnecting..."
}
]
}

Formatting Tokens

The following tokens can be used in format strings:

TokenDescription
{adapter_status}The current adapter status. The mapping of a status to a string could be defined using adapter_status config section.
{device_alias}The device name or address if name is not available.
{device_status}The current device status. The mapping of a status to a string could be defined using device_status config section.
{device_battery_percent}The device battery percentage.
{device_address}The device address, e.g 00:11:22:33:FF:EE.

Styling

SelectorDescription
.bluetoothTray widget button
.bluetooth.not-foundTray widget button when bluetooth adapter not found
.bluetooth.disabledTray widget button when bluetooth adapter is disabled
.bluetooth.enabledTray widget button when bluetooth adapter is enabled but no devices are connected
.bluetooth.connectedTray widget button when bluetooth adapter is enabled and a device is connected
.popup-bluetoothPopup box
.popup-bluetooth .headerHeader box with switch and label
.popup-bluetooth .header .switchBluetooth enable/disable switch
.popup-bluetooth .header .labelBluetooth enable/disable label
.popup-bluetooth .disabledBox that is only shown in non-enabled states (e.g. disabled, adapter not found, etc)
.popup-bluetooth .disabled .spinnerSpinner that is only shown in “connecting” and “disconnecing” states
.popup-bluetooth .disabled .labelLabel inside disabled container
.popup-bluetooth .devicesDevices scrollwindow
.popup-bluetooth .devices .boxBox inside devices scrollwindow
.popup-bluetooth .devices .box .deviceDevice box
.popup-bluetooth .devices .box .device .icon-boxDevice icon box
.popup-bluetooth .devices .box .device .icon-box .iconDevice icon content (any type)
.popup-bluetooth .devices .box .device .icon-box .text-iconDevice icon content (textual only)
.popup-bluetooth .devices .box .device .icon-box .imageDevice icon content (image only)
.popup-bluetooth .devices .box .device .statusDevice status box
.popup-bluetooth .devices .box .device .status .header-labelDevice header label
.popup-bluetooth .devices .box .device .status .footer-labelDevice footer label
.popup-bluetooth .devices .box .device .switchDevice connect/disconnect switch
.popup-bluetooth .devices .box .device .spinnerSpinner that is only shown in “connecting” and “disconnecing” states

For more information on styling, please see the styling guide.