Make plymouth display during getty auto-login

Hi,
I wondered if it’s possible to get plymouth to keep showing while getty does autologin.

Currently, it goes grub → plymouth animation → quick blank screen → frozen plymouth → getty autologin. Then my fish init starts sway.

I’d like if I could keep plymouth going a little longer so I don’t see the tty prompt at all, and just go grub → plymouth (preferably doesn’t freeze but I’m not picky) → sway.

I tried setting plymouth-quit.service (or -quit-wait, I don’t remember which) and getty@tty1.service as oneshot, then having after = "getty@tty1.service" in the plymouth serviceConfig, which kept plymouth going for longer – in fact, too long: getty doesn’t quit when it’s done the login so plymouth showed forever.

Relevant config
{ config, lib, pkgs, home-manager, ... }:

{
  boot = {
    plymouth = {
      enable = true;
      theme = "bgrt";
      font = "${pkgs.inter}/share/fonts/truetype/InterVariable.ttf";
    };
    consoleLogLevel = 0;
    initrd.verbose = false;
    kernelParams = ["splash" "quiet" "plymouth.use-simpledrm" "console=tty1" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" "boot.shell_on_fail" "systemd.show_status=0"];
    loader = {
      timeout = 0;
      grub = {
        splashImage = null;
        timeoutStyle = "hidden";
        enable = true;
        efiSupport = true;
        device = "nodev";
      };
      efi = {
        canTouchEfiVariables = true;
        efiSysMountPoint = "/boot";
      }; 
    };
    initrd.systemd.enable = true;
  };  
...
  home-manager.users.ccc = {
      home.file = {
        ".config/fish/conf.d/sway.fish".text = ''
          set TTY1 (tty)
          [ "$TTY1" = "/dev/tty1" ] && exec sway
          '';
      };
...
  systemd = {
    services = {
      "getty@tty1" = {
        overrideStrategy = "asDropin";
        serviceConfig = {
          ExecStart = ["" "@${pkgs.util-linux}/sbin/agetty agetty --nonewline --skip-login --login-program ${config.services.getty.loginProgram} --autologin ccc --noclear %I $TERM"];
        };
      };
      plymouth-quit-wait = {
        overrideStrategy = "asDropin";
        serviceConfig.after = ["default.target"];
      };
    };
  };

If possible I’d also looove plymouth to show on shutdown too. Currently it shows the classic scrolling log messages.

Many thanks in advance!

1 Like

I habe a similar issue with Plymouth using auto login via greetd and river as a window manager. Would be interested in a solution as well.

I would be interested too, but I think plymouth only works flicker-free with gnome.

I’m glad you mentioned gnome, it jogged my memory — I had forgotten I looked into how gnome achieves this.
It was something along the lines of disabling plymouth-quit because GDM stops plymouth instead.

I reckon we could probably recreate this, say the fish init (in my case) does a sleep 5 then quits plymouth. However, off the top of my head I don’t know if this would require sudo or not. If it does then probably user init script wouldn’t work.

The sway home manager module sets up a sway systemd service, but of course plymouth is a system service and can’t wait for a user service (although there are workarounds that I might try too).

Probably the best way to do it would be find or make a .target and tell plymouth-quit to wait for that, possibly via a wants directive.

The first thing I need to work out is whether to aim for delaying plymouth-quit or extending plymouth-quit-wait.

I’ll report back when I get a chance to have a look.

2 Likes

I have found using greetd autologin works far better (just noticed this is what @eblechschmidt was using already :upside_down_face:). Not quite Gnome levels of flicker free – there is a black screen shown while autologin does its thing, but IMO it looks better than getty’s text flashing up.

  services =  {
    greetd = {
        enable = true;
        settings = {
          default_session.command = "${pkgs.greetd.greetd}/bin/agreety --cmd sway";
          initial_session = {
            command = "sway";
            user = "youruser";
          };
        };
      };

Of interest is this issue with a suggestion I’ve not yet tried and this rather stale MR which seems like it might be trying to solve the problem.

Also I still can’t make plymouth show on shutdown!