1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 21:48:30 -04:00

audio/bluez: update device aliases at runtime when renamed

fixes #1628
This commit is contained in:
bbedward
2026-07-04 23:00:22 -04:00
parent 3df801e3b2
commit dd7f4f3ac5
2 changed files with 17 additions and 0 deletions
+8
View File
@@ -245,6 +245,14 @@ Singleton {
return `bluez_card.${device.address.replace(/:/g, "_")}`;
}
function deviceForNodeName(nodeName) {
const match = (nodeName || "").match(/^bluez_(?:output|input|card)\.([0-9A-Fa-f_]+)/);
if (!match)
return null;
const address = match[1].replace(/_/g, ":").toUpperCase();
return Bluetooth.devices?.values?.find(d => (d.address || "").toUpperCase() === address) ?? null;
}
function getDevicePath(device) {
if (!device || !device.address) {
return "";