How to customise GNOME default background and lock screen image?

7,653

your approach of copying the images to /usr/share/backgrounds/ and editing /usr/share/gnome-background-properties/ubuntu-wallpapers.xml will allow you to show them in Settings-->Bakcground-->Wallpapers and Settings-->Lock Screen-->Wallpapers

but the gsettings for these two are set to warty-final-ubuntu.png

$ gsettings get org.gnome.desktop.background picture-uri
'file:///usr/share/backgrounds/warty-final-ubuntu.png'
$ gsettings get org.gnome.desktop.screensaver picture-uri
'file:///usr/share/backgrounds/warty-final-ubuntu.png'
maduri@i7-4770U:~$ 

So, you need to compile these values after editing /usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override file.

Run the command sudo nano /usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override and edit the content for background and screensavers as below, changing to your actual image paths:

[org.gnome.desktop.background]
picture-uri = 'file:///usr/share/backgrounds/warty-final-ubuntu.png'

[org.gnome.desktop.screensaver]
picture-uri = 'file:///usr/share/backgrounds/warty-final-ubuntu.png'

Save the changes and run this command to compile the schemas:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

Now you can check the gsettings value for these two wallpapers

gsettings get org.gnome.desktop.background picture-uri
gsettings get org.gnome.desktop.screensaver picture-uri

you are done. Restart the computer for the changes to take effect.

Please have a look of below Images which are self explanatory as I did it personally with Ubuntu 18.04.2 ISO with Ubuntu 18.04.2 as my OS

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Booted with live USB and the resulting pictures are

enter image description here

enter image description here

Share:
7,653

Related videos on Youtube

GauthierPLM
Author by

GauthierPLM

Updated on September 18, 2022

Comments

  • GauthierPLM
    GauthierPLM over 1 year

    I am building a Custom ISO of Ubuntu 18.04 LTS using CUBIC and I'd like to change the default background and lock screen image.

    I added the backgrounds in /usr/share/backgrounds, changed the background in /usr/share/gnome-background-properties/ubuntu-wallpapers.xml file, but it does not seems to affect new users (for example the OEM user).

    Also, I did not find any way to change the lock screen image.

  • GauthierPLM
    GauthierPLM almost 5 years
    Thank you very much, very good and complete answer.
  • Ivan Perez
    Ivan Perez over 4 years
    Is it possible to do this without sudo (meaning using only paths inside $HOME).
  • UnKNOWn
    UnKNOWn over 4 years
    @IvanPerez are you customizing ISO?
  • Ivan Perez
    Ivan Perez over 4 years
    No. You're right. I missed that point. I was trying to find out how to do this on Ubuntu normally and skipped right to the solution :)