import QtQuick import Quickshell.Bluetooth import "." StatusItem { id: root required property QtObject commands readonly property var adapter: Bluetooth.defaultAdapter readonly property var connected: Bluetooth.devices.values.find(d => d.connected) || null readonly property int batteryPercent: connected && connected.batteryAvailable ? Math.round(connected.battery * 100) : -1 text: !adapter ? "" : (!adapter.enabled ? "󰂲" : (connected ? (batteryPercent >= 0 ? `󰂱 ${batteryPercent}%` : "󰂱") : "󰂯")) muted: !adapter || !adapter.enabled minWidth: connected && batteryPercent >= 0 ? 50 : 18 // The bar reports state only; pairing/troubleshooting still opens bluetui so // Quickshell does not become a second Bluetooth control surface yet. onLeftClicked: commands.openBluetooth() onMiddleClicked: commands.openBluetooth() }