How to edit "Cosmos" theme and put whatever image you'd like and have them changing automatically

Hey folks, i've been using Ubuntu MATE for 2 years now and i really like this distro, one thing that i missed when i moved from windows to Ubuntu MATE though was that huge variety of themes that we don't have on Ubuntu, however, after a little research i figured out how to edit the "Cosmos" theme (/usr/share/backgrounds) which is the only pre-installed one on the system and change the duration(kind of) and specially the images of the theme, so first things first. Let's cut to the chase.

  • Step 1: Open caja as super user through terminal: sudo caja

  • Step 2: Go to /usr/share/backgrounds, there you'll find a folder called cosmos, so just for safety's sake create a copy of that folder (ctrl+c, ctrl-v) and rename the copy of it for something like "cosmos1"

Suggestion: Just to make this method easier, rename all images you're intending to replace to numbers in an ascending order preferably(1, 2, 3 and so on)

  • Step 3: Open the text file inside the original folder, there's only one in there(background-1.xml) and there you'll find a XML structure. like this:

Just ignore the block below

  <starttime>
    <year>2009</year>
    <month>08</month>
    <day>04</day>
    <hour>00</hour>
    <minute>00</minute>
    <second>00</second>
  </starttime>

Ok, the <static> tag means that the image referenced on the tag will be on the screen for x seconds referenced on the <duration> tag, (i think it's seconds because each image lasts around 29 minutes in my case using 1795 seconds as you can see below):

<static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/cosmos/1.jpg</file>
</static>

And the <transition> tag means, yeah, transition :stuck_out_tongue_winking_eye:
Actually it means that you're going from one file to another, in the example below, from 1.jpg image file to 2.jpg and you'll see a repetition of those tags all over the text file and that's how you go from an image file to another. The order is: <transition> -> <static> -> <transition> -> <static> and so forth

<transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/cosmos/1.jpg</from>
    <to>/usr/share/backgrounds/cosmos/2.jpg</to>
</transition>
<static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/cosmos/2.jpg</file>
</static>

So, this takes us to the last and final step, FINALLY

  • Step 4:
    After editing the background-1.xml file and putting the names of the images you want to replace, you'll just have to paste all of them inside the "cosmos" folder and save the file. And that's it. I've been using this workaround(While MATE team doesn't create a theme manager like the one on windows, that i'm pretty sure they'll create for 20.04 LTS) for years now and it's time to share my own set of wallpapers and my own xml file with you guys, so here it is: https://drive.google.com/open?id=1MIpK_wr1GAkPQGdXx_iJpYT7LwlsZ8mR

I really hope i have helped at least one of you guys and if you have any questions about it, just leave a comment and i'll try to help you with that. That's all folks :sunglasses:

1 Like

I simply installed Variety from the repository. It changes the desktop background automatically according to a time interval you want. Wallpapers are obtained from a variety of sources like Flickr, Bing, etc. The app even lets you tag any walllpaper you want as a favorite and downloads it to a folder of your choosing.

But if you already have your own wallpaper collection and don’t want to access the net automatically to download wallpapers, then your method is the one to use.

Thanks for the tip! :slight_smile:

1 Like

Anytime. Glad you liked it. Thanks for your tip as well @checkmate