8

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?

8

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"
  • 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 6 '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 6 '16 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.