Problema com o slideshow de papel de parede

2

Eu tenho um problema com um slideshow de papel de parede que eu criei (estou usando a interface clássica do GNOME 3 no Oneiric Ocelot).

Eu segui o novo "procedimento padrão" para criar um novo plano de apresentação de slides no Ubuntu 11.10, como li em alguns outros tópicos aqui (ou seja, criei um novo arquivo .xml para apresentações de slides em segundo plano, contendo os locais das fotos que eu queria para mostrar nele, editei o arquivo background-1.xml em usr / share / gnome-background-settings adicionando meu novo local de arquivo em segundo plano para que ele apareça no menu "Appearance", do qual eu o selecionei.

O problema que tenho agora é que meu slideshow está se comportando de uma maneira estranha: as imagens mudam de uma maneira totalmente aleatória (eu configurei 600 no campo de tempo, o que significa 10 minutos, mas em vez disso eles mudam a cada 2 3 minutos); ainda mais, a rotação da imagem é na verdade apenas algumas das originais que eu configurei no arquivo .xml, e elas rodam em uma ordem aleatória!

Eu pensei que talvez o problema estivesse em algum erro de sintaxe que eu cometi no arquivo .xml, mas eu deletei e criei um novo arquivo .xml (com um novo local de arquivo também) por 3-4 vezes e ainda recebo os mesmos erros! Talvez a primeira versão do arquivo seja de alguma forma ainda memorizada em algum lugar, e isso está causando as versões mais recentes do arquivo para ter todos esses problemas?

Obrigado a qualquer um que consiga me ajudar com isso! :)

(Edit) Aqui está o arquivo XML que eu usei, mudei o local para um random / Location /, de qualquer forma a localização no arquivo original está correta, pois não tem problema em localizar as imagens:

<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>
    
por plodjine 05.12.2011 / 19:31

1 resposta

2

Solução

  1. Coloque o script abaixo no diretório /usr/share/backgrounds .
  2. Execute uma vez como root.
  3. Sempre que você adicionar imagens a esse diretório, execute novamente o 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'
# -----
    
por Dean Smith 27.12.2011 / 14:46