Krolyxon
Commit b2c867c

Branches

Refs →

aurorab2c867c

aurora: stop wifi list rescans, keep profiles on connect timeout

Author
krolyxon
Date
2026-10-25 12:30 +0530
Parent
129bacc
Commit
b2c867c3196e289ee1c79d87a961a1853f259303

+8 −4

1 file changed

  1. M .config/quickshell/aurora/Net.qml +8 −4
M .config/quickshell/aurora/Net.qml View
@@ -195,8 +195,9 @@ Singleton {
195195 var out = lines.join(" ").trim()
196196 if (rc !== 0) {
197197 message = out
198− // a failed first-time connect leaves a broken profile behind; drop it
199− if (lastWasNew && lastSsid !== "")
198+ // a failed first-time connect (wrong password: rc 4) leaves a broken profile behind; drop it.
199+ // Not on a timeout (rc 3): NM is still activating (slow campus DHCP) and deleting would abort it.
200+ if (rc === 4 && lastWasNew && lastSsid !== "")
200201 Quickshell.execDetached(["nmcli", "connection", "delete", "id", lastSsid])
201202 } else {
202203 message = ""
@@ -222,7 +223,7 @@ Singleton {
222223 run(["connection", "up", "id", ssid])
223224 } else {
224225 lastWasNew = !isSaved
225− var cmd = ["--wait", "20", "device", "wifi", "connect", ssid]
226+ var cmd = ["--wait", "60", "device", "wifi", "connect", ssid]
226227 if (password) cmd = cmd.concat(["password", password])
227228 run(cmd)
228229 }
@@ -322,9 +323,12 @@ Singleton {
322323 }
323324 }
324325
326+ // --rescan no: a plain `wifi list` starts a full scan when the last one is >30s old, i.e. on every
327+ // poll. Constant scans make the card roam (5 GHz -> weak 2.4 GHz), which drops the DHCP lease
328+ // behind captive portals. Scans only come from rescan() (Net tab opened / button) and NM itself.
325329 Process {
326330 id: listProc
327− command: ["nmcli", "-t", "-f", "IN-USE,SSID,SIGNAL,SECURITY", "device", "wifi", "list"]
331+ command: ["nmcli", "-t", "-f", "IN-USE,SSID,SIGNAL,SECURITY", "device", "wifi", "list", "--rescan", "no"]
328332 stdout: StdioCollector {
329333 onStreamFinished: {
330334 var best = {}, lines = text.split("\n")