21 lines
503 B
QML
21 lines
503 B
QML
pragma Singleton
|
|
import Quickshell
|
|
import Quickshell.Networking
|
|
|
|
|
|
Singleton {
|
|
id: root
|
|
property bool wifiEnabled: Networking.wifiEnabled
|
|
property string connectivity: Networking.connectivity.toString(Networking.connectivity)
|
|
readonly property list<NetworkDevice> devices: Networking.devices.values
|
|
|
|
function getConnectedDevice() {
|
|
for(let i=0; i < devices.length; ++i) {
|
|
console.log(i)
|
|
if(devices[i].connected) {
|
|
return devices[i];
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|