How to add dynamic wallpapers to Gnome settings / Change backgrounds?

This is how I added a 24-hour dynamic background. It requires five images for the transition, plus Gnome Tweaks to install (I've yet to work out a more elegant way of setting the background.)

In /usr/share/backgrounds create a folder and place images for twilight, sunrise, day, evening, and night, e.g., Twilight.jpg, Sunrise.jpg etc. In this example, I've called the background “desert-sands” and the file, desert-sands-timed.xml.

Next, create an XML files as follows:

<background>
	<starttime>
		<year>2022</year>
		<month>3</month>
		<day>30</day>
		<hour>5</hour>
		<minute>0</minute>
		<second>0</second>
	</starttime>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Twilight.jpg</file>
		<duration>3600.0</duration>
	</static>

	<transition type="overlay">
		<duration>3600.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Twilight.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Sunrise.jpg</to>
	</transition>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Sunrise.jpg</file>
		<duration>3600.0</duration>
	</static>

	<transition type="overlay">
		<duration>3600.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Sunrise.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Day.jpg</to>
	</transition>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Day.jpg</file>
		<duration>28800.0</duration>
	</static>

	<transition type="overlay">
		<duration>3600.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Day.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Evening.jpg</to>
	</transition>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Evening.jpg</file>
		<duration>3600.0</duration>
	</static>

	<transition type="overlay">
		<duration>3600.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Evening.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Twilight.jpg</to>
	</transition>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Twilight.jpg</file>
		<duration>3600.0</duration>
	</static>

	<transition type="overlay">
		<duration>7200.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Twilight.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Night.jpg</to>
	</transition>

	<static>
		<file>/usr/share/backgrounds/desert-sands/Night.jpg</file>
		<duration>18000.0</duration>
	</static>

	<transition type="overlay">
		<duration>3600.0</duration>
		<from>/usr/share/backgrounds/desert-sands/Night.jpg</from>
		<to>/usr/share/backgrounds/desert-sands/Twilight.jpg</to>
	</transition>
</background>

To activate the background, go to Tweaks > Appearance and select the XML file for Background and Lock Screen images.

I'm not certain how to add the background permanently to Settings > Background.

4 Likes