diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-12 21:50:26 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-12 21:51:38 +1100 |
| commit | 11f5a2ee45e73bdb7b18ec06330bc5a3ecb4c78a (patch) | |
| tree | 9f2a5588817f1b8bf526cb217e61a46e6bcd6210 /services | |
| parent | notifs: use adaptive timer for timeStr instead of reactive binding (diff) | |
| download | caelestia-shell-11f5a2ee45e73bdb7b18ec06330bc5a3ecb4c78a.tar.gz caelestia-shell-11f5a2ee45e73bdb7b18ec06330bc5a3ecb4c78a.tar.bz2 caelestia-shell-11f5a2ee45e73bdb7b18ec06330bc5a3ecb4c78a.zip | |
network: debounce nmcli monitor events
Batch rapid nmcli monitor events with a 200ms debounce timer
instead of spawning processes on every event line.
Diffstat (limited to 'services')
| -rw-r--r-- | services/Network.qml | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/services/Network.qml b/services/Network.qml index f3dfc3e..ede37c8 100644 --- a/services/Network.qml +++ b/services/Network.qml @@ -309,16 +309,23 @@ Singleton { return octets.join("."); } + Timer { + id: monitorDebounce + + interval: 200 + onTriggered: { + Nmcli.getNetworks(() => { + syncNetworksFromNmcli(); + }); + getEthernetDevices(); + } + } + Process { running: true command: ["nmcli", "m"] stdout: SplitParser { - onRead: { - Nmcli.getNetworks(() => { - syncNetworksFromNmcli(); - }); - getEthernetDevices(); - } + onRead: monitorDebounce.start() } } } |