Skip to content

Add an optional screensaver to the lock screen - #8409

Closed
TripleU613 wants to merge 1 commit into
omacom:quattrofrom
TripleU613:lock-screensaver
Closed

TripleU613 wants to merge 1 commit into
omacom:quattrofrom
TripleU613:lock-screensaver

Conversation

@TripleU613

Copy link
Copy Markdown
Contributor

The problem

There is currently no way to have anything on screen while the machine is locked. If you like the screensaver and want to leave it running, your only option is to not lock — which is exactly the wrong trade to make.

Three things enforce that today, and they are all deliberate:

  • bin/omarchy-system-lock kills the screensaver on the way in — pkill -x ttfx, under the comment "Avoid running screensaver when locked".
  • Even if it survived, it could not be seen. The screensaver is a terminal window, and the session lock is an ext-session-lock surface (WlSessionLock in shell/plugins/lock/Service.qml) that renders above every window by design. The same applies to a wlr-layer-shell client, so Replace terminal screensaver with native Wayland client #7193 does not change this.
  • launchScreensaver() in the idle service short-circuits on omarchy-shell lock isLocked, so a cycle that starts while locked is skipped.

The consequence is that idle.lock is the only dial available, and turning it up far enough to keep the animation going means the machine effectively stops locking. On a desktop that gets left overnight, that is a real exposure — which is what prompted this.

The approach

Rather than trying to keep a window alive over the lock, draw the animation on the lock surface itself, behind the password field. The session stays locked the entire time; nothing is layered over the lock and no window survives it.

shell/plugins/lock/Screensaver.qml is a new, input-transparent component: no MouseArea, no focus, so every keystroke still reaches the password field behind it. It renders the same ~/.config/omarchy/branding/screensaver.txt art the windowed screensaver uses, so Style > Screensaver continues to drive both. Each cycle picks one of three effects (fade-and-scale, typewriter reveal, scramble-resolve), a new colour from the theme palette, and a new screen position, so it is not a static logo burned into one spot.

Configuration

New keys in the existing idle block of shell.json, all off by default:

"idle": {
  "screensaver": 150,
  "lock": 300,
  "lockScreensaver": true,
  "lockScreensaverDelay": 20,
  "lockScreensaverDuration": 0
}
  • lockScreensaver — off unless set to true. Absent keys mean stock behaviour, so config/omarchy/shell.json is untouched.
  • lockScreensaverDelay — seconds of ordinary lock screen before the animation fades in.
  • lockScreensaverDuration — seconds the animation runs before the display blanks. 0, the default, never blanks: it runs for as long as the session stays locked.

omarchy toggle screensaver gates this too — someone who turned the screensaver off does not get one on their lock screen.

Notes on the implementation

  • The password field is faded, not hidden. An invisible TextInput cannot hold focus, and losing focus would swallow the first keystroke of the password. It sits at opacity: 0 and stays enabled.
  • Pointer motion only counts as presence past a 40px threshold. The lock view's existing onPositionChanged fires on any movement, and jitter from an optical mouse would otherwise stop the animation ever starting.
  • The wallpaper Image and its blur MultiEffect are switched off while the animation is up. With lockScreensaverDuration: 0 the display never blanks, so leaving a full-screen 128px blur compositing indefinitely would be a pointless load.
  • idleBlankTimer's interval now covers the delay plus the duration, since its deadline is measured from the lock rather than from when the animation starts.

Verification

Verified in the running UI:

  • The animation renders on the lock surface, repositions and recolours per cycle, and stays fully within the screen bounds across cycles.
  • The keystroke path, which is the assertion the whole design rests on: with the animation showing and the field at opacity: 0, three simulated keystrokes (wtype) dismissed the animation and all three landed in the password field. Nothing was swallowed.
  • The wallpaper and blur are correctly suppressed while animating and restored on dismissal.
  • ./test/all — 5 pre-existing failures on my machine (bar-icon-geometry, config, snapper, theme-install-guards, unowned-system-paths), identical with and without this change on a stashed tree. No regressions introduced.

Not verified, stated plainly:

  • lockScreensaverDuration > 0 — the blank path. The blank timer is only armed by a real lock, so it cannot be exercised through the lock preview.
  • Developed and verified as an inlined variant inside LockView.qml in a user plugin directory, because sibling QML types do not resolve there. Submitted in the conventional shape as a sibling Screensaver.qml, matching how Service.qml already resolves LockView.

Happy to move this to a suggestions discussion instead if that is the preferred route for a feature of this size.

Copilot AI balanced review requested due to automatic review settings August 26, 2026 15:31
The session lock renders above every window, and omarchy-system-lock kills
ttfx on the way in, so locking has always ended the screensaver and blanked
the display. Keeping something on screen therefore meant not locking at all.

Draw the branding animation on the lock surface itself instead, behind the
password field. Off by default; enabled with idle.lockScreensaver, with
idle.lockScreensaverDelay seconds of lock screen first and
idle.lockScreensaverDuration seconds before the display blanks, where 0
never blanks. Honours omarchy toggle screensaver.

The password field is faded rather than hidden so it keeps focus, and the
first keystroke both dismisses the animation and enters the password.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@TripleU613 TripleU613 closed this by deleting the head repository Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants