bluetooth: use quickshell's service

This commit is contained in:
end-4
2025-08-26 21:50:37 +07:00
parent f38c7bffed
commit bb49747fd9
4 changed files with 20 additions and 91 deletions
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Bluetooth
import Quickshell.Services.UPower
import qs
import qs.services
@@ -284,7 +285,10 @@ Item { // Bar content region
color: rightSidebarButton.colText
}
MaterialSymbol {
text: Bluetooth.bluetoothConnected ? "bluetooth_connected" : Bluetooth.bluetoothEnabled ? "bluetooth" : "bluetooth_disabled"
readonly property bool bluetoothEnabled: Bluetooth.defaultAdapter.enabled
readonly property BluetoothDevice bluetoothDevice: Bluetooth.defaultAdapter.devices.values.find(device => device.connected)
readonly property bool bluetoothConnected: bluetoothDevice !== undefined
text: bluetoothConnected ? "bluetooth_connected" : bluetoothEnabled ? "bluetooth" : "bluetooth_disabled"
iconSize: Appearance.font.pixelSize.larger
color: rightSidebarButton.colText
}