How to create a lockscreen for Linux, for the Wayland display

I wanted to create a lockscreen for linux for the wayland display server. I am having trouble figuring out where I should start, what to do, what crates to use etc.

Wayland screensavers are baked into the compositor, as described in the Wayland docs:

The server side of Wayland is the compositor and core UX for the vertical, typically integrating task switcher, app launcher, lock screen in one monolithic application.

A compositor might support customizable screensavers, probably loading a library like in kwin, but that’s not yet standardized.

Are lockscreens screensavers? I thought they were two different things?

I pointlessly conflated them because xscreensaver implements both. Lock screens are the thing that actually needs tied into a Wayland compositor, as described in my quote, because that’s the only way to do perfect focus capture.

1 Like

I see, is it possible to also use Bevy game engine and whatever I design it can be used for the lockscreen?

I can’t answer that question without knowing which Wayland compositor you’re targeting. It is compositor-specific. The Wayland specification doesn’t standardized how a Lock Screen works.

1 Like