diff --git a/modules/IdleInhibitor.qml b/modules/IdleInhibitor.qml index d11f56e..e34b380 100644 --- a/modules/IdleInhibitor.qml +++ b/modules/IdleInhibitor.qml @@ -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 } }