this post was submitted on 05 Dec 2023
35 points (97.3% liked)

Linux

5230 readers
199 users here now

A community for everything relating to the linux operating system

Also check out [email protected]

Original icon base courtesy of [email protected] and The GIMP

founded 1 year ago
MODERATORS
 

https://github.com/FriederHannenheim/cthulock Hey everybody. I'm releasing my new screen locker for Wayland which you can easily customize using the Slint language. Feel free to ask me any questions in the comments.___

top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 11 months ago (2 children)

why slint? i never heard about it

[–] [email protected] 2 points 11 months ago

I was looking for a UI framework that could easily embedded into other applications. I'm doing all the communication with Wayland myself, then create an OpenGL context from the Wayland surface which Slint renders into. Also Slint has this language you can create UI's with, which I think is not too difficult for users to learn so anyone can customize their lock screen easily with it.

[–] [email protected] 2 points 11 months ago

Looks like it makes rust easier based on a quick 30 second search

[–] [email protected] 3 points 11 months ago (1 children)

Would you mind providing any more details on what exactly one can customise? Might give this a shot tomorrow.

[–] [email protected] 6 points 11 months ago

Yeah sure. Well slint is a whole ui library and so you can customize basically anything. You could add extra text, move the clock and the password prompt wherever you want. You could even remove the password prompt and replace it by something else. Here's the config of the screenshot above:

import { LineEdit , TextEdit} from "std-widgets.slint";
export component HelloWorld {
    in property clock_text;
    in property checking_password;
    in-out property password <=> password.text;
    callback submit <=> password.accepted;
    forward-focus: password;
    states [
        checking when checking-password : {
            password.enabled: false;
        }
    ]

    Image {
        width: parent.width;
        height: parent.height;
        source: @image-url("wallpaper.png");
        HorizontalLayout {
            VerticalLayout {
                alignment: end;
                spacing: 10px;
                padding: 40px;
                width: 350px;
                Text {
                    text: clock_text;
                    horizontal-alignment: center;
                    font-size: 60pt;
                    color: white;
                }
                password := LineEdit {
                    enabled: true;
                    horizontal-alignment: left;
                    input-type: InputType.password;
                    placeholder-text: "password...";
                }
            }
        }
    }
}
[–] [email protected] 1 points 11 months ago

Very interesting!
Will give this a shot soon, particularly after the mess that was customizing Swaylock

[–] [email protected] 1 points 11 months ago

Interesting. I didn't realize Wayland was so extendible. I wonder if that means we can do a konfabulator clone.

[–] [email protected] 1 points 10 months ago* (last edited 10 months ago)

This looks really cool, thanks for your effort here, @[email protected]