Repository navigation
Keep the lock through a pending suspend, and replay the design after it - #150
Merged
Merged
Conversation
The lock holds a suspend until it has blanked, so the design's entrance is seen before the machine sleeps (#90). A password accepted in that hold unlocked the session; omarchy-system-sleep-lock took that for a lock never made and locked again, every time, until its 12 s budget ran out and it suspended with "Screen did not lock before sleep". Each round showed the desktop for about 0.1 s. - A password or fingerprint accepted while logind is PreparingForSleep keeps the lock (unlock: held for sleep). The entrance still plays, the machine sleeps, and the unlock happens after the wake. - A resume is now seen whenever the lock is up, not only when blanked: typing keeps the display on, and the design then woke already played out. The resume hides the design for the first key to play, and clears a half-typed password, which the relock loop used to clear. - lock-process.py runs Omarchy's own sleep hook against the lock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suspending and unlocking straight away put the lock in a loop: the lock screen kept appearing and disappearing until the machine slept anyway.
Cause
Since #90 the lock holds a suspend until it has blanked (
statusreportssecureonly then), so the design's entrance plays before the machine sleeps. A password accepted during that hold unlocked the session. Omarchy'somarchy-system-sleep-lockwas still waiting forsecure, saw an unlocked session, and locked again. That repeated until its 12 s budget ran out and it suspended with "Screen did not lock before sleep". Each round showed the desktop for about 0.1 s.Not caused by 4.6 or #149: the hook is byte-identical in 4.5.0-3 and 4.6.0, and the same repro loops on the pre-#149 patch with 4.5. Stock Omarchy releases the suspend after 0.6 s, so it never hits this.
Fix
PreparingForSleepkeeps the lock and logsunlock: held for sleep. The entrance still plays, the machine sleeps, and you unlock after the wake. A suspend can't be cancelled, so there is no way to unlock and stay awake.resumeWatch) now runs whenever the lock is up, not only when blanked. Typing during the hold kept the display on, so the design woke already played out. On resume it now hides the design so the first key plays it, and clears any half-typed password (the relock loop used to clear it).Tests
tests/all.sh: 284 checks pass against 4.6 with the patched lock files.lock-process.pyruns Omarchy's real sleep hook against the lock: a password during the hold keeps the lock, the hook exits secure inside its budget, and after a resume the field is empty and the first input replays the design. It fails without the fix (an unlock went through a pending suspend), without the wider resume watch, and without the password clear.