rharish101 / ReGreet

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

Regreet not detecting greetd at boot #75

Open wikiker opened 4 months ago

wikiker commented 4 months ago

When updating my NixOS, which included upgrading greetd to the latest version, I noticed a problem with regreet. When started by greetd at boot, I get the following error:

ERROR regreet: panicked at src/client.rs:42:13:
Missing environment variable 'GREETD_SOCK'. Is greetd running?

But when I restart the greetd service, regreet starts just fine; so the problem is only at boot.

My greetd config is this:

    services.greetd =
        let
            sway-config = pkgs.writeText "greetd-sway-config" ''
                exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK

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

                input * {
                    xkb_layout "cz"
                }

                output DP-1 pos 0 0
                output HDMI-A-2 disable

                exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"

                include /etc/sway/config.d/*
            '';
            session = {
                command = "${pkgs.sway}/bin/sway --config ${sway-config}";
                user = "greeter";
            };
        in
        {
            enable = true;
            settings = {
                default_session = session;
                initial_session = session;
                # terminal.vt = 1;
            };
        };
rharish101 commented 3 months ago

Sounds like greetd isn't started properly at boot, since it's not exporting the GREETD_SOCK environment variable that greetd greeters need. Can you check your bootloader/greetd setup?

max-ishere commented 2 months ago

I think you're supposed to use this: https://search.nixos.org/options?channel=24.05&show=programs.regreet.enable&from=0&size=50&sort=relevance&type=packages&query=regreet

max-ishere commented 4 weeks ago

Oh I see where the issue is:

initial_session = session;

This is for a user session, like

[initial_session]
command = "Hyprland"
user = "max_ishere"
max-ishere commented 4 weeks ago

Basically remove initial session, and just have default session

https://man.archlinux.org/man/greetd.5.en#default_session