Bonjour,
Effectivement, je pense qu'il est plus facile de le faire en svg.
J'ai déja un script qui tourne, fait en bash, qui affiche le parcours réel de la lune.
Mais, actuellement, n'ayant pas les calques, la lune est au dessus du fond...
Voici le fichier:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="1680"
height="1050"
id="svg2">
<g inkscape:label="fond" inkscape:groupmode="layer" id="layer1">
<a transform="matrix(1.01,0,0,1.01,0,0)">
<image x="-2" y="-2" width="1680" height="1050" xlink:href="/home/syl/new_meteo/chameleon/cloudy2.jpg" />
</a>
<a style="opacity:0.7">
<image x="834" y="542" width="128" height="128" xlink:href="/home/syl/new_meteo/Moons/28.png" />
</a>
<!--texte-->
<text
xml:space="preserve"
style="font-size:12;
font-style:italic;
font-weight:bold;
fill:#FF0089;
fill-opacity:0.741176470588235294 ;
stroke:none;
stroke-width:1px;
stroke-linecap:butt;
stroke-linejoin:miter;
stroke-opacity:1;
font-family:Sans "
x="650.00000"
y="850.00000"
id="text2598">
<tspan sodipodi:role="line" id="tspan2600">
Observations à Rennes (φ=48°06.60'N G=2°40.80'W ) :
il fait 8 °C (température ressentie)
condition actuelle : trés nuageux
Le vent vient du 350 à la vitesse de 4.3 nœuds
Heure de la basse mer à Cancale : 14h34 le mercredi 25 février
Alt-SysRq REISUB
</tspan></text>
</g>
</svg>
et la fonction qui me permet de la générer:
affiche_fond()
{
HAUTEUR_FOND="$(identify -format %h $MON_FOND)"
LARGEUR_FOND="$(identify -format %w $MON_FOND)"
LECRAN="$(xdpyinfo -display :0.0 | grep dimensions | sed 's/ //g' | cut -d':' -f 2 | cut -d'p' -f 1 | cut -d'x' -f 1 )"
HECRAN="$(xdpyinfo -display :0.0 | grep dimensions | sed 's/ //g' | cut -d':' -f 2 | cut -d'p' -f 1 | cut -d'x' -f 2 )"
RAPPORT_L="$(echo "scale=2; $LECRAN /$LARGEUR_FOND +0.01" | bc)"
RAPPORT_H="$(echo "scale=2; $HECRAN /$HAUTEUR_FOND +0.01" | bc )"
LIGNE="$(cat $NEW_COND |grep -n -i '<g inkscape:label="fond"' | cut -d ":" -f 1)"
sed -i "$LIGNE,+6 c \ <g inkscape:label=\"fond\" inkscape:groupmode=\"layer\" id=\"layer1\">\n\
<a transform=\"matrix($RAPPORT_L,0,0,$RAPPORT_H,0,0)\">\n\
<image x=\"-2\" y=\"-2\" width=\"$LARGEUR_FOND\" height=\"$HAUTEUR_FOND\" xlink:href=\"$MON_FOND\" />\n\
</a>\n\
<a style=\"opacity:0.7\">\n\
<image x=\"$X\" y=\"$Y\" width=\"128\" height=\"128\" xlink:href=\"$REP/Moons/$CODE_LUNE.png\" />\n\
</a>\
" $REP/weather.svg
}
et aussi cette fonction pour écrire des infos sur le fond...
affiche_info()
{
LIGNE="$(cat $NEW_COND |grep -n -i '<!--texte-->' | cut -d ":" -f 1 )"
if [ $AFFICHE_TEMPS = "true" ]
then
sed -i "$LIGNE,$ c \ <!--texte-->\n\
<text\n\
xml:space=\"preserve\"\n\
style=\"font-size:$FONT_SIZE;\n\
font-style:$FONT_STYLE;\n\
font-weight:$FONT_WEIGHT;\n\
fill:$FONT_COLOR;\n\
fill-opacity:$TRANSPARENCE;\n\
stroke:none;\n\
stroke-width:1px;\n\
stroke-linecap:butt;\n\
stroke-linejoin:miter;\n\
stroke-opacity:1;\n\
font-family:$FONT_FAMILY\"\n\
x=\"650.00000\"\n\
y=\"850.00000\"\n\
id=\"text2598\">\n\
<tspan sodipodi:role=\"line\" id=\"tspan2600\">\n\
Observations à $LIEU (φ=$LATITUDE$SLAT G=$LONGITUDE$SLON ) :\n\
il fait $TEMP_RESSENTIE °C (température ressentie)\n\
condition actuelle : $CODE_COND\n\
Le vent vient du $DIR_VENT à la vitesse de $VIT_VENT $UNIT \n\n\
$AFFICHE\n\n\n\
Alt-SysRq REISUB\n\
</tspan></text>\n\
</g>\n\
</svg>" $REP/weather.svg
fi
}