import QtQuick import Quickshell.Io import "." StatusItem { id: root required property QtObject commands property bool connected: false text: connected ? "󰖩" : "󰖪 off" muted: !connected minWidth: connected ? 28 : 52 // The host uses iwd/impala, not NetworkManager. A bounded poll preserves that // integration without adding a new networking daemon dependency. onLeftClicked: commands.openWifi() onMiddleClicked: commands.openWifi() Timer { running: true repeat: true interval: 30000 triggeredOnStart: true onTriggered: poll.exec(["sh", "-c", "iwctl station wlan0 show 2>/dev/null | sed 's/\\x1b\\[[0-9;]*m//g'"]) } Process { id: poll stdout: StdioCollector { onStreamFinished: root.connected = this.text.indexOf("State") >= 0 && this.text.indexOf("connected") >= 0 } } }