refaktor
This commit is contained in:
@@ -2,7 +2,27 @@ pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import "../../../../config"
|
||||
|
||||
QtObject {
|
||||
Item {
|
||||
property int idle: 0
|
||||
|
||||
Process {
|
||||
id: statusScript
|
||||
command: ["sh", "-c", Config.configDir + "/modules/bar/scripts/Idle.sh --status"]
|
||||
running: true
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
idle = this.text.trim() === "0" ? 1 : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 5000
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: statusScript.running = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user