Add extra backgrounds

You can make extra backgrounds available to users on your system by following the steps below.

Set extra backgrounds

  1. Create an XML file, for example filename.xml. In this file, use keys from the org.gnome.desktop.background GSettings schema to specify extra backgrounds and their appearance.

    Below is a list of the most frequently used keys:

    org.gnome.desktop.background schemas GSettings keys

    Key name

    Possible values

    Description

    picture-options

    "none", "wallpaper", "centered", "scaled", "stretched", "zoom", "spanned"

    Determines how the image set by wallpaper_filename is rendered.

    color-shading-type

    "horizontal", "vertical", and "solid"

    How to shade the background color.

    primary-color

    default: #023c88

    Left or top color when drawing gradients, or the solid color.

    secondary-color

    default: #5789ca

    Right or bottom color when drawing gradients, not used for solid color.

    You can view a complete list of org.gnome.desktop.background keys and possible values using dconf-editor or the gsettings command-line utility. See Browse GSettings values for your applications for more information.

    Below is a sample filename.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
    <wallpapers>
      <wallpaper deleted="false">
        <name>Company Background</name>
        <name xml:lang="de">Firmenhintergrund</name>
        <filename>/usr/local/share/backgrounds/company-wallpaper.jpg</filename>
        <options>zoom</options>
        <shade_type>solid</shade_type>
        <pcolor>#ffffff</pcolor>
        <scolor>#000000</scolor>
      </wallpaper>
    </wallpapers>
    
  2. Place the filename.xml file in the /usr/share/gnome-background-properties/ directory.

    Users will have the extra backgrounds available for configuration from Settings ▸ Background.

Specify multiple backgrounds

In one configuration file, you can specify multiple <wallpaper> elements to add more backgrounds.

See the following example with two <wallpaper> elements, adding two different backgrounds:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
  <wallpaper deleted="false">
    <name>Company Background</name>
    <name xml:lang="de">Firmenhintergrund</name>
    <filename>/usr/local/share/backgrounds/company-wallpaper.jpg</filename>
    <options>zoom</options>
    <shade_type>solid</shade_type>
    <pcolor>#ffffff</pcolor>
    <scolor>#000000</scolor>
  </wallpaper>
  <wallpaper deleted="false">
    <name>Company Background 2</name>
    <name xml:lang="de">Firmenhintergrund 2</name>
    <filename>/usr/local/share/backgrounds/company-wallpaper-2.jpg</filename>
    <options>zoom</options>
    <shade_type>solid</shade_type>
    <pcolor>#ff0000</pcolor>
    <scolor>#00ffff</scolor>
  </wallpaper>
</wallpapers>