From 6e5ffc398da12d7e36ad2b1a0d7254c5a7ef3c6e Mon Sep 17 00:00:00 2001 From: Taksh Date: Tue, 1 Sep 2026 23:55:04 +0530 Subject: [PATCH 1/2] fix: show Bluetooth Alias ahead of the hardware Name Signed-off-by: Taksh --- shell/plugins/panels/bluetooth/Model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/plugins/panels/bluetooth/Model.js b/shell/plugins/panels/bluetooth/Model.js index 55b29bf0bfa..6f5fa35358a 100644 --- a/shell/plugins/panels/bluetooth/Model.js +++ b/shell/plugins/panels/bluetooth/Model.js @@ -1,6 +1,6 @@ function deviceLabel(device) { if (!device) return "" - return String(device.deviceName || device.name || "").trim() + return String(device.name || device.deviceName || "").trim() } function toArray(values) { From cb830c9db6aabe312fb12cccc83fb94859a0cbdd Mon Sep 17 00:00:00 2001 From: Omabot Date: Wed, 2 Sep 2026 05:25:47 -0700 Subject: [PATCH 2/2] Flip the label test to the alias-first order The projection assertion pinned deviceName ahead of name, which is the precedence this branch reverses, so it fails as written. Its purpose was that deviceRow carries deviceName through to QObject-free rows, and a device with no alias still proves that. Co-Authored-By: Claude Opus 5 (1M context) --- test/shell.d/bluetooth-test.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/shell.d/bluetooth-test.sh b/test/shell.d/bluetooth-test.sh index b20727e6d9c..283aa57ef6e 100644 --- a/test/shell.d/bluetooth-test.sh +++ b/test/shell.d/bluetooth-test.sh @@ -97,8 +97,16 @@ assertDeepEqual( { address: '1', name: 'Deadbeef', deviceName: '', connected: false, state: -1, batteryAvailable: false, battery: 0, pairing: false }, 'bluetooth projects device rows with primitives only' ) +// BlueZ Alias is the user-facing rename and arrives as Quickshell's writable +// `name`; the read-only `deviceName` is the hardware-advertised Name, which is +// only what to show when nothing renamed the device. assertEqual( - bluetooth.deviceLabel(bluetooth.deviceRow({ name: 'Generic', deviceName: 'MX Master 3S', address: '2', connected: true })), + bluetooth.deviceLabel(bluetooth.deviceRow({ name: 'My Custom Name', deviceName: 'MX Master 3S', address: '2', connected: true })), + 'My Custom Name', + 'bluetooth shows the alias ahead of the hardware name' +) +assertEqual( + bluetooth.deviceLabel(bluetooth.deviceRow({ deviceName: 'MX Master 3S', address: '2', connected: true })), 'MX Master 3S', 'bluetooth keeps deviceName in row projections so labels survive QObject-free rows' )