settings: show sleep inhibitor state, update stage names
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
This commit is contained in:
parent
ae9ef41bb1
commit
ffe4157e1c
1 changed files with 27 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue