event-driven network/bluetooth/powerprofile via dbus-monitor + nmcli monitor
This commit is contained in:
parent
b06e3582ff
commit
0568f71d1b
3 changed files with 49 additions and 3 deletions
|
|
@ -28,8 +28,23 @@ M.BarIcon {
|
|||
onStreamFinished: root.profile = text.trim()
|
||||
}
|
||||
}
|
||||
// Event-driven: watch power-profiles-daemon DBus changes
|
||||
Process {
|
||||
id: ppMonitor
|
||||
running: true
|
||||
command: ["sh", "-c", "dbus-monitor --system \"interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/net/hadess/PowerProfiles'\" 2>/dev/null"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
onRead: _debounce.restart()
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
interval: M.Modules.powerProfile.interval || 5000
|
||||
id: _debounce
|
||||
interval: 300
|
||||
onTriggered: proc.running = true
|
||||
}
|
||||
Timer {
|
||||
interval: 60000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: proc.running = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue