fix idle inhibitor: keep process running instead of backgrounding
This commit is contained in:
parent
d90f9cbf94
commit
0b09f9ad62
1 changed files with 5 additions and 6 deletions
|
|
@ -11,17 +11,16 @@ M.BarIcon {
|
|||
|
||||
icon: root.active ? "\uF06E" : "\uF070"
|
||||
|
||||
// The inhibitor process — stays running while active
|
||||
Process {
|
||||
id: toggle
|
||||
command: ["sh", "-c", root.active ? "pkill -x systemd-inhibit || true" : "systemd-inhibit --what=idle --who=nova-shell --why=user sleep infinity &"]
|
||||
id: inhibitor
|
||||
command: ["systemd-inhibit", "--what=idle", "--who=nova-shell", "--why=user", "sleep", "infinity"]
|
||||
running: root.active
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.active = !root.active;
|
||||
toggle.running = true;
|
||||
}
|
||||
onClicked: root.active = !root.active
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue