daniel38100 a écrit@ragamatrix
passe moi ta compo quand elle est abouti comme ca j'ajoute dans le pack j'veu mettre des compo aléatoire
Par contre j'ai changé les images et aiguilles du baromètre, donc faudra modifier pour faire un pack... Ou alors je poste images et aiguilles qui ne sont pas de la même taille (j'ai du faire une mauvaise manip)Pour le lien rss je ne suis pas sur que cela soit "très propre"...
compact.sh:
#!/bin/bash
##################################################
#destination="/tmp/test.png" #
source $meteo_rep/scripts/meteo $meteo_config # entêtes obligatoires
if [ "$start" = "non" ] ;then exit;fi # dans votre fichier
##################################################
# Créé le : jeu. 21 janv. 2014 10:55:43 CET
# Par : ragamatrix
#########################################################################################################
function NA
{
if [[ $sec2_cond = "NA" ]];then
sec2_cond=""
fi
}
###===================================================================================================###
#crea_cart "prev_2" "200x86" "cadre" "DodgerBlue3" "1" "transparent" "5"
########## Début de votre composition ############
# couleurs
coul1="aqua";coul2="dodgerblue1";coul3="yellow";coul4="white";coul5="springgreen";coul6="red";coul7="black";coul8="orange";coul9="blue";coul10="gold";coul11="DarkOrchid1";coul12="fuchsia";coul13="LightSlateGrey";coul14="GhostWhite"
# Fonction coultemp #
function coultemp
{
if (($temp < -5 )); then
coul=$coul1
elif (($temp < 1 && $temp > -6 )); then
coul=$coul2
elif (($temp < 6 && $temp > 0)); then
coul=$coul3
elif (($temp < 20 && $temp > 5 )); then
coul=$coul4
elif (($temp < 25 && $temp > 19 )); then
coul=$coul5
elif (($temp > 24 )); then
coul=$coul6
else coul=$coul7
fi
}
# fontes
fonte=Helvetica-LT-Std-Bold;fonte1=URW-Chancery-Medium-Italic;fonte2=Times-Bold;fonte3=Arrows-Regular;fonte4=Monaco-Regular;fonte5=Monaco-Bold
##################################################
##################################################################
#################toolz########################################
#################################################
# creation rose
image_rose="$(rose CC vent 120x120 60)"
# creation baro
image_baro="$(barometre 120x120 60)"
# creation thermo
image_thermo="$(thermorond CC 120x120 100 ble)"
# Lune ############################################################################################
crea_cart "lune_info" "130x130"
ajout_ima_cart "lune_info" "Center" "45" "0" "+0" "+0" $reptemp/Lune.png
info_lune=`echo "$(lune ephe)"| sed 's/\ /\\n/g'`
ajout_cart "lune_info" "Center" "0" "+0" "+0" "$info_lune" "$coul4" $fonte1 "15"
#ajout_ima_cart "compact" "south" "100" "0" "+0" "+25" "$reptemp/lune_info.png" "60"
function risqueverglas
{
verglas="non"
if (($temp < 2 )); then
verglas="oui"
fi
}
########################################################################
#crea-temp##############################################################
temp=$(CC temp) ; coultemp
ima_max=$(crea_texte_multi "max" "$fonte" "26" "0" "black" "$coul" "$temp °")
temp=$(CC ressent) ;risqueverglas; coultemp
ima_ress=$(crea_texte_multi "ress" "$fonte" "14" "0" "black" "$coul4" "/" "$coul" "r.$temp°")
temp=$(prev_jour 1 tmpmax ) ; coultemp
ima_max1=$(crea_texte_multi "max1" "$fonte" "14" "0" "black" "$coul4" "Max : " "$coul" "$temp °")
# temp la plus basse
function plusbas
{
if (("$temp1" < "$bas")); then bas="$temp1"; fi
}
temp="$(CC temp)";temp1="$(CC ressent)";bas="$temp";plusbas
temp1="$(prev_quart Nuit 1 ressentmin)";plusbas
temp=$bas;risqueverglas; coultemp
ima_min=$(crea_texte_multi "min" "$fonte" "14" "0" "black" "$coul4" "+Bas : " "$coul" "$temp °")
crea_cart "temperatures" "120x120" #creation du cartouche
ajout_ima_cart "temperatures" "NorthEast" "100" "0" "+56" "+4" "$ima_max"
ajout_ima_cart "temperatures" "Northwest" "100" "0" "+50" "+13" "$ima_ress"
ajout_ima_cart "temperatures" "North" "100" "0" "+0" "+31" "$ima_max1"
ajout_ima_cart "temperatures" "North" "100" "0" "+0" "+49" "$ima_min"
ajout_cart "temperatures" "North" "0" "+0" "+72" "Historique" $coul4 $fonte "13"
ajout_cart "temperatures" "North" "0" "+0" "+107" "$(prev_jour 1 tmpmaxlast)° / $(prev_jour 1 tmpminlast)°" $coul4 $fonte "16"
# incruste année --------------------------------------------------------------
an=`date +"%Y"`
crea_texte "histo" "150x20" "$[$an-1]" $coul2 $fonte "18" "1" "black"
ajout_ima_cart "temperatures" "North" "100" "0" "+0" "+87" $image_histo "50"
crea_ombre "temperatures" "1" #creation de l'ombre du cartouche
##############################FIN THERMO###########################################
# Météo façon meteo.lua de Didier-T ##############
date=$(date "+%A %d %B %G")
##################################################
# Creation fond ----------------------------------
crea_cart "compact" "385x605"
ajout_ima_cart "compact" "center" "100" "0" "+0" "-5" "$(crea_graph "background" "quad" "380" "600" "5" "#00000090")"
# Affichage cadre 2 ------------------------------
# affichage cadre ------------------------------
ecart=75;pos=68;pos1=25;pos2=62
for (( i=0 ; i<5 ; i++ ));do
# icone condition
# appel de la fonction coultemp
temp=$(CC temp);coultemp
#ajout_cart "compact" "North" "0" "+0" "+0" "$date" $coul4 $fonte1 "14"
ajout_ima_cart "compact" "North" "30" "0" "+$(((ecart*i)-150))" "+25" "$(prev_huit $((i+2)) ico)" "60"
ajout_cart "compact" "North" "0" "+$(((ecart*i)-150))" "+33" "$(prev_huit $((i+2)) temp)°" $coul12 $fonte "12"
ajout_cart "compact" "North" "0" "+$(((ecart*i)-140))" "+55" "$(prev_huit $((i+2)) heure) H" $coul4 $fonte "10"
ajout_ima_cart "compact" "North" "30" "0" "-150" "+$(((ecart*i)+95))" "$(prev_jour $((i+2)) ico)"
ajout_ima_cart "compact" "North" "30" "0" "+150" "+$(((ecart*i)+95))" "$(prev_quart Nuit $((i+2)) ico)"
ajout_cart "compact" "North" "0" "-150" "+$(((ecart*i)+80))" "$(date --date "$((i+1)) day" +%a%d|sed -e 's/\(.\{1\}\)/\U\1/')" $coul13 $fonte "12"
#conditions
ajout_cart "compact" "North" "0" "+0" "+$(((ecart*i)+100))" "$(prev_jour $((i+1)) sec1_cond)" $coul13 $fonte "10"
sec2_cond=$(prev_jour $((i+1)) sec2_cond);NA
ajout_cart "compact" "North" "0" "+0" "+$(((ecart*i)+110))" "$sec2_cond" $coul13 $fonte "10"
# temperature
ajout_cart "compact" "North" "0" "+150" "+$(((ecart*i)+90))" "/" $coul4 $fonte "12"
ajout_cart "compact" "North" "0" "+135" "+$(((ecart*i)+90))" "$(prev_jour $((i+2)) tmpmin)°" $coul $fonte "12"
ajout_cart "compact" "North" "0" "+165" "+$(((ecart*i)+90))" "$(prev_jour $((i+2)) tmpmax)°" $coul $fonte "12"
# vent
ajout_ima_cart "compact" "North" "10" "0" "+0" "+$(((ecart*i)+120))" "$(prev_jour $((i+2)) icovent)"
ajout_cart "compact" "North" "0" "+0" "+$(((ecart*i)+150))" "$(prev_jour $((i+2)) vent_force)km/h" $coul6 $fonte "10"
#ajout_cart "compact" "North" "0" "+$(((ecart*i)-(pos+30)))" "+405" "$(prev_jour $((i+2)) precip)%" $coul6 $fonte "12"
ajout_ima_cart "compact" "southeast" "100" "0" "+25" "+35" "$image_rose" "60"
ajout_ima_cart "compact" "southwest" "100" "0" "+25" "+35" "$image_baro" "60"
#ajout_ima_cart "compact" "southwest" "80" "0" "+25" "+35" "$reptemp/lune_info.png" "60"
done
# affichage cadre 4 ------------------------------
ajout_cart "compact" "south" "0" "+0" "+35" "Relevé à : "$maint $coul1 $fonte1 "12"
ajout_cart "compact" "south" "0" "+0" "+15" "Prochaine mise à jour : "$proch_maj $coul1 $fonte1 "12"
ajout_ima_cart "compact" "south" "70" "0" "+0" "+50" "$image_temperatures"
##################################################
alt=`echo $(CC alerte)`
if [[ $alt != "RAS" ]];then
crea_cart "alerte1" "351x51"
image_alerte=$(alerte_cart 700 "$fonte2" centre degra ico)
#convert -resize 350x50! ~/Images/météo/base1.png "$reptemp/base5.png"
#ajout_ima_cart "alerte1" "North" "100" "0" "+0" "+0" "$reptemp/base5.png"
ajout_ima_cart "alerte1" "North" "45" "0" "+10" "+2" "$image_alerte"
fi
# news ----------------------------------------------------------------
rss=`wget -q -O - http://liberation.fr.feedsportal.com/c/32268/fe.ed/rss.liberation.fr/rss/8/ | sed -n 's#.*<title>\(.*\)</title>.*#\1#p'`
rss=`wget -q -O - http://liberation.fr.feedsportal.com/c/32268/fe.ed/rss.liberation.fr/rss/9/ | sed -n 's#.*<title>\(.*\)</title>.*#\1#p'`
rss=`wget -q -O - http://liberation.fr.feedsportal.com/c/32268/fe.ed/rss.liberation.fr/rss/10/ | sed -n 's#.*<title>\(.*\)</title>.*#\1#p'`
convert -background transparent -font $fonte1 -pointsize 15 -fill $coul14 label:"News : $rss" -trim \
\( +clone -background grey19 -shadow 100x1 -channel A -level 0,5% +channel \) +swap +repage -gravity center -composite $reptemp/news.png
##################################################
#Gmail---------------###############################GMAIL##-------
gmail=`perl /opt/Accuweather/scripts/extra/gmail.pl n`
#Gmail---------------###############################GMAIL##----
convert -background transparent -font $fonte1 -pointsize 12 -fill $coul14 label:"Gmail : $gmail message(s)" -trim \
\( +clone -background grey19 -shadow 100x1 -channel A -level 0,5% +channel \) +swap +repage -gravity center -composite $reptemp/gmail.png
########################################################################
convert -resize $ecran! "$fondbase" "$reptemp"/finale.png
decalagehaut=0
ajout_ima_cart "finale" "east" "100" "0" "+150" "-165" "$reptemp/lune_info.png" "80"
ajout_ima_cart "finale" "southeast" "100" "0" "+20" "+50" "$image_compact"
ajout_ima_cart "finale" "southwest" "100" "0" "+20" "+50" "$reptemp/news.png"
ajout_ima_cart "finale" "Northwest" "30" "0" "+70" "+90" "/tmp/radar.png" "60"
ajout_ima_cart "finale" "southeast" "100" "0" "+165" "+40" "$reptemp/gmail.png"
if [[ $alt != "RAS" ]];then
ajout_ima_cart "finale" "Northwest" "60" "0" "+20" "+50" "$image_alerte1"
fi
##################################################
# obligatoire pour rafraichir le fond d'ecran
cp "$reptemp"/finale.png "$imagefinale"
affichage
exit
#
02-sat-round.sh
#!/bin/bash
# Crée par JPDipsy
# script de recupération imagesat couverture nuageuse http://www.sat24.com
# et mise en forme polaroïd imagemagick et pagecurl doivent être installés
# ce script et le script pagecurl doivent être dans le même rep.
#----------------------------------------------------------------------------------
path=`dirname $0`
heuremodif=`date +%H`; minmodif=`date +%M`
# ce que vous voulez
fonte=White-Rabbit-Regular
nomimage=radar
tailleimage=90 # ceci est en pourcentage
tailledecoupe=450x450
rotation=0
#libelle="Report: "
wget -q -O /tmp/$nomimage.gif "http://www.meteo-mc.fr/dedie/Images/sat/satireu1.gif"
function mise_en_forme_image {
convert /tmp/$nomimage.png \
\( +clone -alpha extract \
-draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
\) -alpha off -compose CopyOpacity -composite /tmp/$nomimage.png
}
function ombre {
convert /tmp/$nomimage.png -background black \( +clone -shadow 60x4+2+2 \) +swap -background none -flatten /tmp/$nomimage.png
}
if [[ -e /tmp/$nomimage.gif ]] ; then
# decoupage de la partie utile
convert /tmp/$nomimage.gif -filter Lanczos -crop $tailledecoupe+140+110\! /tmp/$nomimage.png
mise_en_forme_image ; ombre ; rm /tmp/$nomimage.gif
else
# comme ça votre conky aura toujours une image au cas ou
convert -size $tailledecoupe plasma: /tmp/$nomimage.png
libelle="Désolé pas d'image radar à "
mise_en_forme_image ; ombre
fi