mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 17:47:09 +00:00
24 lines
663 B
QML
24 lines
663 B
QML
pragma Singleton
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Bluetooth
|
|
|
|
|
|
Singleton {
|
|
id: root
|
|
readonly property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter
|
|
readonly property list<BluetoothDevice> devices: defaultAdapter?.devices?.values ?? []
|
|
readonly property BluetoothDevice activeDevice: devices.find(d => d.connected) ?? null
|
|
readonly property string icon: {
|
|
if (!defaultAdapter?.enabled)
|
|
return "bluetooth_disabled"
|
|
|
|
if (activeDevice)
|
|
return "bluetooth_connected"
|
|
|
|
return defaultAdapter.discovering
|
|
? "bluetooth_searching"
|
|
: "bluetooth"
|
|
}
|
|
|
|
} |