add bluetooth menu (its fucked my lsp is dying
This commit is contained in:
parent
c0125912b1
commit
45646b6b5e
4 changed files with 122 additions and 10 deletions
21
services/Bluetooth.qml
Normal file
21
services/Bluetooth.qml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter
|
||||
property list<BluetoothDevice> connectedDevices: defaultAdapter.devices.values.filter(device => device.connected)
|
||||
property list<BluetoothDevice> pairedDevices: defaultAdapter.devices.values.filter(device => device.paired)
|
||||
property list<BluetoothDevice> availableDevices: defaultAdapter.devices.values.filter(device => !device.paired)
|
||||
|
||||
function isConnected(BluetoothDevice: device) {
|
||||
return device.state == BluetoothDeviceState.Connected;
|
||||
}
|
||||
|
||||
function isConnecting(BluetoothDevice: device) {
|
||||
return device.state == BluetoothDeviceState.Connecting;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue