Show MAC addresses in the Bluetooth panel
This commit is contained in:
1 parent
98c63031ee
commit
72d6a8f509
3 files changed
+21
-3
No files matched your search
@@ -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.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.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.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 |
|
| `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.
|
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.
|
||||||
|
|||||||
@@ -3,6 +3,17 @@ function deviceLabel(device) {
|
|||||||
return String(device.deviceName || device.name || "").trim()
|
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) {
|
function toArray(values) {
|
||||||
if (!values) return []
|
if (!values) return []
|
||||||
if (Array.isArray(values)) return values.slice()
|
if (Array.isArray(values)) return values.slice()
|
||||||
@@ -157,6 +168,7 @@ function sectionDevices(lists, section) {
|
|||||||
if (typeof module !== "undefined") {
|
if (typeof module !== "undefined") {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
deviceLabel: deviceLabel,
|
deviceLabel: deviceLabel,
|
||||||
|
deviceDetail: deviceDetail,
|
||||||
toArray: toArray,
|
toArray: toArray,
|
||||||
isUuidLike: isUuidLike,
|
isUuidLike: isUuidLike,
|
||||||
isAddressLike: isAddressLike,
|
isAddressLike: isAddressLike,
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ Panel {
|
|||||||
return Model.deviceLabel(device)
|
return Model.deviceLabel(device)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deviceDetail(status, address) {
|
||||||
|
return Model.deviceDetail(status, address)
|
||||||
|
}
|
||||||
|
|
||||||
function isUuidLike(value) {
|
function isUuidLike(value) {
|
||||||
return Model.isUuidLike(value)
|
return Model.isUuidLike(value)
|
||||||
}
|
}
|
||||||
@@ -922,6 +926,8 @@ Panel {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property string detailText: root.deviceDetail(statusText, dev ? dev.address : "")
|
||||||
|
|
||||||
readonly property color statusColor: {
|
readonly property color statusColor: {
|
||||||
if (isConnected) return root.bar.foreground
|
if (isConnected) return root.bar.foreground
|
||||||
if (action !== "" || devState === 3 || dev.pairing === true) return root.bar.foreground
|
if (action !== "" || devState === 3 || dev.pairing === true) return root.bar.foreground
|
||||||
@@ -1003,8 +1009,8 @@ Panel {
|
|||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
visible: row.statusText !== ""
|
visible: row.detailText !== ""
|
||||||
text: row.statusText
|
text: row.detailText
|
||||||
color: row.statusColor
|
color: row.statusColor
|
||||||
font.family: root.bar.fontFamily
|
font.family: root.bar.fontFamily
|
||||||
font.pixelSize: Style.font.caption
|
font.pixelSize: Style.font.caption
|
||||||
|
|||||||
Reference in new issue
Block a user