I know there is a way to do this, but I just dumped a bunch of my favorite wallpaper files in /usr/share/backgrouds/. In order for my Ubutnu 17.10 to use them, I need to edit the artful-wallpapers.xml file and add each file name to a statement looking like this:
<wallpaper>
<name>calm</name>
<filename>/usr/share/backgrounds/02488_calm_1440x900.jpg</filename>
<options>zoom</options>
<pcolor>#000000</pcolor>
<scolor>#000000</scolor>
<shade_type>solid</shade_type>
</wallpaper>
This is long and tedious to do one at a time, and I am sure I have merged data before, but for the life of me I cannot remember how.
A script would be very helpful, or at least directions to a tutorial.
Thanks in advance.
Rod
XML Format Filenames in Folder via Bash Script
You can accomplish this easily with a bash script. This will output all the xml you need so you can copy/paste it into artful-wallpapers.xml.
This script will take all filenames in current folder and format it into the XML from your question. You can easily modify it to fit your needs.
The BASH Script
How to use it
Create a folder in your home folder called 'wallpapers' and put all the images you want to use in this folder.
Place above script in a plain-text file called makeXML inside the folder with your photos (~/wallpapers). Run from the terminal:
Paste the output on the screen into your x-wallpapers.xml file inside the wallpapers tag.
Finally move all the images from ~/wallpapers to /usr/share/backgrounds and delete the wallpapers folder.