Files
quickshell/modules/bar/states/Network/NetworkState.qml
T
2026-06-14 00:49:24 +02:00

35 lines
756 B
QML

pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
import "../../../../config"
QtObject {
id: root
property string status: "..."
property bool running: false
property Timer networkTimer: Timer {
interval: 10000
repeat: true
running: true
onTriggered: networkScript.running = true
}
property Process networkScript: Process {
running: true
command: ["sh", "-c", Config.configDir + "/modules/bar/scripts/Network.sh"]
stdout: StdioCollector {
onStreamFinished: {
root.status = this.text.trim()
}
}
}
Component.onCompleted: {
networkScript.running = true
networkTimer.start()
}
}