11

A similar task for changing the desktop background, can be achieved using the following script:

FILE="/backgrounds/background.png"
gsettings set org.gnome.desktop.background picture-uri "$FILE"

How would I achieve the same result, but with the user's avatar/profile picture?

Nicholas Adamou
  • 257
  • 2
  • 10
  • 2
    Related: http://askubuntu.com/questions/61637/where-is-the-users-profile-picture-stored-in-gnome-3 – muru Jun 06 '16 at 22:28

1 Answers1

11

That is not stored in Dconf.

See the contents of ...

/var/lib/AccountsService/
/home/$USER/.face
  • the 1st will have a desktop styled file
  • the 2nd holds the image taken from a webcam in case you used that

To change the 1st check the desktop file for the dir at Icon= and replace the file it points to (make sure yours is the same size). The second just requires you to move a file to it (probably in the same size and format).

If you want to remove the picture altogether and default back to no profile picture, remove the property that says Icon=, or if you want one single command to do it for you:

sed -i '/Icon/d' "/var/lib/AccountsService/$USER"
David Foerster
  • 35,754
  • 55
  • 92
  • 145
Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • 1
    Okay so if I wanted to change the image inside `/var/lib/AccountsService/icon/UserNameHere/` I would place the image inside that directory? – Nicholas Adamou Jun 06 '16 at 22:30
  • @NicholasAdamou I have nothing there :-X But yes, the desktop file seems to point to the file itself so you can just use "sudo cp" to copy over the file (maybe make a backup of the old one too) – Rinzwind Jun 06 '16 at 22:31