#1426 Le 09/09/2016, à 16:51
- CasseTaTélé_isback
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Ah ok je comprends, moi je lance juste "conky" au démarrage. Pour le moment je garde mon unique .conkyrc ...
Ubuntu 20.04
Hors ligne
#1427 Le 07/10/2016, à 15:46
- B3bz
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour à tous !
Juste pour partager le script version fr à cette adresse
https://forums.bunsenlabs.org/viewtopic.php?id=189&p=48
fichier 1_accuweather :
#!/bin/bash
#function: test_image
test_image () {
case $1 in
1)
echo a
;;
2|3)
echo b
;;
4|5)
echo c
;;
6)
echo d
;;
7)
echo e
;;
8)
echo f
;;
11)
echo 0
;;
12)
echo h
;;
13|14)
echo g
;;
15)
echo m
;;
16|17)
echo k
;;
18)
echo i
;;
19)
echo q
;;
20|21|23)
echo o
;;
22)
echo r
;;
24|31)
echo E
;;
25)
echo v
;;
26)
echo x
;;
29)
echo y
;;
30)
echo 5
;;
32)
echo 6
;;
33)
echo A
;;
34|35)
echo B
;;
36|37)
echo C
;;
38)
echo D
;;
39|40)
echo G
;;
41|42)
echo K
;;
43|44)
echo O
;;
*)
echo -
;;
esac
}
############################
# Check the user arguments #
############################
#recherche le paramètre envoyé
if (( $# < 1 || $# > 4 )); then
echo "Invalid arguments!"
exit
fi
forecast0=0
forecast2015=0
forecast2016=0
hourly0=0
hourly2015=0
hourly2016=0
for i in $*
do
if [[ $i != -f && $i != -f2015 && $i != -f2016 && $i != -h && $i != -h2015 && $i != -h2016 ]]; then
echo "Invalid arguments!"
exit
fi
case $i in
-f)
forecast0=1
;;
-f2015)
forecast2015=1
;;
-f2016)
forecast2016=1
;;
-h)
hourly0=1
;;
-h2015)
hourly2015=1
;;
-h2016)
hourly2016=1
;;
esac
done
if [[ $forecast0 == 1 ]]; then
forecast2015=0
forecast2016=0
fi
if [[ $hourly0 == 1 ]]; then
hourly2015=0
hourly2016=0
fi
#Put your Accuweather address here
#address="http://www.accuweather.com/en/us/new-york-ny/10017/weather-forecast/349727"
#address="http://www.accuweather.com/en/ca/toronto/m5j/weather-forecast/55488"
address="http://www.accuweather.com/fr/fr/dijon/132390/weather-forecast/132390"
#récupère le code région en fin de ligne
last_number=$(echo $address|sed 's/^.*\///')
#############################################################
# NORMAL FORECAST: -f, -f2015 or -f2016 passed as arguments #
#############################################################
if [[ $forecast0 == 1 || $forecast2015 == 1 || $forecast2016 == 1 ]]; then
#function: convert_time
convert_time ()
{
hours=$(echo $1|awk -F ":| " '{print $1}')
minutes=$(echo $1|awk -F ":| " '{print $2}')
am_or_pm=$(echo $1|awk -F ":| " '{print $3}')
if [[ $am_or_pm == AM ]]; then
if (( $hours < 10 )); then
hours_24=0$hours
fi
if (( $hours == 10 || $hours == 11 )); then
hours_24=$hours
fi
if (( $hours == 12 )); then
hours_24=00
fi
elif [[ $am_or_pm == PM ]]; then
if (( $hours != 12 )); then
hours_24=$((hours+12))
fi
if (( $hours == 12 )); then
hours_24=12
fi
fi
time_24=$hours_24:$minutes
echo $time_24
}
#function: test_wind
test_wind () {
case $1 in
CLM)
echo -
;;
S)
echo 1
;;
SSW)
echo 2
;;
SW)
echo 3
;;
WSW)
echo 4
;;
W)
echo 5
;;
WNW)
echo 6
;;
NW)
echo 7
;;
NNW)
echo 8
;;
N)
echo 9
;;
NNE)
echo :
;;
NE)
echo ;
;;
ENE)
echo \<
;;
E)
echo =
;;
ESE)
echo \>
;;
SE)
echo ?
;;
SSE)
echo @
;;
esac
}
#tue le process conky
kill -STOP $(pidof conky)
#modifie l'url
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
#et crée le fichier curr_cond_raw contenant le contenu de la page
wget -O $HOME/.conky/accuweather/curr_cond_raw "$curr_addr"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O $HOME/.conky/accuweather/first_days_raw "$addr1"
addr2="$addr1"?day=6
wget -O $HOME/.conky/accuweather/last_days_raw "$addr2"
if [[ $forecast2015 == 1 ]]; then
rm $HOME/.conky/accuweather/forecast_2015/forecast_*.png
fi
if [[ $forecast2016 == 1 ]]; then
rm $HOME/.conky/accuweather/forecast_2016/forecast_*.png
fi
#current conditions
if [[ -s $HOME/.conky/accuweather/curr_cond_raw ]]; then
#retire le contenu du fichier qui ne se trouve pas entre la ligne contenant detail-now et Astronomy <span class
#MODIFICATION de Astronomy en Astronomie
sed -i '/detail-now/,/Astronomie <span class/!d' $HOME/.conky/accuweather/curr_cond_raw
#On envoie les lignes contenant les valeurs à récupérer dans curr_cond
#MODIFICATION de Humidity en Humidit
#MODIFICATION de Pressure en Pression
#MODIFICATION de UV Index en Indice UV
#MODIFICATION de Cloud Cover en Couverture nuageuse
#MODIFICATION de Ceiling en Plafond
#MODIFICATION de Dew Point en Point de ros
#MODIFICATION de Visibility en Visibilit
#MODIFICATION de Sunrise: en Lever du soleil:
#MODIFICATION de Sunset: en Lever du soleil:
#MODIFICATION de Moonrise: en Lever de lune:
#MODIFICATION de Moonset: en Coucher de lune:
egrep -i '"cond"|icon i-|large-temp|small-temp|wind-point|"wind"|Humidit|Pression|Indice UV|Couverture nuageuse|Plafond|Point de ros|Visibilit|Duration|Lever du soleil:|Coucher de soleil:|Lever de lune:|Coucher de lune:' $HOME/.conky/accuweather/curr_cond_raw > $HOME/.conky/accuweather/curr_cond
#AJOUT remplacement des accents
sed -i -e 's/\é/é/g' -e 's/\ô/ô/g' -e 's/\è/è/g' -e 's/\'/'"'"'/g' $HOME/.conky/accuweather/curr_cond
#nettoyage des lignes par la gauche
sed -i -e 's/^.*<strong>//g' -e 's/^.*<span>//g' -e 's/^.*icon i-//g' -e 's/^.*large-temp">//g' -e 's/^.*<\/em> //g' -e 's/^.*"cond">//g' -e 's/^.*wind-point //g' $HOME/.conky/accuweather/curr_cond
#nettoyage des lignes par la droite
sed -i -e 's/">.*$//g' -e 's/°.*$//g' -e 's/<\/span>.*$//g' -e 's/&#.*$//g' -e 's/ &darr.*$//g' -e 's/ &uarr.*$//g' -e 's/<\/strong>.*$//g' $HOME/.conky/accuweather/curr_cond
#nettoyage de l'id icone
sed -i '1s/-.*$//' $HOME/.conky/accuweather/curr_cond
#affectation des valeurs du fichier curr_cond aux variables
image=$(sed -n 1p $HOME/.conky/accuweather/curr_cond)
echo $(test_image $image) >> $HOME/.conky/accuweather/curr_cond
sunrise_time=$(sed -n 14p $HOME/.conky/accuweather/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/.conky/accuweather/curr_cond
sunrise_time=$(sed -n 15p $HOME/.conky/accuweather/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/.conky/accuweather/curr_cond
sunrise_time=$(sed -n 18p $HOME/.conky/accuweather/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/.conky/accuweather/curr_cond
sunrise_time=$(sed -n 19p $HOME/.conky/accuweather/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/.conky/accuweather/curr_cond
wind=$(sed -n 5p $HOME/.conky/accuweather/curr_cond)
echo $(test_wind $wind) >> $HOME/.conky/accuweather/curr_cond
if (( $(sed -n 14p /$HOME/.conky/accuweather/curr_cond|wc -c) == 8 )); then
sed -i '14s/^/0/' $HOME/.conky/accuweather/curr_cond
fi
if (( $(sed -n 15p /$HOME/.conky/accuweather/curr_cond|wc -c) == 8 )); then
sed -i '15s/^/0/' $HOME/.conky/accuweather/curr_cond
fi
if (( $(sed -n 18p /$HOME/.conky/accuweather/curr_cond|wc -c) == 8 )); then
sed -i '18s/^/0/' $HOME/.conky/accuweather/curr_cond
fi
if (( $(sed -n 19p /$HOME/.conky/accuweather/curr_cond|wc -c) == 8 )); then
sed -i '19s/^/0/' $HOME/.conky/accuweather/curr_cond
fi
#création de l'image correspondante
if [[ $forecast2015 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n 1p $HOME/.conky/accuweather/curr_cond).png $HOME/.conky/accuweather/forecast_2015/forecast_0.png
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n 5p $HOME/.conky/accuweather/curr_cond).png $HOME/.conky/accuweather/forecast_2015/wind_0.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n 1p $HOME/.conky/accuweather/curr_cond).png $HOME/.conky/accuweather/forecast_2016/forecast_0.png
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n 5p $HOME/.conky/accuweather/curr_cond).png $HOME/.conky/accuweather/forecast_2016/wind_0.png
fi
fi
#First 5 days
if [[ -s $HOME/.conky/accuweather/first_days_raw ]]; then
#retire le contenu du fichier qui ne se trouve pas entre la ligne contenant .feed-controls et .feed-tabs
sed -i '/.feed-controls/,/\.feed-tabs/!d' $HOME/.conky/accuweather/first_days_raw
#On envoie les lignes contenant les valeurs à récupérer dans first_days
egrep -i 'href="#"|icon i-|"large-temp"|"small-temp"|temp-label|"cond"' $HOME/.conky/accuweather/first_days_raw > $HOME/.conky/accuweather/first_days
#AJOUT remplacement des accents
sed -i -e 's/\é/é/g' -e 's/\ô/ô/g' -e 's/\'/'"'"'/g' -e 's/\è/è/g' $HOME/.conky/accuweather/first_days
#nettoyage des lignes par la gauche
sed -i -e '/icon/s/-. //g' -e 's/^.*icon i-//g' -e 's/^.*large-temp">//g' -e 's/^.*small-temp">\///g' -e 's/^.*"cond">//g' -e 's/^.*href="#">//g' -e 's/^.*"temp-label tonight ">//g' -e 's/^.*"temp-label tonight selected">//g' $HOME/.conky/accuweather/first_days
#nettoyage des lignes par la droite
sed -i -e 's/°.*$//g' -e 's/<\/a>.*$//g' -e 's/<\/span>.*$//g' -e 's/">.*$//g' $HOME/.conky/accuweather/first_days
#sed -i -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' -e 's/Today$/TODAY/' -e 's/Tonight$/TONIGHT/' -e 's/Early AM/EARLY AM/' $HOME/.conky/accuweather/first_days
sed -i -e 's/lun.$/LUNDI/' -e 's/mar.$/MARDI/' -e 's/mer.$/MERCREDI/' -e 's/jeu.$/JEUDI/' -e 's/ven.$/VENDREDI/' -e 's/sam.$/SAMEDI/' -e 's/dim.$/DIMANCHE/' -e 's/Auj.$/AUJOURD'"'"'HUI/' -e 's/C. nuit$/CETTE NUIT/' -e 's/Pt matin/PETIT MATIN/' $HOME/.conky/accuweather/first_days
#affectation des valeurs du fichier first_days aux variables
for (( i=2; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p $HOME/.conky/accuweather/first_days)
echo $(test_image $image) >> $HOME/.conky/accuweather/first_days
done
#création de l'image correspondante
if [[ $forecast0 == 0 ]]; then
j=1
for (( i=2; i<=22; i+=5 ))
do
if [[ $forecast2015 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n ${i}p $HOME/.conky/accuweather/first_days).png $HOME/.conky/accuweather/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n ${i}p $HOME/.conky/accuweather/first_days).png $HOME/.conky/accuweather/forecast_2016/forecast_$j.png
fi
((j++))
done
fi
fi
#Next 5 days
if [[ -s $HOME/.conky/accuweather/last_days_raw ]]; then
#retire le contenu du fichier qui ne se trouve pas entre la ligne contenant .feed-controls et .feed-tabs
sed -i '/.feed-controls/,/\.feed-tabs/!d' $HOME/.conky/accuweather/last_days_raw
#On envoie les lignes contenant les valeurs à récupérer dans last_days
egrep -i 'href="#"|icon i-|large-temp|small-temp|temp-label|"cond"' $HOME/.conky/accuweather/last_days_raw > $HOME/.conky/accuweather/last_days
#AJOUT remplacement des accents
sed -i -e 's/\é/é/g' -e 's/\ô/ô/g' -e 's/\è/è/g' -e 's/\'/'"'"'/g' $HOME/.conky/accuweather/last_days
#nettoyage des lignes par la gauche
sed -i -e '/icon/s/-. //g' -e 's/^.*icon i-//g' -e 's/^.*large-temp">//g' -e 's/^.*small-temp">\///g' -e 's/^.*"cond">//g' -e 's/^.*href="#">//g' -e 's/^.*"temp-label tonight ">//g' $HOME/.conky/accuweather/last_days
#nettoyage des lignes par la droite
sed -i -e 's/°.*$//g' -e 's/<\/a>.*$//g' -e 's/<\/span>.*$//g' -e 's/">.*$//g' $HOME/.conky/accuweather/last_days
#sed -i -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' $HOME/.conky/accuweather/last_days
sed -i -e 's/lun.$/LUNDI/' -e 's/mar.$/MARDI/' -e 's/mer.$/MERCREDI/' -e 's/jeu.$/JEUDI/' -e 's/ven.$/VENDREDI/' -e 's/sam.$/SAMEDI/' -e 's/dim.$/DIMANCHE/' $HOME/.conky/accuweather/last_days
#affectation des valeurs du fichier last_days aux variables
for (( i=2; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p $HOME/.conky/accuweather/last_days)
echo $(test_image $image) >> $HOME/.conky/accuweather/last_days
done
#création de l'image correspondante
if [[ $forecast0 == 0 ]]; then
j=6
for (( i=2; i<=22; i+=5 ))
do
if [[ $forecast2015 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n ${i}p $HOME/.conky/accuweather/last_days).png $HOME/.conky/accuweather/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n ${i}p $HOME/.conky/accuweather/last_days).png $HOME/.conky/accuweather/forecast_2016/forecast_$j.png
fi
((j++))
done
fi
fi
if [[ $hourly0 != 1 && $hourly2015 != 1 && $hourly2016 != 1 ]]; then
kill -CONT $(pidof conky)
fi
fi
#############################################################
# HOURLY FORECAST: -h, -h2015 or -h2016 passed as arguments #
#############################################################
if [[ $hourly0 == 1 || $hourly2015 == 1 || $hourly2016 == 1 ]]; then
#Hourly: First 8h
if [[ $forecast0 != 1 && $forecast2015 != 1 && $forecast2016 != 1 ]]; then
kill -STOP $(pidof conky)
fi
if [[ $hourly2015 == 1 ]]; then
rm $HOME/.conky/accuweather/hourly_2015/forecast_*.png
fi
if [[ $hourly2016 == 1 ]]; then
rm $HOME/.conky/accuweather/hourly_2016/forecast_*.png
fi
hourly_addr1="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"
wget -O $HOME/.conky/accuweather/hourly_raw1 "$hourly_addr1"
if [[ -s $HOME/.conky/accuweather/hourly_raw1 ]]; then
sed -i '/detail-tab-buttons\.detail-tab-buttons/,/<div class="hourly-table">/!d' $HOME/.conky/accuweather/hourly_raw1
egrep -i 'hour=|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|pm<\/div>|am<\/div>|icon-weather icon i-|<th>Forecast|<span>.*<\/span>|<th>Temp|<th>Realfeel|<th>Wind|<th>Rain|<th>Snow|<th>Ice|<th>UV Index|<th>Cloud Cover|<th>Humidity|<th>Dew Point' $HOME/.conky/accuweather/hourly_raw1 > $HOME/.conky/accuweather/hourly1
sed -i -e 's/^[ \t]*//g' -e 's/^.*<div>//g' -e 's/^.*<span>//g' -e 's/^.*<th>//g' -e 's/^.*icon i-//g' -e 's/-s">.*$//g' -e 's/<\/div>.*$//g' -e 's/&#.*$//g' -e 's/<\/span>.*$//g' -e 's/<\/th>.*$//g' -e 's/^.*href="//g' -e 's/" class=.*$//g' $HOME/.conky/accuweather/hourly1
sed -i -e 's/Monday/Mon/' -e 's/Tuesday/Tue/' -e 's/Wednesday/Wed/' -e 's/Thursday/Thu/' -e 's/Friday/Fri/' -e 's/Saturday/Sat/' -e 's/Sunday/Sun/' -e 's/\r//g' $HOME/.conky/accuweather/hourly1
echo "ConkyWeather Font Icons" >> $HOME/.conky/accuweather/hourly1
for (( i=4; i<=18; i+=2 ))
do
image=$(sed -n "${i}"p $HOME/.conky/accuweather/hourly1)
echo $(test_image $image) >> $HOME/.conky/accuweather/hourly1
done
if [[ $hourly0 == 0 ]]; then
j=1
for (( i=4; i<=18; i+=2 ))
do
if [[ $hourly2015 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n ${i}p $HOME/.conky/accuweather/hourly1).png $HOME/.conky/accuweather/hourly_2015/hourly_$j.png
fi
if [[ $hourly2016 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n ${i}p $HOME/.conky/accuweather/hourly1).png $HOME/.conky/accuweather/hourly_2016/hourly_$j.png
fi
((j++))
done
fi
fi
#Hourly: Next 8h
hourly_addr2=$(sed -n 1p $HOME/.conky/accuweather/hourly1)
wget -O $HOME/.conky/accuweather/hourly_raw2 "$hourly_addr2"
if [[ -s $HOME/.conky/accuweather/hourly_raw2 ]]; then
sed -i '/detail-tab-buttons\.detail-tab-buttons/,/<div class="hourly-table">/!d' $HOME/.conky/accuweather/hourly_raw2
egrep -i 'hour=|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|pm<\/div>|am<\/div>|icon-weather icon i-|<th>Forecast|<span>.*<\/span>|<th>Temp|<th>Realfeel|<th>Wind|<th>Rain|<th>Snow|<th>Ice|<th>UV Index|<th>Cloud Cover|<th>Humidity|<th>Dew Point' $HOME/.conky/accuweather/hourly_raw2 > $HOME/.conky/accuweather/hourly2
sed -i -e 's/^[ \t]*//g' -e 's/^.*<div>//g' -e 's/^.*<span>//g' -e 's/^.*<th>//g' -e 's/^.*icon i-//g' -e 's/-s">.*$//g' -e 's/<\/div>.*$//g' -e 's/&#.*$//g' -e 's/<\/span>.*$//g' -e 's/<\/th>.*$//g' -e 's/^.*href="//g' -e 's/" class=.*$//g' $HOME/.conky/accuweather/hourly2
sed -i 1d $HOME/.conky/accuweather/hourly2
sed -i -e 's/Monday/Mon/' -e 's/Tuesday/Tue/' -e 's/Wednesday/Wed/' -e 's/Thursday/Thu/' -e 's/Friday/Fri/' -e 's/Saturday/Sat/' -e 's/Sunday/Sun/' -e 's/\r//g' $HOME/.conky/accuweather/hourly2
echo "ConkyWeather Font Icons" >> $HOME/.conky/accuweather/hourly2
for (( i=4; i<=18; i+=2 ))
do
image=$(sed -n "${i}"p $HOME/.conky/accuweather/hourly2)
echo $(test_image $image) >> $HOME/.conky/accuweather/hourly2
done
if [[ $hourly0 == 0 ]]; then
j=9
for (( i=4; i<=18; i+=2 ))
do
if [[ $hourly2015 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2015/$(sed -n ${i}p $HOME/.conky/accuweather/hourly2).png $HOME/.conky/accuweather/hourly_2015/hourly_$j.png
fi
if [[ $hourly2016 == 1 ]]; then
cp $HOME/.conky/accuweather/Forecast_Images_2016/$(sed -n ${i}p $HOME/.conky/accuweather/hourly2).png $HOME/.conky/accuweather/hourly_2016/hourly_$j.png
fi
((j++))
done
fi
fi
# Full info, next 16h - altogether16 file
rm $HOME/.conky/accuweather/altogether16 altogether16_2015 altogether16_2016
#TIME
echo "\${color ffe595}TIME\${goto 100}" > $HOME/.conky/accuweather/altogether16
sed -i "1s/$/$(sed -n 2p $HOME/.conky/accuweather/hourly1):$(sed -n 3p $HOME/.conky/accuweather/hourly1)/" $HOME/.conky/accuweather/altogether16
jump_to=160
for (( i=5; i<=17; i+=2 ))
do
time=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "1s/$/\${goto $jump_to}$time/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
sed -i "1s/$/\${goto 580}$(sed -n 2p $HOME/.conky/accuweather/hourly2):$(sed -n 3p $HOME/.conky/accuweather/hourly2)/" $HOME/.conky/accuweather/altogether16
jump_to=640
for (( i=5; i<=17; i+=2 ))
do
time=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "1s/$/\${goto $jump_to}$time/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
sed -i '1s/$/\n\n\n/' $HOME/.conky/accuweather/altogether16
#FORECAST
echo "\${color ffe595}FORECAST\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=20; i<=27; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1|awk '{print $1}'|cut -c1-8)
sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=20; i<=27; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2|awk '{print $1}'|cut -c1-8)
sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
sed -i '5s/$/\n/' $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=20; i<=27; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1|awk '{print $2}'|cut -c1-8)
sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=20; i<=27; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2|awk '{print $2}'|cut -c1-8)
sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#TEMPERATURE
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "TEMPER.\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=29; i<=36; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=29; i<=36; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#REAL FEEL
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "REAL FEEL\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=38; i<=45; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=38; i<=45; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#WIND
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "WIND\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=47; i<=54; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=47; i<=54; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#RAIN
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "RAIN\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=64; i<=71; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=64; i<=71; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#SNOW
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "SNOW\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=73; i<=80; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=73; i<=80; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#ICE
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "ICE\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=82; i<=89; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=82; i<=89; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#UV INDEX
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "UV INDEX\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=99; i<=106; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=99; i<=106; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#CLOUD COVER
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "CLOUD COV.\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=108; i<=115; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=108; i<=115; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#HUMIDITY
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "HUMIDITY\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=117; i<=124; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "24s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=117; i<=124; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "24s/$/\${goto $jump_to}$messg/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#DEW POINT
echo "\${color ffe595}\${goto 100}\${hr 1}" >> $HOME/.conky/accuweather/altogether16
echo "DEW POINT\${color}" >> $HOME/.conky/accuweather/altogether16
jump_to=100
for (( i=126; i<=133; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)
sed -i "26s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=126; i<=133; i+=1 ))
do
messg=$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)
sed -i "26s/$/\${goto $jump_to}$messg°/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
#IMAGES
if [[ $hourly0 == 0 ]]; then
if [[ $hourly2015 == 1 ]]; then
jump_to=75
cp $HOME/.conky/accuweather/altogether16 $HOME/.conky/accuweather/altogether16_2015
fi
if [[ $hourly2016 == 1 ]]; then
jump_to=85
cp $HOME/.conky/accuweather/altogether16 $HOME/.conky/accuweather/altogether16_2016
fi
rm $HOME/.conky/accuweather/altogether16
for (( i=1; i<=16; i+=1 ))
do
if [[ $hourly2015 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/1_accuweather\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,49}/" $HOME/.conky/accuweather/altogether16_2015
fi
if [[ $hourly2016 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/1_accuweather\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,49}/" $HOME/.conky/accuweather/altogether16_2016
fi
((jump_to+=60))
done
fi
#CONKYFONT
if [[ $hourly0 == 1 ]]; then
sed -i '4s/$/\${color}\${font conkyweather:size=35}/' $HOME/.conky/accuweather/altogether16
jump_to=95
for (( i=135; i<=142; i+=1 ))
do
sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/.conky/accuweather/hourly1)/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
for (( i=135; i<=142; i+=1 ))
do
sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/.conky/accuweather/hourly2)/" $HOME/.conky/accuweather/altogether16
((jump_to+=60))
done
sed -i '4s/$/\${font}/' $HOME/.conky/accuweather/altogether16
sed -i '2,3d' $HOME/.conky/accuweather/altogether16
fi
kill -CONT $(pidof conky)
fi
Hors ligne
#1428 Le 08/10/2016, à 17:25
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
@B3bz
Bon travail.
Je viens de faire la même chose avec le script 2b, à la même adresse : https://forums.bunsenlabs.org/viewtopic.php?id=189
Le script 2b en français :
#!/bin/bash
#put your hemisphere here: n for north, s for south
hemisphere=n
#put your Weather Underground address API here
address="http://api.wunderground.com/api/a7f118ad23b2d3b9/conditions/forecast10day/astronomy/hourly/satellite/q/aubagne.json"
wun_icon_to_png () {
if [[ $1 == day ]]; then
case $2 in
chanceflurries)
echo 21
;;
chancerain)
echo 14
;;
chancesleet)
echo 26
;;
chancesnow)
echo 20
;;
chancetstorms)
echo 17
;;
clear)
echo 1
;;
cloudy)
echo 7
;;
flurries)
echo 21
;;
fog)
echo 11
;;
hazy)
echo 5
;;
mostlycloudy)
echo 6
;;
mostlysunny)
echo 4
;;
partlycloudy)
echo 4
;;
partlysunny)
echo 6
;;
sleet)
echo 26
;;
rain)
echo 18
;;
snow)
echo 22
;;
sunny)
echo 1
;;
tstorms)
echo 15
;;
unknown)
echo 0
;;
esac
elif [[ $1 == night ]]; then
case $2 in
chanceflurries)
echo 43
;;
chancerain)
echo 39
;;
chancesleet)
echo 40
;;
chancesnow)
echo 43
;;
chancetstorms)
echo 41
;;
clear)
echo 33
;;
cloudy)
echo 38
;;
flurries)
echo 43
;;
fog)
echo 11
;;
hazy)
echo 37
;;
mostlycloudy)
echo 36
;;
mostlysunny)
echo 35
;;
partlycloudy)
echo 35
;;
partlysunny)
echo 36
;;
sleet)
echo 40
;;
rain)
echo 40
;;
snow)
echo 44
;;
sunny)
echo 33
;;
tstorms)
echo 41
;;
unknown)
echo 0
;;
esac
fi
}
rm $HOME/2b_Wunderground_API/*.png
killall -STOP conky
killall wget
wget -O $HOME/2b_Wunderground_API/raw_data $address
#Conditions feature
sed -n '/, "current_observation": {/,/, "satellite": {/p' $HOME/2b_Wunderground_API/raw_data | sed 's/"Clear"/"Clair"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"North"/"Nord"/g;s/"South"/"Sud"/g;s/"West"/"Ouest"/g;s/"East"/"Est"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g' > $HOME/2b_Wunderground_API/Conditions
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/2b_Wunderground_API/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/2b_Wunderground_API/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2b_Wunderground_API/Conditions
day_or_night=$(sed -n 137p $HOME/2b_Wunderground_API/Conditions)
if [[ $day_or_night == nt ]]; then
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/2b_Wunderground_API/Conditions)).png $HOME/2b_Wunderground_API/Now.png
else
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/2b_Wunderground_API/Conditions)).png $HOME/2b_Wunderground_API/Now.png
fi
#Satellite feature, commented out by default, uncomment if you wish so
#sed -n '/, "satellite": {/,/"forecast":{/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Satellite
#sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Satellite
#sed -i -e '/image/!d' -e 's/^.*": "//g' -e 's/".*$//g' $HOME/2b_Wunderground_API/Satellite
#for (( i=1; i<=3; i++ ))
# do
# wget -O $HOME/2b_Wunderground_API/sat_pic$i.png $(sed -n ${i}p $HOME/2b_Wunderground_API/Satellite)
# done
#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/2b_Wunderground_API/Forecast
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/2b_Wunderground_API/Forecast
#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/2b_Wunderground_API/raw_data | sed 's/"Clear"/"Clair"/g;s/"Partly Cloudy"/"Partiellement Nuageux"/g;s/"Chance of Flurries"/"Risque de neige"/g;s/"Chance of Rain"/"Risque de pluie"/g;s/"Chance Rain"/"Risque de pluie"/g;s/"Chance of Freezing Rain"/"Risque de pluie verglaçante"/g;s/"Chance of Sleet"/"Risque de grésil"/g;s/"Chance of Snow"/"Risque de neige"/g;s/"Chance of Thunderstorm*"/"Risque d orage"/g;s/"Cloudy"/"Nuageux"/g;s/"Flurries"/"Averse de neige"/g;s/"Fog"/"Brouillard"/g;s/"Haze"/"Brume"/g;s/"Mostly Cloudy"/"Plutôt nuageux"/g;s/"Mostly Sunny"/"Plutôt ensoleillé"/g;s/"Partly Sunny"/"Partiellement ensoleillé"/g;s/"Freezing Rain"/"Pluie verglaçante"/g;s/"Rain"/"Pluie"/g;s/"Sleet"/"Neige fondue"/g;s/"Snow"/"Neige"/g;s/"Sunny"/"Ensoleillé"/g;s/"Thunderstorm*"/"Orage"/g;s/"Overscat"/"Couvert"/g;s/"Scattered Clouds"/"Nuages épars"/g;s/"NW"/"NO"/g;s/"WNW"/"ONO"/g;s/"SW"/"SO"/g;s/"WSW"/"OSO"/g' > $HOME/2b_Wunderground_API/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2b_Wunderground_API/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
do
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2b_Wunderground_API/Forecast)).png $HOME/2b_Wunderground_API/d$(( 1+(i-2)/16 )).png
j=$(( i+8 ))
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/2b_Wunderground_API/Forecast)).png $HOME/2b_Wunderground_API/n$(( 1+(i-2)/16 )).png
done
#Forecast feature: Hourly
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2b_Wunderground_API/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2b_Wunderground_API/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/2b_Wunderground_API/Hourly
for (( i=64; i<=4212; i+=117 ))
do
j=$(( i+1 ))
day_or_night=$(sed -n ${j}p $HOME/2b_Wunderground_API/Hourly)
if [[ $day_or_night == nt ]]; then
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/2b_Wunderground_API/Hourly)).png $HOME/2b_Wunderground_API/h$(( 1+(i-64)/117 )).png
else
cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2b_Wunderground_API/Hourly)).png $HOME/2b_Wunderground_API/h$(( 1+(i-64)/117 )).png
fi
done
#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/2b_Wunderground_API/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/2b_Wunderground_API/Moon_Sun
moon_phase=$(sed -n 6p $HOME/2b_Wunderground_API/Moon_Sun)
if [[ $moon_phase == "Waning Crescent" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"21.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Crescent" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"04.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waning Gibbous" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"17.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Gibbous" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"09.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "First Quarter" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"07.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Last Quarter" ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"19.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ New.* ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"24.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ Full.* ]]; then
cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"13.png" $HOME/2b_Wunderground_API/Moon_phase.png
fi
killall -CONT conky
exit
Et le .conkyrc1 associé :
conky.config = {
background = false,
use_xft = true,
font = 'monofur:bold:size=10',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 170,
minimum_height = 283,
gap_x = 100,
gap_y = 100,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 6144,
imlib_cache_size = 8192,
default_color = '#DCDCDC',--220 220 220 Gainsboro
color0 = '#8FBC8F',--143 188 143 DarkSeaGreen
color1 = '#778899',--119 136 153 LightSlateGray
color2 = '#D8BFD8',--216 191 216 Thistle
color3 = '#E0FFFF',--224 255 255 LightCyan
color4 = '#48D1CC',-- 72 209 204 MediumTurquoise
color5 = '#FFDEAD',--255 222 173 NavajoWhite
color6 = '#00BFFF',-- 0 191 255 DeepSkyBlue
color7 = '#B0E0E6',--176 224 230 PowderBlue #5F9EA0 # 95 158 160 CadetBlue
color8 = '#FFFFE0',--255 255 224 LightYellow
color9 = '#CD5C5C',--205 92 92 IndianRed #FF0000 #255 0 0 Red
lua_load = '/home/dominique/2b_Wunderground_API/weather.lua',
lua_startup_hook = 'main',
}
conky.text = [[
${image $HOME/2b_Wunderground_API/Now.png -p 5,17 -s 108x65}\
${goto 125}${color3}${exec sed -n '67p' $HOME/2b_Wunderground_API/Conditions}°${color}\
${goto 180}${color3}± ${exec sed -n '113p' $HOME/2b_Wunderground_API/Conditions}°${color}
${goto 125}${color9}${exec sed -n '39p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 180}${color7}${exec sed -n '44p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${goto 125}Pluie = ${exec sed -n '133p' $HOME/2b_Wunderground_API/Conditions}mm
${color5}${alignc}${exec sed -n '63p' $HOME/2b_Wunderground_API/Conditions}${color}
Visibilité ${exec sed -n '117p' $HOME/2b_Wunderground_API/Conditions}km\
${goto 160}Pluie = ${exec sed -n '133p' $HOME/2b_Wunderground_API/Conditions}mm
Vent ${exec sed -n '81p' $HOME/2b_Wunderground_API/Conditions}\
${goto 160}${exec sed -n '73p' $HOME/2b_Wunderground_API/Conditions}\
${goto 200}${exec sed -n '75p' $HOME/2b_Wunderground_API/Conditions}°
Pression ${exec sed -n '85p' $HOME/2b_Wunderground_API/Conditions}\
${goto 160}UVI ${exec sed -n '121p' $HOME/2b_Wunderground_API/Conditions}
Point de rosée ${exec sed -n '95p' $HOME/2b_Wunderground_API/Conditions}°\
${goto 160}Hum ${exec sed -n '69p' $HOME/2b_Wunderground_API/Conditions}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="1 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '145p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '202p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '204p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '206p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d2.png -p 20,169 -s 66x40}\
${goto 95}Hum ${exec sed -n '210p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '163p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '150p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '152p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="2 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '251p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '299p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '301p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '303p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d3.png -p 20,225 -s 66x40}\
${goto 95}Hum ${exec sed -n '316p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '269p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '256p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '258p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="3 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '357p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '405p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '407p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '409p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d4.png -p 20,280 -s 66x40}\
${goto 95}Hum ${exec sed -n '422p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '375p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '362p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '364p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="4 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '463p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '511p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '513p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '515p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d5.png -p 20,335 -s 66x40}\
${goto 95}Hum ${exec sed -n '528p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '481p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '468p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '470p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="5 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '569p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '617p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '619p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '621p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d6.png -p 20,390 -s 66x40}\
${goto 95}Hum ${exec sed -n '634p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '587p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '574p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '576p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="6 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '675p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '723p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '725p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '727p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d7.png -p 20,445 -s 66x40}\
${goto 95}Hum ${exec sed -n '740p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '693p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '680p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '682p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${alignc}${color4}${membar 0,40} ${execi 600 echo `date --date="7 day" | awk '{print $1" "$3" "$2" "$6}'`} ${membar 0,40}${color}
${color9}${exec sed -n '781p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}Vent ${exec sed -n '829p' $HOME/2b_Wunderground_API/Simple_Forecast}k/h\
${goto 177}${exec sed -n '831p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 214}${exec sed -n '833p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}
${image $HOME/2b_Wunderground_API/d8.png -p 20,500 -s 66x40}\
${goto 95}Hum ${exec sed -n '846p' $HOME/2b_Wunderground_API/Simple_Forecast}%\
${goto 177}QPF ${exec sed -n '799p' $HOME/2b_Wunderground_API/Simple_Forecast}mm
${color7}${exec sed -n '786p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${color5}${alignc}${exec sed -n '788p' $HOME/2b_Wunderground_API/Simple_Forecast}${color}
${color4}${alignc}${membar 0,230}
]]
Tout est dans tout et réciproquement....
Hors ligne
#1429 Le 14/10/2016, à 16:11
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Un nouveau petit conky qui affiche les commentaire sur la mètèo du jour à partir du site http://meteo.region-nord.com/
conky.config = {
background = false,
use_xft = true,
font = 'DejaVuSansMono:size=7',
update_interval = 1800.0,
total_run_times = 0,
own_window = true,
own_window_type = 'dock',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
stippled_borders = 8,
border_inner_margin = 4,
alignment = 'top_left',
minimum_width = 100,
minimum_height = 100,
gap_x = 20,
gap_y = 20,
no_buffers = false,
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
use_spacer = right,
text_buffer_size = 4096,
imlib_cache_size = 4096,
default_outline_color = '000000',
color1 = '00f5ff',
}
conky.text = [[
${color1}${exec curl -s "http://meteo.region-nord.com/meteo-13005.html" | sed -n '/<div class="com">/{n;p;}' | sed q |sed s/'<br>'/'\n<br>'/g |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/^[ \t]*//'| sed 's/^./\u&/' | sed 's/'\''/ /g' | xargs -n12}
]]
Taper le code de votre ville dans la case en haut du site et recopier l'adresse html dans le conky.
Tout est dans tout et réciproquement....
Hors ligne
#1430 Le 01/11/2016, à 20:50
- antony118
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonsoir à tous, petit besoin d'aide, je vais essayer d'être bref dans l'explication :-)
-je suis sur KDE, mes conky fonctionnels depuis quelques temps sans problème.
-je viens de passer à MINT 18, donc avec KDE PLASMA.
sur mon PC "principal", je n'ai eu aucun problème à passer le cap (uniquement passer de "undecorate" à "undecorated" et tout est passé tout seul.
SAUF QUE, j'ai un EEEPC 1001 PXD, sur lequel j'ai fait la même manipulation, et comme disait Bourvil "ça marche moins bien maintenant".
Sur cette machine faiblarde, les effets de bureau ne s'activent pas, et donc je pense que ça vient de là la différence:
du coup mes conky s'affichent uniquement quand ils ont envie, et surtout sur fond noir, qui prend toute une bande verticale, qui cache les autres aussi je pense.
je vous mets la partie avant TEXT d'un de mes conky, si qqn peut avoir une petite idée..
d'avance MERCI
##########
# set to yes if you want Conky to be forked in the background
background no
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
#xftfont Bitstream Vera Sans Mono:size=8
xftfont Terminus:size8
# Text alpha when using Xft
xftalpha 0.8
# Update interval in seconds
update_interval 1.0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
own_window yes
own_window_type normal
own_window_argb_visual yes
own_window_transparent yes
own_window_hints undecorate,skip_taskbar,sticky,skip_pager,below
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 180 1000
maximum_width 180
# Draw shades?
draw_shades no
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white
alignment top_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 0
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
draw_graph_borders no
#############
Dernière modification par ljere (Le 02/11/2016, à 10:45)
Hors ligne
#1431 Le 03/11/2016, à 19:51
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Si sur ton EEEPC 1001 PXD tu ne peux pas activer les effets de bureau, la ligne
own_window_argb_visual yes
ne te sert à rien.
Supprime-la ou commente-la.
Dernière modification par chepioq (Le 03/11/2016, à 19:54)
Tout est dans tout et réciproquement....
Hors ligne
#1432 Le 07/11/2016, à 17:45
- antony118
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Merci pour l'essai mais ça a fait encore pire, chaque affichage de chaque seconde se cumule par dessus, et ça devient illisible après quelques secondes.
Et ca n'a pas résolu l'affichage et la transparence :-(.
Hors ligne
#1433 Le 07/11/2016, à 17:48
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Et si tu lances ton conky par la console, tu as des messages d'erreurs ?
Tout est dans tout et réciproquement....
Hors ligne
#1434 Le 07/11/2016, à 17:55
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Essaye avec ces valeurs :
own_window_type normal
own_window_transparent no
own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
own_window_argb_value 0
Tout est dans tout et réciproquement....
Hors ligne
#1435 Le 08/11/2016, à 10:05
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour,
J'aimerais pouvoir déplacer le conky à l’extrême bordure de l'écran, en utilisant la commande suivante dans le fichier conkyrc, il reste toujours décalé, comment faire ?
gap_x = 0,
gap_y = 0,
edit: En faisant quelques essais, j'ai trouvé une solution en commentant la fonction alignment, le conky est alors sous la direction des gap, avec comme départ le coin inférieur gauche, j'ai alors donné les gaps suivant et j'ai le conky placé comme je le souhaite
-- alignment top_right,
gap_x = 0,
gap_y = 315,
Donc, sauf contre-ordre , pour moi c'est tout bon
Dernière modification par enebre (Le 08/11/2016, à 10:28)
Hors ligne
#1436 Le 10/11/2016, à 21:19
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonsoir ,
Cette fois encore je ne trouve pas la solution à l'affichage d'une image
}
conky.text = [[
${font Open Sans Light:size=14}${image $HOME/.conky/conky-perso/loungeradio-linux/loungeradio_shadow.png -p 50,50 -s 700x600}\
${voffset 555}${texeci 60 $HOME/.conky/conky-perso/loungeradio-linux/loungeradio.sh}\
]]
Terminal dit:
conky: unknown variable '$image'
Dernière modification par enebre (Le 10/11/2016, à 21:27)
Hors ligne
#1437 Le 10/11/2016, à 23:23
- ljere
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
ça ne serait pas plutôt
${font Open Sans Light:size=14}${image ~/.conky/conky-perso/....
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#1438 Le 10/11/2016, à 23:34
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonsoir ljere,
Je viens d'essayer, même punition !
Voici le conkyrc, j'ai peut être un peu trop bidouillé, pour la mutation en nouveau code et je ne m'y retrouve plus.
conky.config = {
background = true,
use_xft = true,
-- font = 'Sans:pixelsize=12',
-- xftalpha = 1.0,
update_interval = 20.0,
-- total_run_times = 0,
own_window = true,
own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 70,
-- own_window_type = 'normal',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager,below',
double_buffer = true,
minimum_width = 700,
-- minimum_height = 600,
maximum_width = 700,
text_buffer_size = 512,
draw_shades = false,
-- draw_outline = false,
-- draw_borders = false,
-- draw_graph_borders = true,
-- default_color = 'white',
-- gap_x = 0,
-- gap_y = 300, #loungeradio_shadow.png,
-- alignment = 'top_right',
gap_x = 1400,
gap_y = 550
}
conky.text = [[
${font Open Sans Light:size=14}${image ~/.conky/conky-perso/loungeradio-linux/loungeradio_shadow.png -p 0,0 -s 600x500}
${voffset 55}${texeci 60 ~/.conky/conky-perso/loungeradio-linux/loungeradio.sh}
]]
Dernière modification par enebre (Le 10/11/2016, à 23:37)
Hors ligne
#1439 Le 11/11/2016, à 10:47
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour,
conky: unknown variable '$image'
Le problème serait lié à un bug, mais en installant conky-all , le problème est résolu.
conky-std doesn't support imlib2 binding.
You need to install conky-all if you want to use the variable $image.
Hors ligne
#1440 Le 11/11/2016, à 10:59
- ljere
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
ah ben oui il faut installer conky-all sinon tu n'as pas toutes les options d'actives
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#1441 Le 11/11/2016, à 12:44
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
edit: Conky corrigé et mis à jour, merci chepioq
Ceci est un petit duo conky/script pour RadioLounge avec affichage des pochettes et les infos du morceau en cours.
Le côté pratique c'est bien sûr le on/off et seul mplayer tourne, le cpu le voit à peine 0.6%cpu.
Ça ne fonctionne pas. Le texte se m'est à jour mais pas la pochette , elle reste sur la première image chargée, pourtant le script fonctionne bien pour charger les pochettes, je dirais que conky reste bloqué avec l'image en cache, si je savais ou , je pourrais inclure un rm image dans le script afin de libérer conky.
Quelqu'un aurait-il une proposition ?
C'est dommage car tout fonctionnait si bien avec l'ancienne version.
Y aurait-il possibilité de donner l'ordre d'affichage de la pochette en adaptant le script du chargement de l'image depuis la source ?
conky.config = {
background = false,
use_xft = true,
-- font = 'Sans:pixelsize=12',
-- xftalpha = 1.0,
update_interval = 20.0,
total_run_times = 0,
own_window = true,
-- own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 100,
own_window_type = 'desktop',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager,below',
double_buffer = true,
minimum_width = 540,
minimum_height = 530,
maximum_width = 560,
text_buffer_size = 512,
net_avg_samples = 2,
cpu_avg_samples = 2,
no_buffers = true,
-- draw_shades = true,
color3 = 'green',
-- draw_outline = false,
-- draw_borders = false,
-- draw_graph_borders = true,
-- default_color = 'white',
-- gap_x = 0,
-- gap_y = 300,
-- alignment = 'top_right',
gap_x = 1365,
gap_y = 10,
imlib_cache_size = 2048
}
conky.text = [[
${image ~/.conky/loungeradio -p 0,0 -s 550x430}
${color3}${voffset 410}${texeci 60 ~/.conky/loungeradio.sh}
]]
start-stop-conky-radio-mplayer-64.sh
#!/bin/bash
PROG_NAME1="conky -c /home/$USER/.conky/conkyrc" # Nom du programme à démarrer/arrêter.
PROG_NAME2="mplayer -playlist http://www.lounge-radio.com/aacplus.m3u" # Nom du programme à démarrer/arrêter.
PROCESSPID1=$(pgrep -f "conky -c /home/$USER/.conky/conkyrc") # Récupère le PID du processus.
PROCESSPID2=$(pgrep -f "mplayer -playlist http://www.lounge-radio.com/aacplus.m3u") # Récupére le PID du processus.
if [[ "$PROCESSPID1" != "" && "$PROCESSPID2" != "" ]]; then # Si les deux processus existe alors on le(s) kill.
kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
kill $PROCESSPID2 && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
else # Si aucun processus on démarre le programme.
kill $PROCESSPID1
$PROG_NAME1 &
echo "Start $PROG_NAME1"
kill $PROCESSPID2
$PROG_NAME2 &
echo "Start $PROG_NAME2"
if [[ "$PROCESSPID1" == "" || "$PROCESSPID2" == "" ]]; then # Si un des processus n'existe pas alors on le(s) kill.
kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
kill $PROCESSPID2 && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
echo "Il y a eu un souci au lancement tout a été coupé"
fi
fi
exit 0
#http://www.lounge-radio.com/index.php?option=com_content&task=view&id=30&Itemid=52
#http://www.lounge-radio.com/aacplus.m3u
#http://www.lounge-radio.com/listen128.m3u
#!/bin/bash
#pulling info from loung-radio.com for conky by nlinedesignz(at)web(dot)de 2013
wget http://www.lounge-radio.com/code/pushed_files/now.html -O $HOME/.conky/loungeradio.html >/dev/null 2>&1 &&
artist=$(awk '/id="artist"/{getline; print}' $HOME/.conky/loungeradio.html | sed "s/<div>\|<\/div>//g")
album=$(awk '/id="album"/{getline; print}' $HOME/.conky/loungeradio.html | sed "s/<div>\|<\/div>//g")
track=$(awk '/id="track"/{getline; print}' $HOME/.conky/loungeradio.html | sed "s/<div>\|<\/div>//g")
wget "http://www.lounge-radio.com/code/pushed_files/$(awk '/id="covercontainer"/{print}' $HOME/.conky/loungeradio.html | sed -r 's/.*src="(.*)" width=.*/\1/')" -O $HOME/.conky/loungeradio.jpg #>/dev/null 2>&1 &&
sleep 3
mv $HOME/.conky/loungeradio.jpg $HOME/.conky/loungeradio
sleep 2
rm $HOME/.conky/loungeradio.jpg
#convert $HOME/.conky/conky-perso/loungeradio-linux/loungeradio.jpg -mattecolor grey -frame 2x2+1+1 \( +clone -background navy -shadow 70x7+15+25 \) +swap -background none -mosaic $HOME/.conky/conky-perso/loungeradio-linux/loungeradio.jpg
echo
echo 'Artist :' $artist
echo 'Album :' $album
echo 'Piste :' $track
Dernière modification par enebre (Le 13/11/2016, à 16:15)
Hors ligne
#1442 Le 12/11/2016, à 17:00
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
up !
Personne n'a ce soucis ?
Hors ligne
#1443 Le 12/11/2016, à 17:30
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Dans ton conky, il n'y a pas une erreur ?
je vois :
......................................
conky.text = [[
${image ~/.conky/loungeradio -p 0,0 -s 550x430}
.......................................
Alors que dans ton script le chemin de tes images sont :
.conky/conky-perso/loungeradio-linux/loungeradio.jpg
et
.conky/conky-perso/loungeradio-linux/loungeradio_shadow.png
Tout est dans tout et réciproquement....
Hors ligne
#1444 Le 12/11/2016, à 17:37
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
merci chepioq (oups ! sorry), j'ai modifier les fichiers, ci-dessus.
Mais dans le pc j'avais déjà fait cette modif et ça ne fonctionne toujours pas. en fait je m'étais trompé de fichiers en postant, mais voilà c'est ajusté.
Et le conky ne fonctionne toujours pas, il reste sur la première image chargée, même si je la supprime dans son dossier !
Dernière modification par enebre (Le 12/11/2016, à 17:44)
Hors ligne
#1445 Le 12/11/2016, à 17:44
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
C'est pas ljere mais chepioq (mais peu importe)
Je ne vois pas ce que tu as modifié dans ton conky.
Moi j'aurais mis :
..................................
${image ~/.conky/conky-perso/loungeradio-linux/loungeradio_shadow.png -p 0,0 -s 550x430}
.....................................
Tout est dans tout et réciproquement....
Hors ligne
#1446 Le 12/11/2016, à 17:51
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
chepioq, excuse moi pour cette confusion stp.
J'ai modifié les adresses erronées comme tu l'as souligné, le fait est que j'avais changé l'adressage pensant qu'ils étaient peut être trop long et j'ai oublié de vérifier si j'avais posté les bons fichiers, je me suis un peu mélangé les pinceaux.
Les fichiers sur l'ordi sont correctement adressé eux. Et rien de mieux pour le chargement des nouvelles pochettes.
Crois-tu que purger conky et le réinstaller pourrait arranger les choses ?
Dernière modification par enebre (Le 12/11/2016, à 17:58)
Hors ligne
#1447 Le 12/11/2016, à 19:19
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Je viens de tester ton conky, et chez moi aussi je n'ai pas la pochette qui se met à jour, alors que le texte se met à jour sans soucis.
Là je sèche, je ne sais pas si cela vient de ton script ou du conky.
Tout est dans tout et réciproquement....
Hors ligne
#1448 Le 12/11/2016, à 19:24
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Merci chepioq d'avoir fait cette démarche, personnellement je crois que ça vient de conky, enfin pas trop certain.
Comme je n'écoute que deux radios, je trouve ça intéressant d'utiliser la radio sous cette forme, un clic on ouvre et un clic on ferme, en plus pour lounge radio on a les pochettes, enfin quand ça fonctionne.
Tu m'avais déjà bien aidé pour son ajustement, du temps de l'ancienne version conky.
Je me fais un lanceur sur le script on/off, y a plus qu'à cliquer.
Dernière modification par enebre (Le 12/11/2016, à 19:36)
Hors ligne
#1449 Le 12/11/2016, à 19:47
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Je viens de trouver.
Il suffit d'ajouter imlib_cache_size = 0 à la fin de la partie conky.config Je te donne la partie config qui fonctionne chez moi :
conky.config = {
background = false,
use_xft = true,
-- font = 'Sans:pixelsize=12',
-- xftalpha = 1.0,
update_interval = 20.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 70,
own_window_type = 'desktop',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager,below',
double_buffer = true,
minimum_width = 540,
minimum_height = 530,
maximum_width = 560,
text_buffer_size = 512,
net_avg_samples = 2,
cpu_avg_samples = 2,
no_buffers = true,
-- draw_shades = true,
color3 = 'green',
-- draw_outline = false,
-- draw_borders = false,
-- draw_graph_borders = true,
-- default_color = 'white',
-- gap_x = 0,
-- gap_y = 300,
-- alignment = 'top_right',
gap_x = 965,
gap_y = 10,
imlib_cache_size = 0
}
Tout est dans tout et réciproquement....
Hors ligne
#1450 Le 12/11/2016, à 19:56
- enebre
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Merveilleux, en effet ça fonctionne, tu fais mon bonheur aujourd'hui.
Merci chepioq.
Hors ligne