add networking info in bar
This commit is contained in:
parent
d216659564
commit
1f06bf5ee4
13 changed files with 179 additions and 78 deletions
21
modules/Services/Network.qml~
Normal file
21
modules/Services/Network.qml~
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue