From f820e7abd4e59bd6645b905d931124be44d974e2 Mon Sep 17 00:00:00 2001 From: Brooklyn Zelenka Date: Sat, 5 Sep 2026 23:42:45 -0700 Subject: [PATCH] Click BT button in wuickshell bar to open BT app --- .../quickshell/bar/widgets/Connectivity.qml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/nix/modules/home/quickshell/bar/widgets/Connectivity.qml b/nix/modules/home/quickshell/bar/widgets/Connectivity.qml index 3270981..d39fa67 100644 --- a/nix/modules/home/quickshell/bar/widgets/Connectivity.qml +++ b/nix/modules/home/quickshell/bar/widgets/Connectivity.qml @@ -315,9 +315,31 @@ HangingTab { Text { Layout.alignment: Qt.AlignVCenter text: root.btGlyph + (root.btState === 2 && root.btCount > 1 ? " " + root.btCount : "") - color: root.btState === 0 ? Theme.subtext : Theme.text + color: btMouse.containsMouse + ? Theme.accent + : root.btState === 0 ? Theme.subtext : Theme.text font.family: Theme.fontFamily font.pixelSize: Theme.fontSize + + MouseArea { + id: btMouse + + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onClicked: event => { + if (event.button === Qt.RightButton) { + Quickshell.execDetached(["sh", "-c", + "bluetoothctl show | grep -q 'Powered: yes'" + + " && bluetoothctl power off" + + " || bluetoothctl power on"]) + } else { + Quickshell.execDetached(["blueman-manager"]) + } + } + } } } -- knotmirror 0.0.1