Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReGreet fails to start #95

Open
wadeduvall opened this issue Nov 9, 2024 · 5 comments
Open

ReGreet fails to start #95

wadeduvall opened this issue Nov 9, 2024 · 5 comments

Comments

@wadeduvall
Copy link

I've been running regreet for just about a year with a mostly static config file. The latest release appears to have broken on both my systems (I'm using sway to run regreet, willing to try cage). I'm fairly sure sway isn't the issue, as the sway config works if I remove regreet. There's nothing in the logs, but if I try and run the demo, I get:

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

Running ArchLinux, and I get the same failure with both the version in extra and the git version on AUR. I've tried to debug this issue, but there's nothing in the logs.

Configs:
config.toml:

[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1

# The default session, also known as the greeter.
[default_session]
command = "sway --config /etc/greetd/sway-config"
# user = "greeter"

# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
# command = "agreety --cmd /bin/sh"

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
# user = "greeter"

sway-config:

output eDP-1 scale 1.5
exec "regreet --verbose --logs /var/log/regreet/test; swaymsg exit"

bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'

include /etc/sway/config.d/*

regreet.toml:

# SPDX-FileCopyrightText: 2022 Harish Rajagopal <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later

[background]
# Path to the background image
path = "/etc/greetd/background.png"

[GTK]
# Whether to use the dark theme
application_prefer_dark_theme = true

# Cursor theme name
cursor_theme_name = "Adwaita"

# Font name and size
font_name = "Cantarell 12"

# Icon theme name
icon_theme_name = "Adwaita"

# GTK theme name
theme_name = "Adwaita"

[commands]
# The command used to reboot the system
reboot = ["systemctl", "reboot"]

# The command used to shut down the system
poweroff = ["systemctl", "poweroff"]
@fifty-six
Copy link

Similar issue, I'll note that the demo works if I run it under my local user, but not under root or greeter - with the same issue as OP. Similarly also on arch.

@wadeduvall
Copy link
Author

Sadly, I think this is due to the super old version of the gtk4 crate. ReGreet didn't update on arch (last update 2024-06-28) and I didn't change the config, so that's likely where the issue lies. Will probably have to switch to another greeter since it doesn't seem like this will be fixed anytime soon.

@max-ishere
Copy link
Contributor

There is a PR with updated dependencies, you could try that and see if the issue is fixed - would be more of a reason to merge it.

#78

You have to appply this patch to get it to run tho:

cmdline_fix.patch:

diff --git a/src/main.rs b/src/main.rs
index f714232..71df388 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -42,11 +42,11 @@ enum LogLevel {
 #[command(author, version, about)]
 struct Args {
     /// The path to the log file
-    #[arg(short, long, value_name = "PATH", default_value = LOG_PATH)]
+    #[arg(short = 'l', long, value_name = "PATH", default_value = LOG_PATH)]
     logs: PathBuf,
 
     /// The verbosity level of the logs
-    #[arg(short, long, value_name = "LEVEL", default_value = "info")]
+    #[arg(short = 'L', long, value_name = "LEVEL", default_value = "info")]
     log_level: LogLevel,
 
     /// Output all logs to stdout
@@ -71,7 +71,7 @@ fn main() {
     // Keep the guard alive till the end of the function, since logging depends on this.
     let _guard = init_logging(&args.logs, &args.log_level, args.verbose);
 
-    let app = relm4::RelmApp::new(APP_ID);
+    let app = relm4::RelmApp::new(APP_ID).with_args(vec![]);
     app.run_async::<Greeter>(GreeterInit {
         config_path: args.config,
         css_path: args.style,
git apply ./cmdline_fix.patch

Although, I dont know if newer GTK dep. would necessarily fix the issue.

@fifty-six
Copy link

So I tried the new patch, which didn't work, but I did find a solution. The TLDR is use vulkan-radeon instead of amdvlk, or set GSK_RENDERER=ngl. I found this out from debugging having black bars around my GTK apps, and finding this thread, and having regreet conveniently start working after i applied the fix. Hope this helps anyone else!

@wadeduvall
Copy link
Author

Very interesting. I didn't get a chance to try the patch but sounds like that's okay. This should be significantly less work so I might have time this evening, else over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants