Groovy, pour prendre en compte le brouillard:
Recupère déjà ces 4 images :








et renomme les fog1, 2, 3,et 4
Ensuite, il fut que tu crée un nouveau fichier .xml du nom de fog.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/fog1.jpg</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/fog1.jpg</from>
<to>/home/emris/background/fog2.jpg</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/fog2.jpg</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/fog2.jpg</from>
<to>/home/emris/background/fog3.jpg</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/fog3.jpg</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/fog3.jpg</from>
<to>/home/emris/background/fog4.jpg</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/fog4.jpg</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/fog4.jpg</from>
<to>/home/emris/background/fog1.jpg</to>
</transition>
</background>
Surtout n'oublie pas de remplacer le chemin aux images dans le fog.xml (ce n'est pas /home/emris/background...)
Ensuite copie ces lignes et enregistre les sous le nom meteo2.sh (autrement dit tu remplaces le contenu de ton meteo2.sh par ceci :
#!/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
elif echo "$RESULTAT" | grep -i -q 'fog'; then
cp -f fog.xml background.xml
fi
Je n'ai quasiment rien fais, juste rajouter cette ligne dans meteo2.sh:
elif echo "$RESULTAT" | grep -i -q 'fog'; then
cp -f fog.xml background.xml
Bon, je résume :
--- tu enregistres les images dans ton dossier background (et dans l'ordre) sous les noms fog1.jpg (matin), fog2.jpg(journée), fog3.jpg(soir) et fog4.jpg(nuit)
--- Tu rajoute un fichier fog.xml (dont le contenu est ci-dessus) dans ton dossier background (tu auras donc en tout 9 xml correspondant au 9 condition climatique)
--- Tu fait les changements de ton fichier meteo2.sh en rajoutant la condition "fog"
Voili, voilou...vivement qu'on ai du brouillard !!!😃
Tu me tiens au courant des suites...😉