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"
|
icon: root.active ? "\uF06E" : "\uF070"
|
||||||
|
|
||||||
|
// The inhibitor process — stays running while active
|
||||||
Process {
|
Process {
|
||||||
id: toggle
|
id: inhibitor
|
||||||
command: ["sh", "-c", root.active ? "pkill -x systemd-inhibit || true" : "systemd-inhibit --what=idle --who=nova-shell --why=user sleep infinity &"]
|
command: ["systemd-inhibit", "--what=idle", "--who=nova-shell", "--why=user", "sleep", "infinity"]
|
||||||
|
running: root.active
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: root.active = !root.active
|
||||||
root.active = !root.active;
|
|
||||||
toggle.running = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue