From dd2df931a3be1a6518c1e9fbff438de4274456cd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 22:52:35 +0200 Subject: ... --- .../gkleen@sif/shell/quickshell/Lockscreen.qml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'accounts/gkleen@sif/shell/quickshell/Lockscreen.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml index 8e739359..e4f8e1c9 100644 --- a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml +++ b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml @@ -38,6 +38,38 @@ Scope { function getLocked(): bool { return lock.locked; } } + Connections { + target: Custom.Systemd + function onSleep(before: bool) { + console.log(`received prepare for sleep ${before}`); + if (before) + lock.locked = true; + } + function onLock() { lock.locked = true; } + function onUnlock() { lock.locked = false; } + } + + IdleMonitor { + id: idleMonitor + enabled: !lock.secure + timeout: 600 + respectInhibitors: true + + onIsIdleChanged: { + if (idleMonitor.isIdle) + lock.locked = true; + } + } + + Custom.SystemdInhibitor { + enabled: !lock.secure + + what: Custom.SystemdInhibitorParams.Sleep + who: "quickshell" + why: "Lock session" + mode: Custom.SystemdInhibitorParams.Delay + } + WlSessionLock { id: lock @@ -56,6 +88,8 @@ Scope { } } + onSecureStateChanged: Custom.Systemd.lockedHint = lock.secure + WlSessionLockSurface { id: lockSurface -- cgit v1.2.3