You are browsing as a guest. Sign up (or log in) to start making projects!

  • 9 Devlogs
  • 49 Total hours

Lockrs is a wayland server agnostic, gpu-accelerated lock screen engine made in Rust. It works by implementing the egui library for lock screen surfaces.

Ship #2

This ship adds some new functionality!

Namely, the ability to take a screenshot of the lockscreen (if you dont want this, it can be disabled through the disabling of the default screenshot feature), new builtin widgets, and some stuff buried a bit more deeply in the logic, such as adding a worker thread for slow operations, fixing some bad output-dependant handling and adding support for more keyboard keys.

The most challenging thing about this ship was trying to understand how to make vulkan play nice with ext_session_lock_v1 when setting the buffer scaling, it took me a long time for like- no reason TuT.

Anyways, here’s two screenshots of lockscreens i made while developing lockrs:

  • 3 devlogs
  • 16h
  • 15.58x multiplier
  • 249 Stardust
Try project → See source code →
Open comments for this post

10h 12m 9s logged

A lot of big changes!

these 10 hours of coding felt like a constant rabbit hole, but i finally fixed all the things i found TuT.

First of all, i made some new widgets: namely, a text input for the password that reserves space for the “login failed” failure text, an uptime widget and widget that fetches the default network interface.

While making an example lock screen using these new widgets, i noticed that taking a screenshot was just a huge pain; One had to go do gpu texture copying magic and it was just A Bad Time in general. So, i decided to bake that functionality into lockrs itself, so now there’s a screenshot feature (enabled by default) which makes it able to save screenshots.

But while implementing the screenshot feature, i noticed that there were some inconsistencies in the multiple output logic and in the buffer scaling logic, so i fixed those (this took surprisingly long :p).

After implementing that, i went to take that screenshot, and noticed that the UI would freeze for a bit while the disk I/O of saving the image was running. This was quite annoying, so i also decided to make a whole ass worker thread that handles password checking (which also used to hang the UI thread, albeit for a short time) and to save the screenshot.

Anyways, after this journey of a few days of coding, here’s the example screenshot, finally:

P.S.: while trying to put an image here, firefox crashed and i had to rewrite this whole thing… to anyone seeing this, save your devlogs somewhere before adding pics :p

0
0
13
Open comments for this post

5h 28m 33s logged

Well, im at it again with this project. I took quite a long break to make another project, and now have had the time to come back to this. I’ve finally written some in-depth docs, and will review them later today with a fresh mind to be sure that they’re as right as possible.
I also fixed a design flaw, but im not very sure if how i did it really fixed it. Before, this is the old way it’s doing it:

app.ui(|_, ui| {
    // put stuff inside some ui levels 
    egui::CentralPanel::default()
          .frame(egui::Frame::NONE)
          .show(ui, |ui| {
               // maybe make new ui levels
               // inside the levels, return TryExit
               TryExit::Force
      })
      .inner.inner.inner //as many .inner as ui levels 
      // TryExit is in, because you need to return the inner TryExit
})

this felt extremely clunky. So, i solved it like this:

// mutable reference to a TryExit
app.ui(|_, ui, exit: &mut TryExit| {
    // as many levels as you want
    egui::CentralPanel::default()
          .frame(egui::Frame::NONE)
          .show(ui, |ui| {
               // instead of returning it, mutate the passed-in reference
               *exit = TryExit::Force;
      }); // no need to return anything, so no .inner
})

this feels a bit better, but idrk still. For the time being, the API will be the latter.

Anyways, have a look at the new docs:

0
0
11
Super Star

As a prize for your great work, look out for a bonus prize in the mail :)

Ship #1

Lockrs is a library that aims to make Wayland screen lockers as customizable as possible. First of all, it’s written in the Rust language, and it’s essentially an implementation of the egui crate for lock screen surfaces; This means it can be truly used for anything (or well, anything egui can possibly do). This project was born out of frustration of the little customizability that other projects offer, relying at most on a simple config file to define everything. It is based on the wayland-client, wgpu and egui crates, which make it compatible with practically any modern Wayland compositor (to be specific, all compositors implementing the ext-session-lock-v1 protocol); using wayland-client was quite hard, as it was really my first time making something that supports graphics and juggling communications with an outside application in the meantime. I think this project was very successful in helping me learn about how Wayland works, and a little bit of how rendering works too. Overall, I’m quite proud of how it turned out, and i have already made my own lock screen (see picture below).

  • 6 devlogs
  • 33h
  • 18.69x multiplier
  • 616 Stardust
Try project → See source code →
Open comments for this post

5h 29m 42s logged

After taking a small break, i finally finished this project. I decided to turn it into a library instead of a really customizable lockscreen, because what would be the purpose in making something that could very well work in any number of ways and then limiting it to a few widgets? I’m quite satisfied with how it turned out, even if there are a few rough spots. Also, i decided to license it under MIT or Apache 2.0, as per convention for rust libraries.

In the end, i’ll be definitely using lockrs, and i hope some other people will too.

0
0
20
Open comments for this post

3h 15m 23s logged

I managed to add PAM authentication. I also tried to add support for shaders and in general gpu work, and discovering i bit off way more than i can chew, i just decided not to.
So, i tried to add a background, but i stumbled upon an obstacle which sent me diving into egui’s source code, because it kept claiming that it couldn’t load images with side bigger than 2048px; turns out this is only a limitation of the WebGPU API, that, as the name suggests, runs on browsers, not on desktops. Anyways, after a lot of fiddling with egui’s components, i managed to make it use images with sides up to 8000px.
Now i’ll probably customize the bar a little, and maybe make a few egui widgets for it.

0
0
21
Open comments for this post

9h 13m 8s logged

After wrecking my mind unnecessarily over how to handle pointer events for a ridiculous amount of time, I finally got something that somehow works; now i also have a working text input! It just prints the input to the terminal for now, but I’ll be messing with PAM a bit to do authentication now. wish me luck!

0
0
18
Open comments for this post

8h 8m 43s logged

I finally got the keyboard to work! for now, it just exits as soon as a key is pressed, but i’m working on implementing full functionality. also, now the code is much much cleaner, properly divided in functions instead of being all chucked into main. I don’t really have a way to display this with a screenshot, so i’ll just reuse an old one unfortunately :p

0
0
13
Open comments for this post

2h 2m 31s logged

Well, i managed to render to the lock screen with egui instead of using
the raw buffer; for now, it’s still a mess of spaghetti code that barely
works and will turn into a footgun very quickly if i don’t get
working on the lower level part of it instead of throwing stuff at the
wall and seeing if it sticks. The next step is tidying the code up
instead of throwing everything into main, so that i can get some
customization going. Also, i should probably add the authentication part
of the lock screen instead of having it unlock after a few seconds.

0
0
9
Open comments for this post

4h 48m 23s logged

I finished a first proof of concept for wl-lock; right now, it locks the user out for two seconds while displaying a mauve screen.
For now, it’s still fully cpu rendered, but i plan on adding gpu-accelerated background blur and general effects.
The next step is hooking egui into it!

0
0
12

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…