Setting sddm profile picture

Hi there, I am using the elegant-sddm theme for well… sddm.

I am using the below, and for the most part, it is working well. I just need to get the users profile photo to show up in the login screen,

I had read about setting the FacesDir, and then having a png in the directory in the format of username.face.icon.

But that does not seem to be working for me.`

environment.systemPackages = with pkgs;
      [
        (elegant-sddm.override {
          themeConfig.General = {
            # background = toString ./red-skulls.jpg;
            background = toString "${user-settings.user.wallpaper}";
            backgroundMode = "fill";
            FacesDir = "${user-settings.user.home}/Pictures/profiles/login/";
            CursorTheme = "Bibata-Modern-Classic";
            CursorSize = "24";
            Font = "Work Sans 20,-1,5,50,0,0,0,0,0";
          };
        })
      ];

I then read that sddm will also look at ~/.face.icon, so I tried commenting that out too, and still no go.

I am using hyprland. Does anyone else have this going?

Thank you.

figured it out. Not the best, but works:

# Define systemd service to run on boot to load avatars for sddm
    systemd.services."sddm-avatar" = {
      description = "Service to copy or update users Avatars at startup.";
      wantedBy = [ "multi-user.target" ];
      before = [ "sddm.service" ];
      script = ''
        set -eu
        for user in /home/*; do
            username=$(basename "$user")
            if [ -f "$user/.face.icon" ]; then
                if [ ! -f "/var/lib/AccountsService/icons/$username" ]; then
                    cp "$user/.face.icon" "/var/lib/AccountsService/icons/$username"
                else
                    if [ "$user/.face.icon" -nt "/var/lib/AccountsService/icons/$username" ]; then
                        cp "$user/.face.icon" "/var/lib/AccountsService/icons/$username"
                    fi
                fi
            fi
        done
      '';
      serviceConfig = {
        Type = "simple";
        User = "root";
        StandardOutput = "journal+console";
        StandardError = "journal+console";
      };
    };

    # # Ensures SDDM starts after the service.
    systemd.services.sddm = { after = [ "sddm-avatar.service" ]; };
1 Like