Jun 05

Animated desktop wallpaper on Ubuntu Linux

Category: Linux,Ubuntu   — Published by goeszen on June 5, 2015 at 6:31 pm

So you want to configure your desktop to be animated, probably having it display different things over time and the course of a day.
Short answer: it's not possible (yet). The updated answer: it depends on how you'd define animated. If you mean really animated, like video, many frames per second, then the answer is: there are some efforts, but it's not working anymore or yet. But if you mean animated in the sense of an automatically rotating wallpaper, updated depending on the time of day, or some other scheme, then the answer is: it's possible, and there's even a native function in Ubuntu already!

Background: In an earlier version of Ubuntu, I can't remember which one, I've noticed there were some desktop wallpapers in System Settings which had the added-feature of being time-of-day-dependent - but I never found much more about it, or details on how it worked. Also, I've never actually tried it. But the idea of having a desktop wallpaper which changed over time sounded interesting. I think Windows Vista made it popular, naming it "Dreamscenes". Think of slowly waving grass, or some landscape complete with sunrise and sunset. Wouldn't that be great? Well, now I know more about it, and it turns out, you can have a changing background natively on Ubuntu, but something like weaving grass it not yet in reach.

The native Ubuntu rolling/rotating/cyclic/live/pseudo-animated wallpaper (the best solution)

ubuntu-wallpaper Did you ever notice that some wallpapers have these small clock icons in their lower right corner? This screenshot is from System Settings > Appearance. Selecting one of these (might even occur when hovering over them) will bring up a note, telling you something along the line of "this wallpaper will change over time", or "over the course of a day". Actually this is a GNOME feature (via), introduced somewhere around GNOME 2.28, and something similar has been available on KDE earlier as well.

Now, when you dig into where Ubuntu desktop themes, and their bundled wallpaper art, which are in /usr/share/themes and /usr/share/backgrounds - or in case you've already selected such a "live" wallpaper, you can discover where it comes from with How to find the path of the image currently used as Ubuntu desktop wallpaper. OK, so when you check out background files, you'll notice that some of these are actually XML files, like trusty.xml (named <Ubuntu code-name>.xml, for the version they shipped with). These files control what seems to be called a "background slideshow". They contain simple rules for interval, image, etc.:

<background>
<starttime>
<year>2009</year>
<month>08</month>
<day>04</day>
<hour>00</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at midnight. -->
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/Sea_Fury_by_Ian_Worrall.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/Sea_Fury_by_Ian_Worrall.jpg</from>
<to>/usr/share/backgrounds/Reflections_by_Trenton_Fox.jpg</to>
</transition>
<static>

I don't know how this is implemented, as I haven't found the docs for this feature, but it's probably controlled by unity or nautilus. In terms of "frame-rate", it seems even changing the wallpaper every few seconds is okay, although the shipped file does a change every few hours. The starttime tag suggests, you can pin slideshow cycles to a specific time-base, so the fades happen at certain times of day and "feel live" - depending on what you display. I'm still unsure on what starttime is based, it's not UNIX epoch, or has some bugs, I don't know but when I set it to be based on midnight, it was always off with a test wallpaper rotating every hour. But I found it reacts to local time stting, so it's based on what you set your time to in System Settings.

Anyway, you can create additional slideshow rules files, only be sure to add them to the /usr/share/gnome-background-properties/ubuntu-wallpapers.xml file (or any other file in /usr/share/gnome-background-properties, actually) which has one entry for all the items which show up in Settings > Appearance > Wallpapers.

If you don't feel like hand-rolling XML, you can use these GUI tools to do so: crebs and gnome-wallpaper-slideshow (both Python, GTK scripts).

Further reading:

A manual, DIY, scripted cronjob way of exchanging the wallpaper (works, but feels like a hack)

The idea of this approach is to have some script alter your background wallpaper image file based on some interval or scheme. This page here, for example, gives instructions on how to set-up the sunlight map of the earth from die.net as backdrop, and replace it regularly via cron-job, using gnome-schedule, so tinkering with cron becomes more convenient for the average user.

Peter Levi wrapped this idea into an app (I haven't tested). Variety is a "wallpaper changer". It has all sorts of bells and whistles, you can share you wallpaper, download wallpapers from the web, etc. But it's a little more intrusive, as it starts as a "system-service", minimized in the tray, and has to remain running to work. So it's not using cron (I think). Something like realtime sunlight wallpaper is doing the same, I think.

People do the same on Windows, as it seems.

A really "animated wallpaper", or real video as desktop backdrop (the non-working really hackish solution)

This is the feature that is not really possible on Ubuntu (as of Ubuntu 14.04). And the cause for me previously answering my own question with "no, it's not (yet) possible". I've looked around and tried one solution, only to find it's a road of pain. There are some hacks, or workarounds, and experimental solutions, but desktop icons will disappear. Tell me in case you got it working.

xwinwrap for example will launch an instance of mplayer in full-screen mode and try to configure it frame-less and as the lowest window in your stack of xwindows.

Via askubuntu, I've also found reference of something called a-desk, but it seems dead.

And then there's Live Wallpaper (also via), which seems to work, but is not (?) really showing arbitrary videos, but all sorts of things possible via OpenGL, so looking quite "animated", when you got it working, which seems a bit bumpy via ppa etc. I just wasn't inclined to try another non-working effort, so I'm just mentioning it here, untested.

Leave a Reply

=