PDA

View Full Version : [all variants] Wallpaper-automatic picture changing



nathand28
February 20th, 2009, 05:04 PM
I have setup an xml file to change the wallpaper after 10 seconds. This is my first time using xml, so it is just a test. I made a small png file, coloured it red and named it 1.png. I made a second file ,coloured it orange, and named it 2.png, and so on. The background is set to tile.

When the sequence reaches the 8th file, which is the last one, it displays for a few seconds, then changes to the solid colour set in the appearance preferences, which in my case, is white. About 10 seconds later it restarts the sequence.
I am wondering if it is possible have the 8th file display for 10 seconds, then restart, skipping the white screen.
Here is the xml file:



<background>

<static>
<duration>1.0</duration>
<file>/home/nathan/Desktop/Picture Test/1.png</file>
</static>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/1.png</from>
<to>/home/nathan/Desktop/Picture Test/2.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/2.png</from>
<to>/home/nathan/Desktop/Picture Test/3.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/3.png</from>
<to>/home/nathan/Desktop/Picture Test/4.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/4.png</from>
<to>/home/nathan/Desktop/Picture Test/5.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/5.png</from>
<to>/home/nathan/Desktop/Picture Test/6.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>~/Desktop/Picture Test/6.png</from>
<to>~/Desktop/Picture Test/7.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/7.png</from>
<to>/home/nathan/Desktop/Picture Test/8.png</to>
</transition>

<static>
<duration>0.0</duration>
<file>/home/nathan/Desktop/Picture Test/8.png</file>
</static>
</background>

_________________________________________________
Solved it, turned out that:
1. I hadn't made the script executable;
2. I had put in dir='pwd' instead of dir=`pwd`.

The install script is attached.

mcduck
February 20th, 2009, 05:32 PM
Make sure you haven't got any errors in the XML file and that all files are named correctly. It shouldn't ever go to background color unless it's missing one of the files.

Also you'll probably want to set time for the last image to something higher than 0,0.


<background>

<static>
<duration>1.0</duration>
<file>/home/nathan/Desktop/Picture Test/1.png</file>
</static>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/1.png</from>
<to>/home/nathan/Desktop/Picture Test/2.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/2.png</from>
<to>/home/nathan/Desktop/Picture Test/3.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/3.png</from>
<to>/home/nathan/Desktop/Picture Test/4.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/4.png</from>
<to>/home/nathan/Desktop/Picture Test/5.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/5.png</from>
<to>/home/nathan/Desktop/Picture Test/6.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/6.png</from>
<to>/home/nathan/Desktop/Picture Test/7.png</to>
</transition>

<transition type="overlay">
<duration>10.0</duration>
<from>/home/nathan/Desktop/Picture Test/7.png</from>
<to>/home/nathan/Desktop/Picture Test/8.png</to>
</transition>

<static>
<duration>10.0</duration>
<file>/home/nathan/Desktop/Picture Test/8.png</file>
</static>

</background>

edit: there's also some issues with quick transitions, and very high CPU usage isn't the only one of them. If you wish to actually use animated wallpaper themes I recommend minimum transition times of 10 minutes (which seems to be the limit when CPU usage drops to reasonable levels).

nathand28
February 20th, 2009, 07:19 PM
Thanks Mcduck. It was a very stupid error, I only had 7 files, plus the xml file.

nathand28
February 23rd, 2009, 05:35 PM
I've got that figured out, but how would I make an install script to change the paths to wherever the folder was?
Something like this:


dir=`pwd`

cat <<END_OF_XML > $xml
<background>

<static>
<duration>60.0</duration>
<file>$dir/1.png</file>
</static>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/1.png</from>
<to>$dir/2.png</to>
</transition>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/2.png</from>
<to>$dir/3.png</to>
</transition>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/3.png</from>
<to>$dir/4.png</to>
</transition>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/4.png</from>
<to>$dir/5.png</to>
</transition>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/5.png</from>
<to>$dir/6.png</to>
</transition>

<transition type="overlay">
<duration>60.0</duration>
<from>$dir/6.png</from>
<to>$dir/7.png</to>
</transition>

<static>
<duration>60.0</duration>
<file>$dir/7.png</file>
</static>

</background>

END_OF_XML

###END INSTALL SCRIPT

nathand28
February 25th, 2009, 06:02 PM
Bump

nathand28
March 1st, 2009, 05:31 PM
Bump

jjgomera
March 1st, 2009, 05:41 PM
i cant help with script, but i think program feh do what you look for

nathand28
March 1st, 2009, 05:54 PM
Is the prgram called feh?

jjgomera
March 1st, 2009, 06:04 PM
yes feh, it's in repo

nathand28
March 1st, 2009, 07:19 PM
Solved it, turned out that:
1. I haden't made the script executable;
2. I had put in dir='pwd' instead of dir=`pwd`.