gate network/bluetooth/powerprofile processes on module enable flag
This commit is contained in:
parent
25bc3954cb
commit
208a9023b8
3 changed files with 10 additions and 9 deletions
|
|
@ -2,6 +2,7 @@ pragma Singleton
|
|||
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
|
@ -10,7 +11,7 @@ QtObject {
|
|||
readonly property bool powerSaver: profile === "power-saver"
|
||||
|
||||
property var _proc: Process {
|
||||
running: true
|
||||
running: M.Modules.powerProfile.enable
|
||||
command: ["powerprofilesctl", "get"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: root.profile = text.trim()
|
||||
|
|
@ -18,7 +19,7 @@ QtObject {
|
|||
}
|
||||
|
||||
property var _monitor: Process {
|
||||
running: true
|
||||
running: M.Modules.powerProfile.enable
|
||||
command: ["sh", "-c", "dbus-monitor --system \"interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/net/hadess/PowerProfiles'\" 2>/dev/null"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
|
|
@ -33,7 +34,7 @@ QtObject {
|
|||
|
||||
property var _poll: Timer {
|
||||
interval: 60000
|
||||
running: true
|
||||
running: M.Modules.powerProfile.enable
|
||||
repeat: true
|
||||
onTriggered: root._proc.running = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue