16

I would like to display an image of my choice instead of the grey icon above my username on the login screen:

sddm lubuntu theme login screen

No doubt there is a setting for this somewhere, but I have failed to find it so far.

How do I change user images in the SDDM greeter?


Useful for testing -- you can use this command to preview the login screen without logging out.

Zanna
  • 70,465
  • You may try this answer here https://askubuntu.com/a/1007263/26246 – user.dz Jul 22 '20 at 09:48
  • @jokerdino https://askubuntu.com/a/1261062/527764 :D – Zanna Jul 22 '20 at 11:44
  • 1
    @user.dz Thank you for taking a look! That answer seems bad to me - there should be no need to change the permissions and their suggested permissions are bad. Also, I think that question is unclear now - why didn't it work as expected? – Zanna Jul 22 '20 at 17:49
  • @Zanna, Agree it is not good to give everyone such access to list users home folder. I also hate solutions that give sddm user the power to do so. A common folder (like in the answers here) in /var is more safe. Why didn't work, I expect due to permissions are not enough, still default permission for home ~/ doesn't allow read for everyone. – user.dz Jul 22 '20 at 20:35
  • @user.dz oh - well if the question makes sense and you think the answer is right to suggest changing the permissions, perhaps you could edit the answer? 644 permissions should be fine, I think? Or maybe you could post your own answer, if you feel like it. – Zanna Jul 23 '20 at 05:34

3 Answers3

7

There is a good guide for this on https://wiki.archlinux.org/index.php/SDDM#Installation

User icon (avatar) SDDM reads the user icon (a.k.a. "avatar") as a PNG image from either ~/.face.icon for each user, or the common location for all users specified by FacesDir in an SDDM configuration file. The configuration setting can be placed in either /etc/sddm.conf directly, or, better, a file under /etc/sddm.conf.d/ such as /etc/sddm.conf.d/avatar.conf.

To use the FacesDir location option, place a PNG image for each user named username.face.icon at the location specified by the FacesDir key in the configuration file. The default location for FacesDir is /usr/share/sddm/faces/. You can change the default FacesDir location to suit your needs. Here is an example:

/etc/sddm.conf.d/avatar.conf
[Theme]
FacesDir=/var/lib/AccountsService/icons/

I Just kept the pic I wanted in /usr/share/sddm/faces/ with the name <user-name>.face.icon As per the wiki it seems only .png files are supported.

enter image description here

enter image description here

PRATAP
  • 22,460
  • This is great! Seems we do not need to create the conf file - it works just placing the file in /usr/share/sddm/faces/ with the correct name scheme as you wrote. I made a symlink there to a file in my home - it is not a png file, but it worked very nicely – Zanna Jul 22 '20 at 11:36
5

This answer was provided in comment first by @yfluK

I'll suggest you look up the manual, ie. https://manual.lubuntu.me/stable/3/3.1/3.1.9/sddm_configuration.html?highlight=face%20icon

To change the picture for your user when you login simply copy the file you want as your user picture to in your home folder with the name .face.icon .

The file is located in ~ (your user directory)

guiverc
  • 30,396
  • 1
    If @yfluK wants to write an answer, and uses the manual link, I'm happy to delete this :) The Lubuntu manual is good, I suggest trying it. – guiverc Jul 22 '20 at 10:39
  • 1
    Yes, simply this works, although the image becomes pixellated and it is rotated incorrectly (I'll have to work on that). Thanks very much for the link to the manual, I'm embarrassed to admit I was unaware of it! – Zanna Jul 22 '20 at 10:47
  • 1
    @guiverc No problem. +1 from my side. – yfluK Jul 22 '20 at 10:54
  • 2
    For a long time it has worked to use .face for this purpose (also with Lubuntu), but now we need .face.icon. Thanks for asking @Zanna, and thanks for answering guiverc. – sudodus Jul 22 '20 at 11:35
  • 2
    I've rarely used it, but if I didn't like the result of the picture I chose, I just selected another (or returned to gimp to play some more). My primary purpose in answering was just to advertize the Lubuntu manual... so I've succeeded; thanks Zanna. – guiverc Jul 22 '20 at 11:45
  • 1
    Plese notice that it still works use .face for this purpose in standard Ubuntu Desktop 20.04 LTS (with Gnome). I have not tested in the other Ubuntu family flavours. – sudodus Jul 23 '20 at 15:14
  • 1
    You can change it via Kubuntu/KDE's sddm tool too (only tested that very recently, and I was most impressed with KDE & it's tool for this function) – guiverc Jul 23 '20 at 22:24
5
sudo nano /etc/sddm.conf

Under block [Theme].

[Theme]
EnableAvatars=true
FacesDir=/usr/share/sddm/faces 

I named my picture my-user-name.face.icon, so I don't mix it with user-pictures from other users.

Zanna
  • 70,465
nobody
  • 5,437
  • 1
    My /etc/sddm.conf did not already have that block, but adding it turned out to be unnecessary - just placing the file, or a symlink to it, at /usr/share/sddm/faces/username.face.icon (the suffix is necessary) worked. Thanks! – Zanna Jul 22 '20 at 11:42
  • For only one user enough, nice to learn. thanks for feedback. – nobody Jul 22 '20 at 11:51