diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-18 15:13:01 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-10-01 15:10:27 +0800 |
| commit | 3cea94b72dbfdd2077a59fc52a7460e200b6061e (patch) | |
| tree | 294a8cb1ef3aadc189073492bb041f6af2b17f70 /services | |
| parent | 8a71bd72f53e3629fb1d23d7c1b153207ba44789 (diff) | |
refactor: qml_pluginmain
Diffstat (limited to 'services')
| -rw-r--r-- | services/Network.qml | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/services/Network.qml b/services/Network.qml index bfe6c12..a5d54af 100644 --- a/services/Network.qml +++ b/services/Network.qml @@ -2,6 +2,7 @@ pragma Singleton // pragma ComponentBehavior: Bound // TODO: move to rust or native Network modules +import Quickshell.Networking import Quickshell import Quickshell.Io import QtQuick @@ -13,7 +14,7 @@ Singleton { property bool wifi: true property bool ethernet: false - property string networkName: "" + property NetworkDevice connectedNetwork property int networkStrength property string state: ethernet ? Icons.resource.network.wifi : (networkName.length >= 0 && networkName !== "lo") ? (networkStrength >= 90 ? Icons.resource.network.wifi.max : networkStrength >= 80 ? Icons.resource.network.wifi.high : networkStrength >= 60 ? Icons.resource.network.wifi.mid : networkStrength >= 40 ? Icons.resource.network.wifi.low : networkStrength >= 20 ? Icons.resource.network.wifi.min : Icons.resource.network.disconnected) : Icons.resource.network.disconnected @@ -68,7 +69,7 @@ Singleton { running: true stdout: SplitParser { onRead: data => { - root.networkName = data; + // root.networkName = data; } } } @@ -83,4 +84,14 @@ Singleton { } } } + + Component.onCompleted: { + Networking.devices.values.forEach(device => { + device.networks.values.forEach(n => { + n.nmSettings.forEach(s => { + // console.log(Object.keys(s.read())); + }); + }); + }); + } } |
