FriederHannenheim / cthulock

Wayland screen locker focused on customizability
GNU General Public License v3.0
12 stars 1 forks source link

the example config not working, and the fallback one doesn't unlock #4

Open salahoued opened 3 weeks ago

salahoued commented 3 weeks ago

Hi, I got to build cthulock today (02/10/2024), but when using the example config cthulock falls back the other one

labwc -s "cthulock --no-fallback"

rror: Parse error: expected a top-level item such as a component, a struct, or a global
 --> .:3:1
  |
3 | in property<bool> checking_password;
  | ^

Error: Generic("Compiling the Slint code failed")

and when running normally just labwc -s "cthulock"

error: Parse error: expected a top-level item such as a component, a struct, or a global
 --> .:3:1
  |
3 | in property<bool> checking_password;
  | ^

[2024-10-02T12:52:05Z ERROR cthulock::style] Loading cthulock config failed. Loading fallback config. Errors Compiling the Slint code failed
warning: Exported component 'HelloWorld' doesn't inherit Window. This is deprecated
 --> .:2:18
  |
2 | export component HelloWorld {
  |                  ^

and last, when running in my running WM, it falls back to default config and I couldn't log in again, I would have to login in tty and terminate the other session

tretre91 commented 2 weeks ago

The example config shown in the docs is not complete, it's just a snippet which should be enclosed in a component, like this:

import { LineEdit } from "std-widgets.slint";

export component Example inherits Window {
    // will be set when the password is currently being checked
    // you can use this to disable a text box for example
    in property<bool> checking_password;
    in-out property<string> password <=> password.text;
    // Submit password callback. When this is called the PAM authentication process is called with the password you have provided.
    callback submit <=> password.accepted;

    // A LineEdit which the user enters the password in
    password := LineEdit {}
}

I couldn't log in again

I had the same issue, cthulock uses the auth and account pam groups, but there is no file installed to the pam config directory. I solved the problem by adding a file named cthulock to my /etc/pam.d directory, with the following contents:

auth    include login
account include system-auth
FriederHannenheim commented 2 weeks ago

@tretre91 Thanks for your answer. To be honest cthulock is currently unmaintained and I haven't looked at the code for a while so I can't really help much. But it seems that you have found the solution. I might come back to it in a while but currently I have a lot of other stuff to do