2

I have a problem with a wallpaper slideshow that I created (I am using GNOME 3 classic interface on Oneiric Ocelot).

I followed the new "standard procedure" to create a new slideshow background on Ubuntu 11.10, as I read in some other topics here (i.e. I created a new .xml file for background slideshows, containing the locations of the pictures I wanted to show in it; then, I edited the background-1.xml file in usr/share/gnome-background-settings adding my new background file location to make it appear in the "Appearance" menu, from which I selected it).

The problem that I have now is that my slideshow is behaving in a weird way: the pictures change in a totally random manner (I set 600 in the time field, which stands for 10 minutes, but instead they change every 2-3 minutes); even more, the picture rotating are actually only a few from the original ones that I set in the .xml file, and they rotate in a random order!

I thought that maybe the problem was in some syntax error I made in the .xml file, but I deleted and created a new .xml file (with a new file location, too) for 3-4 times and I still get the same errors! Maybe the first version of the file is somehow still memorized somewhere, and it is causing the newer versions of the file to have all of these problems?

Thanks to anyone who manages to help me with this! :)

(Edit) Here is the XML file I used, I changed the location to a random /Location/, anyway the location in the original file is correct, because it has no problem locating the pictures:

<background>
  <starttime>
    <year>2009</year>
    <month>08</month>
    <day>04</day>
    <hour>00</hour>
    <minute>00</minute>
    <second>00</second>
  </starttime>
  <static>
    <duration>600.0</duration>
    <file>/Location/1.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/1.jpg</from>
    <to>/Location/2.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/2.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/2.jpg</from>
    <to>/Location/3.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/3.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/3.jpg</from>
    <to>/Location/4.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/4.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/4.jpg</from>
    <to>/Location/5.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/5.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/5.jpg</from>
    <to>/Location/6.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/6.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/6.jpg</from>
    <to>/Location/7.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/7.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/7.jpg</from>
    <to>/Location/8.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/8.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/8.jpg</from>
    <to>/Location/9.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/9.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/9.jpg</from>
    <to>/Location/10.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/10.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/10.jpg</from>
    <to>/Location/11.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/11.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/11.jpg</from>
    <to>/Location/12.jpg</to>
  </transition>
  <static>
    <duration>600.0</duration>
    <file>/Location/12.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/Location/12.jpg</from>
    <to>/Location/1.jpg</to>
  </transition>
</background>
5
  • Please post contents of the xml file so this question can be troubleshooted easier. Dec 5, 2011 at 18:36
  • 1
    Have you considered wallch instead? askubuntu.com/questions/134/…
    – fossfreedom
    Dec 5, 2011 at 18:37
  • @fossfreedom Thank you, I already knew about it but I prefer not to have additional applications running in the background, since it would mean an addictional weight on the memory and all, and my computer isn't very performing.
    – plodjine
    Dec 5, 2011 at 18:42
  • @Bruno Pereira I added the code in the first post!
    – plodjine
    Dec 5, 2011 at 19:04
  • @plodjine Did you resolve your issue? If so, how? Were any of these answers helpful?
    – TheGeeko61
    Jan 4, 2012 at 19:38

1 Answer 1

2

Solution

  1. Place the script below in the /usr/share/backgrounds directory.
  2. Run it once as root.
  3. Whenever you add pictures to this directory make sure you re-run the script.
#!/bin/bash
# --------
# Filename fix.sh, by Dean Smith
# Run this script once. Thereafter save your best backgrounds in the /usr/share/backgrounds directory.
# Each time just run this script to let Ubuntu know you have the new pictures...
# AND you can have them auto-rotate if you select the second picture with the clock on it !!
# --------
NewXML=/usr/share/gnome-background-properties/ubuntu-wallpapers.xml
NewCnt=/usr/share/backgrounds/contest/background-1.xml
BGFileDir=/usr/share/backgrounds
# --------
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi
echo Running as root
# --------
cd $BGFileDir
cd ..
chmod -R 777 backgrounds
chown -R root backgrounds
echo 'directories set so you can add your backgrounds to '$BGFileDir' as jpg'
# --------
cd $BGFileDir
rename "s/ *//g" *.jpg
echo 'Stripped any spaces in the file name'
# --------
myn=1
for FILE in $BGFileDir/*.jpg
do
  fname=$(basename $FILE)
  fbname=${fname%.*}
  ftwo=${fbname:0:2}
  if [ $ftwo != "OK" ]
  then
    NEWNAME="OK$myn.jpg"
    while [ -f $NEWNAME ]
    do
      #echo $NEWNAME exists, trying a number up
      let myn=myn+1
      NEWNAME="OK$myn.jpg"
    done
    #echo $FILE will become $NEWNAME
    mv $FILE $NEWNAME
    let myn=myn+1
  fi
done
let myn=myn-1
echo 'Added '$myn' new files to list'
# -----------------------------------------------------------------
echo '' > $NewXML
echo '' >> $NewXML
echo '' >> $NewXML
# -----
myn=1
for FILE in $BGFileDir/*.jpg
do
  if [ $myn = 2 ]
  then
    echo '' >> $NewXML
    echo '  Contest' >> $NewXML
    echo '  '$FILE'' >> $NewXML
    echo '  zoom' >> $NewXML
    echo '' >> $NewXML
  else
    echo '' >> $NewXML
    echo '  '$myn'' >> $NewXML
    echo '  '$FILE'' >> $NewXML
    echo '  zoom' >> $NewXML
    echo '  #2c001e' >> $NewXML
    echo '  #2c001e' >> $NewXML
    echo '  solid' >> $NewXML
    echo '' >> $NewXML
  fi
let myn=myn+1
done
echo '' >> $NewXML
echo 'Wallpaper list for Ubuntu reset and updated'
# -----------------------------------------------------------------
echo '' > $NewCnt
echo '  ' >> $NewCnt
echo '    2009' >> $NewCnt
echo '    08' >> $NewCnt
echo '    04' >> $NewCnt
echo '    00' >> $NewCnt
echo '    00' >> $NewCnt
echo '    00' >> $NewCnt
echo '  ' >> $NewCnt
# -----
myn=1
for FILE in $BGFileDir/*.jpg
do
  if [ $myn = 1 ]
  then
    LoopBackFile=$FILE
  else
    echo '  '$FILE'' >> $NewCnt
    echo '' >> $NewCnt
  fi
  echo '' >> $NewCnt
  echo '  600' >> $NewCnt
  echo '  '$FILE'' >> $NewCnt
  echo '' >> $NewCnt
  echo '' >> $NewCnt
  echo '  5.0' >> $NewCnt
  echo '  '$FILE'' >> $NewCnt
  let myn=myn+1
done
echo '    '$LoopBackFile'' >> $NewCnt
echo '  ' >> $NewCnt
echo '' >> $NewCnt
echo 'Timed Wallpaper list for Ubuntu reset and updated'
# -----
1
  • The above script worked for me. I placed my images in /usr/share/backgrounds, I created the script there, chmod 755 the script, and ran it. The background-1.xml was updated and now the slideshow works.
    – user40509
    Jan 4, 2012 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .