From 03ea182c8c666c865865dda04be6873ae71b99a6 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 27 Aug 2026 10:53:56 +0100 Subject: [PATCH] Feature: Added wifi scanning indicator --- .../modules/bar/NetworkIndicator.qml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dotfiles/.config/quickshell/modules/bar/NetworkIndicator.qml b/dotfiles/.config/quickshell/modules/bar/NetworkIndicator.qml index cb27faa..bf8d5a8 100644 --- a/dotfiles/.config/quickshell/modules/bar/NetworkIndicator.qml +++ b/dotfiles/.config/quickshell/modules/bar/NetworkIndicator.qml @@ -90,6 +90,24 @@ Item { ? sortWifiRows(root.wifiDevice.networks.values.map(root.wifiRow).filter(function(r) { return r && r.ssid })) : [] + // Quickshell's WifiDevice has no "a scan is in flight" signal — only + // scannerEnabled, the on/off request, which stays true for as long as + // the panel is open rather than pulsing per scan. wifiRows re-deriving + // to a new array (as it does on every actual network-list change — see + // the comment on wifiRow() above) is the closest available proxy for + // "a scan just landed", so pulse briefly off that instead. + property bool wifiJustScanned: false + onWifiRowsChanged: { + root.wifiJustScanned = true + wifiScanPulseTimer.restart() + } + + Timer { + id: wifiScanPulseTimer + interval: 1200 + onTriggered: root.wifiJustScanned = false + } + // Split for the "Known Networks" / "Other Networks" sections. wifiRows // is already sorted connected-first then by signal, so filtering // preserves that order within each group. @@ -1084,6 +1102,32 @@ Item { font.pixelSize: Appearance.fontSize color: Colors.foreground } + + // Spins briefly each time a scan actually lands — + // same "still searching" cue as + // BluetoothIndicator.qml's spinner, but pulsed via + // wifiJustScanned (see above) rather than staying on + // for the whole time the panel is open, since + // WifiDevice has no per-scan signal of its own to + // key off. + Text { + id: wifiScanSpinner + visible: root.wifiDevice !== null && root.wifiDevice.scannerEnabled && root.wifiJustScanned + text: "progress_activity" + font.family: Appearance.iconFontFamilyRounded + font.variableAxes: Appearance.iconFontAxes + font.pixelSize: 16 + color: Colors.muted + + RotationAnimation on rotation { + running: wifiScanSpinner.visible + loops: Animation.Infinite + from: 0 + to: 360 + duration: 900 + } + } + ToggleSwitch { checked: Networking.wifiEnabled onToggled: Networking.wifiEnabled = !Networking.wifiEnabled