EDIT: Un tuto complet avec les scripts et xml mis à jours sont disponibles ici
http://forum.ubuntu-fr.org/viewtopic.php?id=262792
On peut même s'amuser à creer un wallpaper dynamique en fonction de la météo et de l'heure de la journé.
Pour cela, dans votre dossier background, remplacer le script météo2.sh par celui-ci
meteo2.sh
#!/bin/bash
# Fichier où sont stockées les informations
SRCFILE=/tmp/meteo.txt
# Traitement
RESULTAT=$(grep "$1" $SRCFILE | awk -F " : " '{print $2}')
# Transformation de la condition en fond d'écran
echo "$1" | grep -i -q 'condition'
if echo "$RESULTAT" | grep -i -q 'partly cloudy'; then
cp -f partly_cloudy.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'fair'; then
cp -f fair.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'sunny'; then
cp -f sunny.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'cloudy'; then
cp -f cloudy.xml background.xml
elif echo "$RESULTAT" | grep -E -i -q 'storm|thunder'; then
cp -f storm.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'snow'; then
cp -f snow.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'rain'; then
cp -f rain.xml background.xml
elif echo "$RESULTAT" | grep -i -q 'shower'; then
cp -f shower.xml background.xml
fi
Puis copiez coller les fichiers XML suivants
cloudy.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/cloudy1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/cloudy1.jpeg</from>
<to>/home/emris/background/cloudy2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/cloudy2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/cloudy2.jpeg</from>
<to>/home/emris/background/cloudy3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/cloudy3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/cloudy3.jpeg</from>
<to>/home/emris/background/cloudy4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/cloudy4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/cloudy4.jpeg</from>
<to>/home/emris/background/cloudy1.jpeg</to>
</transition>
</background>
fair.xml
background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/fair1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/fair1.jpeg</from>
<to>/home/emris/background/fair2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/fair2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/fair2.jpeg</from>
<to>/home/emris/background/fair3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/fair3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/fair3.jpeg</from>
<to>/home/emris/background/fair4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/fair4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/fair4.jpeg</from>
<to>/home/emris/background/fair1.jpeg</to>
</transition>
</background>
party_cloudy.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/party_cloudy1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/party_cloudy1.jpeg</from>
<to>/home/emris/background/party_cloudy2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/party_cloudy2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/party_cloudy2.jpeg</from>
<to>/home/emris/background/party_cloudy3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/party_cloudy3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/party_cloudy3.jpeg</from>
<to>/home/emris/background/party_cloudy4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/party_cloudy4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/party_cloudy4.jpeg</from>
<to>/home/emris/background/party_cloudy1.jpeg</to>
</transition>
</background>
rain.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/rain1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/rain1.jpeg</from>
<to>/home/emris/background/rain2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/rain2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/rain2.jpeg</from>
<to>/home/emris/background/rain3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/rain3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/rain3.jpeg</from>
<to>/home/emris/background/rain4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/rain4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/rain4.jpeg</from>
<to>/home/emris/background/rain1.jpeg</to>
</transition>
</background>
shower.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/shower1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/shower1.jpeg</from>
<to>/home/emris/background/shower2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/shower2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/shower2.jpeg</from>
<to>/home/emris/background/shower3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/shower3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/shower3.jpeg</from>
<to>/home/emris/background/shower4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/shower4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/shower4.jpeg</from>
<to>/home/emris/background/shower1.jpeg</to>
</transition>
</background>
snow.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/snow1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/snow1.jpeg</from>
<to>/home/emris/background/snow2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/snow2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/snow2.jpeg</from>
<to>/home/emris/background/snow3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/snow3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/snow3.jpeg</from>
<to>/home/emris/background/snow4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/snow4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/snow4.jpeg</from>
<to>/home/emris/background/snow1.jpeg</to>
</transition>
</background>
storm.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/storm1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/storm1.jpeg</from>
<to>/home/emris/background/storm2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/storm2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/storm2.jpeg</from>
<to>/home/emris/background/storm3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/storm3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/storm3.jpeg</from>
<to>/home/emris/background/storm4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/storm4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/storm4.jpeg</from>
<to>/home/emris/background/storm1.jpeg</to>
</transition>
</background>
sunny.xml
<background>
<starttime>
<year>2007</year>
<month>09</month>
<day>26</day>
<hour>07</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/sunny1.jpeg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/home/emris/background/sunny1.jpeg</from>
<to>/home/emris/background/sunny2.jpeg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 2 hours ending at 3 PM. -->
<static>
<duration>7200.0</duration>
<file>/home/emris/background/sunny2.jpeg</file>
</static>
<!-- It's 3 PM, and we're starting to transition to sunset. Transition completes at 6 PM. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/sunny2.jpeg</from>
<to>/home/emris/background/sunny3.jpeg</to>
</transition>
<!-- It's 6 PM, and it's sunset, for an hour. Ends at 7. -->
<static>
<duration>3600.0</duration>
<file>/home/emris/background/sunny3.jpeg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 3 hours up until 10pm. -->
<transition type="overlay">
<duration>10800.0</duration>
<from>/home/emris/background/sunny3.jpeg</from>
<to>/home/emris/background/sunny4.jpeg</to>
</transition>
<!-- It's 10pm. It'll stay dark for 7 hours up until 5 AM. -->
<static>
<duration>25200.0</duration>
<file>/home/emris/background/sunny4.jpeg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/home/emris/background/sunny4.jpeg</from>
<to>/home/emris/background/sunny1.jpeg</to>
</transition>
</background>
N'oubliez pas de renommer les chemins vers vos dossier background. Ensuite, faites chauffez the gimp, car pour chaque conditions météo (les 8 de mon précédent post) il faudra créer 4 images correspondant au moment de la journé.
Par exemple, pour la condition sunny creer 4 images Aurore -> jour -> crepuscule -> nuit
correspondant à sunny1 -> sunny2 -> sunny3 -> sunny4.
Les scipts meteo.sh et meteo1.sh restent les mêmes. Il faut toujours placer meteo.sh au demmarage. Redemarrer. Faire pointer gnome vers le fichier background.xml généré par le script, et voilà ça sera mis à jour, le fichier xml se chargeant du calage horaire et le script du calage climatique
:cool: 😃