customization - Where does Ubuntu store the picture that I set as my desktop?

23
2014-04
  • Ryan Thompson

    I have a pretty picture set as my desktop background, but I've lost the original file. However, my desktop is still set to this picture. How can I get back my picture?

  • Answers
  • fluteflute

    Open up the file browser and press Ctrl+H, to show hidden files (ones that start with a .), now navigate to .cachewallpaper.

    Or hit Alt+F2 and type nautilus .cache/wallpaper/

    alt text

  • fluteflute

    If your image came from the internet, then I would suggest taking a Screenshot (Applications->Accessories->Take Screenshot).

    Then upload your screenshot to TinEye.com. On the results page select "Biggest Image" from the left hand side navigation. Then look to see if the website has found your image.

    This "Reverse Image Search" has enabled me to do what you're doing before.

  • fluteflute

    If you run gconftool --get /desktop/gnome/background/picture_filename in a terminal then it will output the location of the image file.

    (GConf is the GNOME settings manager, and /desktop/gnome/background/picture_filename is the particular setting you are retrieving. You can also browse these settings graphically by using the gconf editor.)

    Or hit Alt+F2 and type

     eog `gconftool --get /desktop/gnome/background/picture_filename`
    

    (this opens your image with the default image viewer, Eye of GNOME)

  • Aditya

    In the case when you absolutely misplace a file and aren't able to get online to ask about the location of where it might be stored, always remember this... it has helped me a lot throughout the years.

    CTRL + ALT + T to get shell, then:

    locate (type file name you are looking for here, without the parentheses)

    NOTE: if you've never used locate before you'll need to run updatedb first like this:

    sudo updatedb
    

    or if you are already root, just run updatedb, usually it can take time so I run it in the background like this:

    sudo updatedb &
    

    the & causes the command to be run in the background, you can type jobs to see if its still running, but you'll get notified when it terminates like this:

    [1]+ Done     updatedb
    

    Some people hate the shell, but even so, I have found it good to learn both GUI and shell no matter what OS you are using. There ARE going to be times when something can't be done via the GUI, esp in a linux environment. This was very true when it came to bridging ethernet interfaces, etc..


  • Related Question

    appearance - How do I create a desktop wallpaper slideshow?
  • David Siegel

    How do I create a desktop wallpaper slideshow with my own set of images?

    • With the images coming from a pictures folder, or pre-selected
    • With the images displayed in order, or randomly
    • With the images changing every few minutes, or after random periods of time

  • Related Answers
  • snostorm

    For 11.04 and previous versions

    There's a program for creating wallpaper slideshows called CREBS. Check out this article about it: http://www.omgubuntu.co.uk/2010/05/crebs-the-ultimate-wallpaper-slideshow-application

    A simpler app that has fewer features but is easier to use can be found here: http://gnome-look.org/content/show.php/Wallpaper+Slideshow?content=125178

    alt text

  • fossfreedom

    Wallch

    In software center there are two wallpaper changer - wallch for Gnome-Shell/Unity/Gnome-Classic and Wally for KUbuntu.

    Lets concentrate on Wallch.

    enter image description here

    Install and then start from Dash:

    enter image description here

    Lets now launch the application preferences:

    enter image description here

    Let's untick the bubble notification - its annoying - at the same time you could disable sounds!

    enter image description here

    At the same time you can define the start-up options:

    enter image description here

    Save - and add a folder of pictures - in this example, use /usr/share/backgrounds for the default wallpapers that come with Ubuntu

    enter image description here

    Now we've got two choices:

    Start up choice 1

    (thanks @Naruto)

    keep wallch in in the launcher

    enter image description here

    exit wallch and start changing wallpapers

    enter image description here

    Start up choice 2

    start wallch on login without needing to have a launcher

    From the dash:

    enter image description here

    Then create a new startup application with the command wallch --constant

    enter image description here

    N.B. - for some computers this will not work. The solution is to introduce a delay to the startup of the wallch daemon as per the following Q&A:

    Wallch not auto-cycling backgrounds on log in

  • Jakob

    If you use it to manage your photos and like it easy I recommend to use Shotwell, which should be installed by default.

    Open it:

    open shotwell

    Select the photos you want to be set as background slideshow:

    select images

    Open FileSet as Desktop Slideshow or press Ctrl+B:

    set as slideshow

    Adjust time settings:

    set time

    Done.

  • Pisu

    Create xml file yourself. Use this script as a starting point with caution, it may have some errors.

    #!/bin/bash
    
    SAVEIFS=$IFS
    IFS=$(echo -en "\n\b")
    
    FILE="background.xml"
    DURATION=10.0
    TRANSITION=0.0
    
    # Random order
    IMGS=($(ls *.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF} 2>/dev/null | sort -R))
    COUNTER=`expr ${#IMGS[*]} - 1`
    CURRENTDIR=$(pwd)
    
    echo "<background><starttime></starttime>" > $FILE
    
    for ((i=0;  i<$COUNTER; i++))
    do
        echo "<static><duration>$DURATION</duration><file>$CURRENTDIR/${IMGS[$i]}</file></static>" >> $FILE
        echo "<transition><duration>$TRANSITION</duration><from>$CURRENTDIR/${IMGS[$i]}</from>" >> $FILE
        echo "<to>$CURRENTDIR/${IMGS[`expr $i + 1`]}</to></transition>" >> $FILE
    done
    
    # last picture to first one
    echo "<static><duration>$DURATION</duration><file>$CURRENTDIR/${IMGS[$COUNTER]}</file></static>" >> $FILE
    echo "<transition><duration>$TRANSITION</duration><from>$CURRENTDIR/${IMGS[$COUNTER]}</from>" >> $FILE
    echo "<to>$CURRENTDIR/${IMGS[0]}</to></transition>" >> $FILE
    
    echo "</background>" >> $FILE
    
    IFS=$SAVEIFS
    
  • guntbert

    I like variety.

    sudo add-apt-repository ppa:peterlevi/ppa
    sudo apt-get update
    sudo apt-get install variety
    

    I am using Ubuntu 13.04.

  • Pykler

    For gnome 3, generate the xml using one of the previous answers, then you could add the generated xml via the command line:

    gsettings set org.gnome.desktop.background picture-uri 'file:///home/pykler/.backgrounds/realtime/background.xml'
    

    Another Solution (this will add your bg to the Appearance area under gnome-control-center):

    mkdir -p ~/.local/share/gnome-background-properties/
    
    cat >~/.local/share/gnome-background-properties/custom-wallpapers.xml <<EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
    <wallpapers>
      <wallpaper deleted="false">
        <name>Pykler</name>
        <filename>/home/pykler/.backgrounds/realtime/background.xml</filename>
        <options>zoom</options>
      </wallpaper>
     </wallpapers>
    EOF
    

    Replace the name "Pykler" and the path "/home/pykler/.backgrounds/realtime/background.xml" as needed.

  • Mandy

    For Gnome 3, you can use the Wallpaper Slideshow App.

    Wallpaper Slideshow App screenshot

    According to its developer, it has the following features:

    • Lets you choose the folder via a browser.
    • Lets you set the timeout in seconds.
    • Lets you chose depth of subdirectory.
    • You can enable or disable it with a single click.
    • Full-feature tooltips

    To download:

    git clone git://gitorious.org/gnome-3-wp/gnome-3-wp.git
    

    Then run wp-show in the gnome-3-wp folder in your home folder.

    For more information, see here and here.

  • fossfreedom

    Use cortina, it works pretty well.

    It can set the desktop background picture to be set a random file from a given directory.

    It can be installed via Ubuntu Software Center.

    Install via the software center

  • Agmenor

    You might be interested in a program that automatically creates such a wallpaper-slideshow.

    According to this OMG! Ubuntu post, you have for example 'Wallpaper Gallery'. It takes as input data tagged photos from your Shotwell gallery. Therefore it becomes very easy to add & remove photos for instance.

    First select the tags concerning the photos you want to be displayed, then configure as you wish the switching time, the order, etc. Here some screenshots :

    Wallpaper Gallery display options Wallpaper Gallery data source

  • Oltarus

    Yes, you can.

    Locate an already made animated wallpaper and modify it.

    For example, there should be one in /usr/share/backgrounds/contest (at least on Precise Pangolin).

    The file is called precise.xml in my case and it is an XML file. All you need to know to modify it is that any tag like <background> contains other tags and texts and must be closed with </background>.

    Try to find out what these tags mean (see below), change the name of these pictures and save as... somewhere. Call it whatever_you_want.xml.

    Then change your background: choose a new wallpaper by browsing your computer and, instead of choosing a .jpg, choose your .xml.

    Some tags:

    <background> contains everything. Your file must begin with it and end with </background>. It's called the root tag.
    <starttime> defines when the diaporama starts. A precise date must be given, any date.
    <static> contains the definition of a still image.
    <transition> is used to fade from one image to the other.
    <duration> gives in seconds the time during witch the picture is displayed or the fading time.
    <file> contains a single image to show as still.
    <from> and <to> contain single images which are respectively the one at the beginning and at the end of a fading.

    Some additionnal hints:

    By adding the number of seconds of all the <duration> tags in the file, you'll know how much time it takes to perform a complete loop of the diaporama.

    The nicest configuration is this one (simplified, without durations):
    <static>
    <file>image1</file>
    </static>
    <transition>
    <from>image1</from>
    <to>image2</to>
    </transition>
    <static>
    <file>image2</file>
    </static>
    <duration>
    <from>image2</from>
    <to>image3</to>
    </duration>
    ...

    Don't forget to end your diaporama with a transition to your first picture, or else it will abruptly change from one static to another.

    I tried to do an animated background, once. Images displayed less than 1 second each. You can try it for fun, but frankly, you'll want to throw your mouse to the monitor before the end of the day.

  • Joe

    I wanted the changing wallpaper and custom wallpaper pictures to appear under the default options for selecting a wallpaper in Ubuntu 12.04,so I did the following

    Using Terminal navigate to:

    /usr/share/gnome-background-properties
    

    typing ls will list all files in that folder you should see a file called precise-wallpapers.xml, back it up in case something goes wrong

    sudo cp ./precise-wallpapers.xml ~
    

    then edit it to add wallpapers that you want to appear in your default wallpaper options

    sudo gedit precise-wallpapers.xml
    

    this is how I added a polarbears wallpaper, previously I copied the precise.xml located in the contest folder and edited it with pictures that I wanted to display:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
    <wallpapers>
      <wallpaper deleted="false">
        <name>Ubuntu 12.04 Community Wallpapers</name>
        <filename>/usr/share/backgrounds/contest/precise.xml</filename>
        <options>zoom</options>
      </wallpaper>
      <wallpaper>
        <name>polarbears</name>
        <filename>/usr/share/backgrounds/polarbears/polarbears.xml</filename>
        <options>zoom</options>
      </wallpaper>
      <wallpaper>
        <name>Delicate Petals</name>
        <filename>/usr/share/backgrounds/Delicate_Petals_by_lefthandgergo.jpg</filename>
        <options>zoom</options>
        <pcolor>#000000</pcolor>
        <scolor>#000000</scolor>
        <shade_type>solid</shade_type>
      </wallpaper>
      <wallpaper>
    

    you can add regular jpg or png files, I recommend copying them to the /usr/share/backgrounds then adding them to this xml file. I hope this helps.

  • zpletan

    I wanted to do the same thing a while back; here is my script: http://pastebin.com/FkaxaN3J

    Just stick it in the directory, make executable, and run.

  • Jet

    Ok here is how I did it, which is probably not the best way to do it but it worked and I didn't have to install anything to do it. Back in 11.10 I found the below python script (slideshow.py) which generates a slideshow.xml file (run from directory with the images in it). This is still the file needed in 12.04 but you also need another XML file. Put the XML file generated by slideshow.py script in /usr/share/backgrounds/contest and chown it to root. Once that is done you'll need to run the second python script (wallpapers.py) which was adapted from the first. Put the file generated from wallpapers.py in /usr/share/gnome-background-properties and again chown it to root. At that point you should be able to go into "System Settings" -> Appearance and pick your slideshow or any of the pics in it.

    slideshow.py:

    #!/usr/bin/env python
    #coding=utf-8
    # slideshow.py
    import glob, os
    import shutil
    import time
    import Image
    
    filelist=[]
    def filelie(path):
        if os.path.isfile(path):
           wenjian=os.path.splitext(path)[1][1:]
           if wenjian=="jpg" or wenjian=="png" or wenjian=="gif":
            try:
              kuan,gao = Image.open(path).size
              if kuan>=1024 and gao>=768:
                filelist.append(path)
            except IOError:
             pass
        elif os.path.isdir(path):
            for item in os.listdir(path):
                itemsrc = os.path.join(path, item)
                filelie(itemsrc)
    
    curdir = os.getcwd()
    filelie(curdir)
    currentImageFiles = filelist
    #print filelist
    if os.path.isfile('slideshow.xml'):
     os.remove('slideshow.xml')
    
    
    currentTime = time.localtime()
    length = len(currentImageFiles)
    
    f = file('slideshow.xml', 'w')
    
    f.write('<background>\n')
    f.write('\t<starttime>\n')
    f.write('\t\t<year>' + str(currentTime.tm_year) + '</year>\n')
    f.write('\t\t<month>' + str(currentTime.tm_mon) + '</month>\n')
    f.write('\t\t<day>' + str(currentTime.tm_mday) + '</day>\n')
    f.write('\t\t<hour>' + str(currentTime.tm_hour) + '</hour>\n')
    f.write('\t\t<minute>' + str(currentTime.tm_min) + '</minute>\n')
    f.write('\t\t<second>' + str(currentTime.tm_sec) + '</second>\n')
    f.write('\t</starttime>\n')
    f.write('<!--This animation will start at the time it created-->\n')
    
    for i in currentImageFiles:
     length = length - 1
     f.write('\t<static>\n')
     f.write('\t\t<duration>96.0</duration>\n')
     f.write('\t\t<file>' + currentImageFiles[length] +'</file>\n')
     f.write('\t</static>\n')
     f.write('\t<transition>\n')
     f.write('\t\t<duration>3.0</duration>\n')
     f.write('\t\t<from>' + currentImageFiles[length] + '</from>\n')
     if length >= 1:
      f.write('\t\t<to>' + currentImageFiles[length-1] + '</to>\n')
     if length <1:
      f.write('\t\t<to>' + currentImageFiles[len(currentImageFiles)-1] + '</to>\n')
     f.write('\t</transition>\n')
    
    f.write('</background>\n')
    f.close()
    

    wallpapers.py:

    #!/usr/bin/env python
    #coding=utf-8
    import glob, os
    import shutil
    import time
    import Image
    
    filelist=[]
    def filelie(path):
        if os.path.isfile(path):
           wenjian=os.path.splitext(path)[1][1:]
           if wenjian=="jpg" or wenjian=="png" or wenjian=="gif":
            try:
              kuan,gao = Image.open(path).size
              if kuan>=1024 and gao>=768:
                filelist.append(path)
            except IOError:
             pass
        elif os.path.isdir(path):
            for item in os.listdir(path):
                itemsrc = os.path.join(path, item)
                filelie(itemsrc)
    
    curdir = os.getcwd()
    filelie(curdir)
    currentImageFiles = filelist
    #print filelist
    if os.path.isfile('mywallpapers.xml'):
     os.remove('mywallpapers.xml')
    
    
    currentTime = time.localtime()
    length = len(currentImageFiles)
    
    f = file('mywallpapers.xml', 'w')
    
    f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
    f.write('<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">\n')
    f.write('<wallpapers>\n')
    f.write('\t<wallpaper deleted="false">\n')
    f.write('\t\t<name>My custom Wallpapers</name>\n')
    f.write('\t\t<filename>/usr/share/backgrounds/contest/slideshow.xml</filename>\n')
    f.write('\t\t<options>zoom</options>\n')
    f.write('\t</wallpaper>\n')
    
    for i in currentImageFiles:
     length = length - 1
     f.write('\t<wallpaper>\n')
     f.write('\t\t<name>' + os.path.basename(currentImageFiles[length]) +'</name>\n')
     f.write('\t\t<filename>' + currentImageFiles[length] +'</filename>\n')
     f.write('\t\t<options>zoom</options>\n')
     f.write('\t\t<pcolor>#000000</pcolor>\n')
     f.write('\t\t<scolor>#000000</scolor>\n')
     f.write('\t\t<shade_type>solid</shade_type>\n')
     f.write('\t</wallpaper>\n')
    
    f.write('</wallpapers>\n')
    f.close()
    
  • ruffEdgz

    After seeing this request, I was curious about a solution and found something to be able to get your wallpaper image to be a part of the default wallpaper selection when going into System Settings >> Appearances. Follow the steps below in a terminal:

    1. cd /usr/share/gnome-background-properties
      • This will take you to the specific path mentioned
    2. sudo cp ./ubuntu-wallpapers.xml ~
      • This will copy the file ubuntu-wallpapers.xml into your home directory
    3. sudo vim ./ubuntu-wallpapers.xml
      • The command vim is a terminal editor but you can change it to gedit if you wish

    Once you are in that file, you will see tags called <wallpaper> and </wallpaper> that is around the other tags like <name> and <options>. You will need to copy that and paste it right below that entry. Once done, you should edit that extra entry you added to match what you want. An example can be found below:

    enter image description here

    In this example, I made changes to the <name>, <filename>, <pcolor>, and <scolor> information to match what I needed for the wallpaper I wanted. Now I see the wallpaper as a default selection in the wallpaper section of the System Settings -> Appearance GUI:

    enter image description here

    If anything doesn't work, use the following command to import back the save file we made from above:

    sudo cp ~/ubuntu-wallpapers.xml /usr/share/gnome-background-properties/

    Hope this helps.

  • Mitch

    Change it from appearance, under system settings as seen below

    enter image description here

    Or you can do so, by installing Desktop Nova. To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

    sudo apt-get install desktopnova desktopnova-tray desktopnova-module-gnome
    

    Once installed, search for it in Dash, and click on it, and when the program open, add your images, and setup the time interval.

    enter image description here

    enter image description here

    enter image description here

    Command complements of Desktopnova

  • dr_smit

    try slidewall as well, it has clock displayed..

  • Radu Rădeanu

    Go to System Settings > Appearance then mark the photo with clock on it at the right side.