How can I set a default wallpaper for Gnome Shell from the terminal?

So I want to set a default wallpaper for gnome shell.
I know that it reads images from /usr/share/gnome-background-properties/ and that it uses an xml file so that it knows how to deal with them. So I’m guessing that there is something I have to add to that xml file in order to set a wallpaper.

The solutions I’ve found online have you run a gsettings or dconf command which is not an option for me as they want Wayland or Xorg to be running and I am doing this in a chroot environment and both Wayland&Xorg wont run in that.(at least that’s what I’m told)

In case it’s important, I’m using Gnome 43 and here is my xml file. Nabatean-Wallpaper/filename.xml at main - contractover/Nabatean-Wallpaper - Codeberg.org

Thanks in advanced.

The xml file is used to determine the wallpapers listed in gnome-control-center. It is not used to determine the default wallpaper.

If you are creating your own distro you can use gsettings schema overrides for org.gnome.desktop.background and change picture-uri as well as picture-uri-dark. That can be done by placing override files in /usr/share/glib-2.0/schemas/.

If you are asking how to do this as an administrator then there are dconf default values: Custom default values for system settings

1 Like

Well, Thank you for replying but This doesn’t work for me.

The issue is that I can not run anything with gsettings or dconf due to the lack of Wayland or Xorg in the chroot environment.

Neither of these require a graphical session to be running.

So it might not be gsettings that needs it but its using dbus to do it which need x11/xorg or wayland to be running.
Screenshot:

At no point was I talking about the gsettings commandline tool. I was talking about gsettings schema overrides and dconf defaults.

So there’s a gsettings gui tool that I’m supposed to be using? That also wouldn’t work as I’m in a chroot environment.

“I was talking about gsettings schema overrides and dconf defaults.”
I don’t understand, I know gsettings and dconf are different tools but what is schema? from what I could find it’s not a part of the last two and doesn’t seem to exist. unless this is what you mean GNOME / gsettings-desktop-schemas · GitLab

As for the Custom defaults values wiki you linked before, it works great until you reach the part where you update dconf.

Apologies if I’m too dumb, but I would think there would some sort of config file where I can edit it and specify what image should be used.

So there’s a gsettings gui tool that I’m supposed to be using?

No. If you are trying to create your own distro with a custom default wallpaper, put some override files in /usr/share/glib-2.0/schemas/, like I already said. I’m assuming your package manager will handle triggering glib-compile-schemas when installing files there.

what is schema?

It describes what keys exist and what types of values they can have and what the default value is.

If you are not creating your own custom distro, using dconf defaults is the way to go.

As for the Custom defaults values wiki you linked before, it works great until you reach the part where you update dconf.

How does it fail?

Okay, so I have copied all the images to that directory and I have edited org.gnome.desktop.background.gschema.xml to include them. I have also run glib-compile-schemas and have had no issues. yet there is no change, gnome desktop still shows me a blank blue image which is what it does if it can’t find an image or if theres none.

Also, correct me if I’m wrong but it seems that you think I’m packaging gnome. I’m not, I’m just reusing Debian’s packages. Unless I don’t understand the package manager part.

“How does it fail?”
gives me the same error as what I get when running gsettings tool.