PDA

View Full Version : XML Question Regarding Time Synchronizing.


notcoolenough
Sep 10, 2015, 05:41 PM
I am posting this here because it is an XML question, but it applies to my Ubuntu Linux Wallpaper. My wallpaper is an XML file that displays 8 wallpaper photos, slightly altered, to reflect the time of day. I got it off the internet and it was made years ago. It is great and it works, but it is out of sync.

The slideshow SHOULD start over again at midnight, making it's first change at 5am. The duration times of each transition from one photo to the next all add up to 24 hours. My problem is that it seems to be starting at around 5PM instead and I cannot figure out why. I have played around with the duration times, but nothing works. At the moment, I just have it changing every hours which is working, but I would love to simplify the file since half of it is nearly redundant.

Here is the original markup:


<background><starttime>
<year>2015</year>
<month>09</month>
<day>08</day>
<hour>0</hour>
<minute>0</minute>
<second>01</second>
</starttime>


<static>
<duration>18000.0</duration>
<file>/home/b/Pictures/Wallpapers/AllDayLong/08.jpg</file>
</static>
<!-- it is now 5h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/08.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/01.jpg</to>
</transition>
<!-- it is now 7h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/01.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/02.jpg</to>
</transition>
<!-- it is now 9h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/02.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/03.jpg</to>
</transition>
<!-- it is now 11h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/03.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/04.jpg</to>
</transition>
<!-- it is now 13h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/04.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/05.jpg</to>
</transition>
<!-- it is now 15h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/05.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/06.jpg</to>
</transition>
<!-- it is now 17h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/06.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/07.jpg</to>
</transition>
<!-- it is now 19h -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/b/Pictures/Wallpapers/AllDayLong/07.jpg</from>
<to>/home/b/Pictures/Wallpapers/AllDayLong/08.jpg</to>
</transition>
<!-- it is now 21h -->
<static>
<duration>10800.0</duration>
<file>/home/b/Pictures/Wallpapers/AllDayLong/08.jpg</file>
</static>
<!-- it is now 0h -->
</background>
<wallpaper deleted="false">
<name>AllDayLong</name>
<filename>/path/to/AllDayLong/AllDayLong.xml</filename>
<options>zoom</options>
</wallpaper>

I am knowledgeable in HTML, but have had no formal training in XML but grasp it fairly well. Not enough to figure out my problem, obviously.

Thanks in advance.

CravenMorhead
Sep 11, 2015, 07:08 AM
Hi,

Two school of thoughts. The first is, if it works then let it go. Second is to get it working right. You have the first done.

It looks like it is starting at noon... so start your calculations such that it starts at 12h instead of 0 hour.

So the first step is set the wall paper for 11am (04.jpg) . Wait an hour(3600), change to the 1pm wallpaper (13h, 05.jpg), and continue from there.

You could also figure out why your clock is off. Is your clock set right? Is this starting on UTC or GTM or EST (your time zone if I am not mistaken)? Check for external factors. You could have your clock set to +7 instead of -5 which would give you the almost correct time. Only off my 12 hours.

notcoolenough
Sep 11, 2015, 05:31 PM
Thanks for the reply. I willt ry what you said. My clock is sync'd to internet time. I believe it is minus 7. I am away from my laptop right now so I can't double-check.Thanks again, and if what you suggested doesn't fix it I will just leave it at what it is now.