pragma Singleton import Quickshell import Quickshell.Io import QtQuick Singleton { id: root property string ssid Process { id: netProc command: ["iwctl", "station", "wlan0", "get-networks"] running: true stdout: StdioCollector { onStreamFinished: { var line = this.text.split("\n").find(line => line.includes(">")) // remove ANSI escape sequences line = line.replace(/\x1b\[.*?[@A-Z\[\\\]^_`a-z\{\|\}~]/g, '') root.ssid = line.split(" ").filter(x => x != "")[1] } } } Timer { interval: 5000 running: true repeat: true onTriggered: netProc.running = true } }