import QtQuick import Quickshell import Quickshell.Wayland // Keep-awake: a single infinite idle inhibitor, on until toggled off. // No durations, no timer — the inhibit follows `enabled` directly. Item { id: root property bool enabled: false function stateJson() { return JSON.stringify({ "backend": "Idle.qml", "usesNativeIdleInhibitor": true, "enabled": enabled, "compact": { "label": enabled ? "awake" : "normal", "role": enabled ? "ui.accent" : "ui.minor", "tooltip": enabled ? "Keep awake — on until toggled off" : "Normal idle behavior" } }); } function enable() { enabled = true; return stateJson(); } function disable() { enabled = false; return stateJson(); } function toggle() { enabled = !enabled; return stateJson(); } PanelWindow { id: idleWindow implicitWidth: 0 implicitHeight: 0 color: "transparent" mask: Region { } } IdleInhibitor { enabled: root.enabled window: idleWindow } }