From 72d6a8f50980358b8172d33178cd633610d06534 Mon Sep 17 00:00:00 2001 From: SirBlob Date: Sat, 10 Oct 2026 23:11:31 -0400 Subject: [PATCH] Show MAC addresses in the Bluetooth panel --- shell/plugins/bar/README.md | 2 +- shell/plugins/panels/bluetooth/Model.js | 12 ++++++++++++ shell/plugins/panels/bluetooth/Panel.qml | 10 ++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/shell/plugins/bar/README.md b/shell/plugins/bar/README.md index 4f2d6bb..7b4a549 100644 --- a/shell/plugins/bar/README.md +++ b/shell/plugins/bar/README.md @@ -66,7 +66,7 @@ Example `shell.json` (bar subtree only shown): | `blob.audio` | Volume icon + popup with master slider, output-device picker, per-app mixer | left = popup · right = mute · middle = popup · scroll = volume | | `blob.network` | Wi-Fi/Ethernet icon + popup with Wi-Fi scan, signal, connect, DNS provider selection | left = popup | | `blob.power` | Battery/AC icon + popup with battery stats, power profiles, and system info | left = popup · right = toggle percentage | -| `blob.bluetooth` | Bluetooth icon + popup with device list, connect/disconnect, battery | left = popup · right = toggle radio | +| `blob.bluetooth` | Bluetooth icon + popup with device list, MAC addresses, connect/disconnect, battery | left = popup · right = toggle radio | | `blob.monitor` | Brightness and laptop display controls | left = popup | The `blob.indicators` widget loads individual bar indicators from `indicators/`. Omit `items` (or set it to an empty array) to show all indicators in the default order, or set `items` to a subset such as `["Dnd", "Reminder", "NightLight"]`. Set `alwaysShow` to `true` to keep inactive indicators visible instead of revealing them only on hover. Multiple `blob.indicators` instances are allowed, so different sections can show different subsets. diff --git a/shell/plugins/panels/bluetooth/Model.js b/shell/plugins/panels/bluetooth/Model.js index 55b29bf..8763ea1 100644 --- a/shell/plugins/panels/bluetooth/Model.js +++ b/shell/plugins/panels/bluetooth/Model.js @@ -3,6 +3,17 @@ function deviceLabel(device) { return String(device.deviceName || device.name || "").trim() } +function deviceDetail(status, address) { + var parts = [] + var statusText = String(status || "").trim() + var addressText = String(address || "").trim().toUpperCase() + + if (statusText !== "") parts.push(statusText) + if (addressText !== "") parts.push(addressText) + + return parts.join(" · ") +} + function toArray(values) { if (!values) return [] if (Array.isArray(values)) return values.slice() @@ -157,6 +168,7 @@ function sectionDevices(lists, section) { if (typeof module !== "undefined") { module.exports = { deviceLabel: deviceLabel, + deviceDetail: deviceDetail, toArray: toArray, isUuidLike: isUuidLike, isAddressLike: isAddressLike, diff --git a/shell/plugins/panels/bluetooth/Panel.qml b/shell/plugins/panels/bluetooth/Panel.qml index 11cc5a9..e7af466 100644 --- a/shell/plugins/panels/bluetooth/Panel.qml +++ b/shell/plugins/panels/bluetooth/Panel.qml @@ -38,6 +38,10 @@ Panel { return Model.deviceLabel(device) } + function deviceDetail(status, address) { + return Model.deviceDetail(status, address) + } + function isUuidLike(value) { return Model.isUuidLike(value) } @@ -922,6 +926,8 @@ Panel { return "" } + readonly property string detailText: root.deviceDetail(statusText, dev ? dev.address : "") + readonly property color statusColor: { if (isConnected) return root.bar.foreground if (action !== "" || devState === 3 || dev.pairing === true) return root.bar.foreground @@ -1003,8 +1009,8 @@ Panel { } Text { textFormat: Text.PlainText - visible: row.statusText !== "" - text: row.statusText + visible: row.detailText !== "" + text: row.detailText color: row.statusColor font.family: root.bar.fontFamily font.pixelSize: Style.font.caption