From ffe4157e1c48281c9c0c5953a40aba9d6ec0b270 Mon Sep 17 00:00:00 2001 From: Fimeg Date: Tue, 14 Jul 2026 21:39:01 -0400 Subject: [PATCH] settings: show sleep inhibitor state, update stage names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IdleConfig.qml now shows: - Full IdleCoordinator state names including Suspending/Asleep/Waking - Sleep inhibitor held/released status (from SessionEvents) - stepUp grant TTL presence hypridle.conf changes (NOT in repo — apply to ~/.config/hypr/): - lock_cmd simplified to loginctl lock-session (SessionEvents catches the Lock signal); hyprlock fallback if quickshell is down - before_sleep_cmd REMOVED — SessionEvents handles PrepareForSleep - inhibit_sleep REMOVED — SessionEvents holds the delay inhibitor - suspend_cmd prefers loginctl over systemctl for PrepareForSleep signal --- .../modules/settings/IdleConfig.qml | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/surfaces/quickshell/modules/settings/IdleConfig.qml b/surfaces/quickshell/modules/settings/IdleConfig.qml index 34cb383..840f0bc 100644 --- a/surfaces/quickshell/modules/settings/IdleConfig.qml +++ b/surfaces/quickshell/modules/settings/IdleConfig.qml @@ -29,17 +29,23 @@ ContentPage { forceWidth: true // --- Live stage readout (polled over IPC) ---------------------------- - // 0 Active · 1 Dimmed · 2 Lock requested · 3 Lock secure — the - // IdleCoordinator.State enum, surfaced through session.state(). + // 0 Active · 1 Dimmed · 2 Lock requested · 3 Lock secure · + // 4 Suspending · 5 Asleep · 6 Waking — the IdleCoordinator.State + // enum, surfaced through session.state(). property int liveStage: -1 property bool liveNative: false property bool probeOk: false + property bool sleepInhibitorHeld: false + property bool stepUpEnabled: false readonly property var stageNames: [ Translation.tr("Active"), Translation.tr("Dimmed"), Translation.tr("Lock requested"), - Translation.tr("Lock secure") + Translation.tr("Lock secure"), + Translation.tr("Suspending"), + Translation.tr("Asleep"), + Translation.tr("Waking") ] function stageLabel(s) { return (s >= 0 && s < stageNames.length) ? stageNames[s] : Translation.tr("unknown"); @@ -55,6 +61,8 @@ ContentPage { const d = JSON.parse(stateOut.text); page.liveStage = d.idle?.stage ?? -1; page.liveNative = d.idle?.nativeCoordinatorEnabled ?? false; + page.sleepInhibitorHeld = d.sleepInhibitorHeld ?? false; + page.stepUpEnabled = d.stepUp?.grantTtlMs > 0 ?? false; page.probeOk = true; } catch (e) { page.probeOk = false; @@ -98,6 +106,22 @@ ContentPage { ? Translation.tr("The native coordinator is driving idle transitions. Dim and lock fire on the timers below.") : Translation.tr("The native coordinator is off, so the timers below do not run — hypridle owns screen-off. Only lock-requested and lock-secure transitions are reported here.") } + + RowLayout { + Layout.fillWidth: true + spacing: 12 + + StyledText { + text: page.sleepInhibitorHeld + ? Translation.tr("Sleep inhibitor: held (suspend blocked until lock is secure)") + : Translation.tr("Sleep inhibitor: released (suspend may proceed)") + font.pixelSize: Appearance.font.pixelSize.normal + color: page.sleepInhibitorHeld + ? Appearance.colors.colOnLayer1 + : Appearance.colors.colSubtext + } + } + } } ContentSection {