rharish101 / ReGreet

Clean and customizable greeter for greetd
GNU General Public License v3.0
390 stars 16 forks source link

Preview / demo mode & CSS documentation #30

Closed takase1121 closed 1 month ago

takase1121 commented 1 year ago

Since I can't run regreet without greetd, it's hard to run regreet with GTK_DEBUG=inspector and poke around to see what can be customized. Adding a demo mode would really help.

I realized that this program needs layer shell. Even if the inspector is started, I cannot interact with it (that's the whole point!). Are there extra documentation on how to theme regreet in CSS?

rharish101 commented 1 year ago

Since I can't run regreet without greetd, it's hard to run regreet with GTK_DEBUG=inspector and poke around to see what can be customized. Adding a demo mode would really help.

Good idea, a demo mode would also help in development. I guess I can try to somehow mock greetd in the codebase with the demo mode.

I realized that this program needs layer shell.

Could you tell me why? Is it because the inspector doesn't work with it, or is it because it would also provide more features?

Are there extra documentation on how to theme regreet in CSS?

Not really, I didn't make any, since it's just like any other GTK app. If you want to see the GTK structure, just see src/gui/templates.rs. Specifically, these lines: https://github.com/rharish101/ReGreet/blob/0fb424574643919befeaac9017a5e76741ffb3be/src/gui/templates.rs#L32-L221

takase1121 commented 1 year ago

Could you tell me why? Is it because the inspector doesn't work with it, or is it because it would also provide more features?

Sorry, I didn't meant it like this - regreet would stay on top of the inspector so one can't use it. I assume the demo mode would allow regreet to run as a normal window, so it can be moved around.

rharish101 commented 1 year ago

Sorry, I didn't meant it like this - regreet would stay on top of the inspector so one can't use it. I assume the demo mode would allow regreet to run as a normal window, so it can be moved around.

Ah, so you mean that the demo mode should "disable" layer shell? Well, ReGreet doesn't use layer shell; it's just a normal window that's fullscreen.

I develop ReGreet on an X11 desktop (although Wayland might also work, but I haven't tested it) by running it through the command line. It spawns a fullscreen window, which I can reduce to a normal window using my window manager. Then I can access the inspector.

The demo mode I'm thinking of should allow one to use all ReGreet features - like showing the list of (dummy) usernames/sessions, enter (dummy) passwords, etc. - without actually contacting greetd.

takase1121 commented 1 year ago

Ah, so you mean that the demo mode should "disable" layer shell? Well, ReGreet doesn't use layer shell; it's just a normal window that's fullscreen.

Oh, didn't know!

I develop ReGreet on an X11 desktop (although Wayland might also work, but I haven't tested it) by running it through the command line. It spawns a fullscreen window, which I can reduce to a normal window using my window manager. Then I can access the inspector.

How do you connect to greetd when running as another user? I've been trying to figure this out.

rharish101 commented 1 year ago

How do you connect to greetd when running as another user? I've been trying to figure this out.

I just run ReGreet as the greeter user using sudo, as follows:

sudo -Eu greeter regreet

The -E switch is to allow passing environment variables. Here, it's needed to get the greetd IPC socket.

brainlessbitch commented 3 months ago
sudo -Eu greeter regreet

tried this, just got

panicked at 'called `Result::unwrap()` on an `Err` value: BoolError { message: "Failed to initialize GTK", filename: "/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gtk4-0.5.5/src/rt.rs", function: "gtk4::rt", line: 153 }', /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/relm4-0.5.0/src/lib.rs:110:17