fix idle inhibitor: keep process running instead of backgrounding

This commit is contained in:
Damocles 2026-04-13 10:59:07 +02:00
parent d90f9cbf94
commit 0b09f9ad62

View file

@ -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
}
}