Conky version 1.10

Bureaux,conky et autres personnalisations esthétiques.
Avatar du membre
AngeDesOmbres
Messages : 666
Enregistré le : ven. 12 août 2016 21:30
Localisation : Entre l'ombre et la lumière

Re: Conky version 1.10

Message par AngeDesOmbres »

Dernier message de la page précédente :

loutch a écrit :Hello

Donc voici le pack méteo accuweather @ décompresser dans votre Home

https://drive.google.com/open?id=0Bygxc ... jNOU1hUbEU

Image

La francisation n'est pas complète mais il suffit d'ouvrir le fichier 1_accuweather et de francisé le texte à la suite de la lgne 275 comme celle-ci pour exemple Cloudy

Code : Tout sélectionner

sed -i -e 's/Cloudy/Nuageux/' $HOME/1_accuweather/curr_cond-fr

@+

edit :

changer ceci :

Code : Tout sélectionner

${execi 600 bash $HOME/1_accuweather/1_accuweather -f}
par ceci :

Code : Tout sélectionner

${execi 600 bash $HOME/1_accuweather/1_accuweather -f -h}
Je doit dire que je ne serais pas contre un tuto car mes connaissance sur conky sont a peu pret égale à -10000 :mrgreen:
j'ai décompresser dans mon /home mais je ne sais pas comment l'installer...

Merci d'avance.
Bye
Image
Pingouin dans les champs, hiver très méchant !!!
Qui pisse loin ménage ses chaussures !!! :D

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky version 1.10

Message par loutch »

hello

Mise @ jour du conky 1_accuweather les conkys utilise l'ancienne syntax celui nommé 'ange" utilise la nouvelle .

le pack est ici :

https://drive.google.com/open?id=0Bygxc ... WhPVnRIV2c

conkyrc2015

Image

et celui de notre ami AngesDesOmbres

ange

Image
@+
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Avatar du membre
Cyrrus
Messages : 391
Enregistré le : mar. 29 nov. 2016 01:09
Localisation : French County

Re: Conky version 1.10

Message par Cyrrus »

loutch a écrit :Hello

conky-meteo du site accuweather
il faut Deux packs de ThéoBiGus pris ici :

https://forums.bunsenlabs.org/viewtopic.php?id=189

1b1)Accuweather - Images - 1b1_29-10-15 http://bit.ly/1b1_29-10-15

et

1c)Accuweather Hourly Forecast - 1c_14-3-16 http://bit.ly/1c_14-3-16

@ décompresser dans /home/......

Mon tarz pour les icones du vent http://www.mageialinux-online.org/upload/vents_tar.gz

@ décompresser dans ~/1b_accuweather_images


le conkyrc (en version 1.10)

Code : Tout sélectionner

conky.config = {	
    own_window = true,
	own_window_type = 'normal',
	own_window_transparent = true,
	own_window_hints = 'skip_taskbar,skip_pager,undecorated,below',
	own_window_colour = '#000000',
	
	minimum_width = 650, minimum_height = 160,
	maximum_width = 655,

	gap_x = 450,--# l|r
	gap_y = 254,--# u|d
	alignment = 'top_left',

	use_xft = true,
	font = 'GE Inspira:size=9',

	xftalpha = 1.0,

	override_utf8_locale = true,

	draw_shades = false,
	default_shade_color = '#000000',
	draw_outline = false,
	default_outline_color = '#000000',

	default_color = '#ffffff',--# MintCream
	color1 = '#778899',--# LightSlateGray
	color2 = '#FFA07A',--# LightSalmon
	color3 = '#87CEFA',--# LightSkyBlue
	color4 = '#48D1CC',--# MediumTurquoise
	color5 = '#FFDEAD',--# NavajoWhite
	color6 = '#00BFFF',--# DeepSkyBlue
	color7 = '#ffffff',--# PowderBlue
	color8 = '#FFD700',--# Gold
	color9 = '#ffffff',--# IndianRed

	draw_borders = false,

	stippled_borders = 5,

	border_inner_margin = 5,
	border_outer_margin = 0,

	border_width = 2,

	draw_graph_borders = false,

	background = false,

	use_spacer = 'none',


	no_buffers = true,

	double_buffer = true,

	update_interval = 1,

    lua_load = '~/.conky/lua/image.lua',
    
};

conky.text = [[
#### Lancement du script récupérant les données météo ####
${execi 600 bash $HOME/1b1_accuweather_images/1b1}${execi 700 bash $HOME/1c_accuweather_images_hourly/1c}
##### Heure #####
${voffset -35}${font GE Inspira:size=55}${time %H}:${time %M}${font GE Inspira:size=20}${color 808080}${goto 180}${time %S}$color$font
##### Date #####
${voffset -55}${font GE Inspira:size=14}${alignc -50}${time %A, %d %B %Y}$font
##### Affichage infos vent ######
${goto 310}${font GE Inspira:size=12}Vent : ${execi 90 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} à ${execi 90 sed -n '38p' $HOME/1b1_accuweather_images/curr_cond}
${goto 310}Humiditée : ${execi 90 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${goto 310}Préssion : ${execi 90 sed -n '33p' $HOME/1b1_accuweather_images/curr_cond}
#### Ville ####
${voffset -5}${font GE Inspira:size=14}Sarreguemines : ${font} ${execi 90 sed -n '1p' $HOME/1b1_accuweather_images/messages-fr} 
${font GE Inspira:size=18}${goto 135}${execi 90 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond} °C ${font} Ressentie :  ${voffset -12}${font GE Inspira:size=18}${execi 90 sed -n '30p' $HOME/1b1_accuweather_images/curr_cond} °C 
${goto 555}${voffset -124}${font ubuntu:size=11}N $font
${goto 522}${voffset 8}${font Ubuntu:size=6}NNO ${goto 583}NNE$font
${goto 493}${voffset -6}${font Ubuntu:size=9}NO ${goto 611}NE$font
${goto 486}${voffset 10}${font Ubuntu:size=6}ONO ${goto 618}ENE$font
${goto 468}${voffset 5}${font Ubuntu:size=11}O ${goto 641}E$font
${goto 486}${voffset 9}${font Ubuntu:size=6}OSO ${goto 618}ESE
${goto 493}${voffset 16}${font Ubuntu:size=9}SO ${goto 611}SE$font
${goto 522}${voffset -4}${font Ubuntu:size=6}SSO ${goto 583}SSE
${goto 555}${voffset 4}${font Ubuntu:size=11}S $font
#### Affichage trois prochaines heures et trois prochains jours ####
${voffset -60}${goto 20}${time %H} h\
${goto 95}${tztime GMT-3 %H} h\
${goto 170}${tztime GMT-4 %H} h\
${goto 245}${execi 3600 echo `date --date="1 day" | awk '{print $1" "$2}'`}\
${goto 320}${execi 3600 echo `date --date="2 day" | awk '{print $1" "$2}'`}\
${goto 400}${execi 3600 echo `date --date="3 day" | awk '{print $1" "$2}'`}
##### Affichage temperatures #####
${voffset 25}
T${goto 20}${execpi 90 sed -n '52p' $HOME/1c_accuweather_images_hourly/hourly_raw1}\
${goto 95}${execi 90 sed -n '53p' $HOME/1c_accuweather_images_hourly/hourly_raw1}\
${goto 170}${execi 90 sed -n '54p' $HOME/1c_accuweather_images_hourly/hourly_raw1}\
${goto 245}${color9}${execi 90 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°${color}/${color7}${execi 90 sed -n '9p' $HOME/1b1_accuweather_images/first_days}°${color}\
${goto 320}${color9}${execi 90 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°${color}/${color7}${execi 90 sed -n '14p' $HOME/1b1_accuweather_images/first_days}°${color}\
${goto 400}${color9}${execi 90 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°${color}/${color7}${execi 90 sed -n '19p' $HOME/1b1_accuweather_images/first_days}°${color}
#### icones conditions actuelles et vent ####
${lua fDrawImage $HOME/1b1_accuweather_images/cc.png 180 5 132 70 0}${lua fDrawImage $HOME/1b1_accuweather_images/Wind1.png 465 -10 190 190 0}\
#### icones 3 prochaines heures et tois prochains jours ####
${lua fDrawImage $HOME/1c_accuweather_images_hourly/20.png 0 120 70 40 0}\
${lua fDrawImage $HOME/1c_accuweather_images_hourly/23.png 75 120 70 40 0}\
${lua fDrawImage $HOME/1c_accuweather_images_hourly/26.png 150 120 70 40 0}\
${lua fDrawImage $HOME/1b1_accuweather_images/6.png 225 120 70 40 0}\
${lua fDrawImage $HOME/1b1_accuweather_images/11.png 300 120 70 40 0}\
${lua fDrawImage $HOME/1b1_accuweather_images/16.png 380 120 70 40 0}
${voffset -800}
]];
fichier 1b1.sh

Code : Tout sélectionner

#!/bin/bash

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
address="http://www.accuweather.com/en/fr/sarreguemines/57200/weather-forecast/135050"
#address="http://www.accuweather.com/en/us/new-york-ny/10017/weather-forecast/349727"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

kill -STOP $(pidof conky)
killall wget

wget --save-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/curr_cond_raw $curr_addr
wget --load-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/first_days_raw $addr1
wget --load-cookies $HOME/1b1_accuweather_images/cookie -O $HOME/1b1_accuweather_images/last_days_raw $addr2

#Current Conditions - curr_cond file
if [[ -s $HOME/1b1_accuweather_images/curr_cond_raw ]]; then

    egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|icons-wind\/.*gif|text-align:center\;\">.*h</div>|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |"start">|"finish">' $HOME/1b1_accuweather_images/curr_cond_raw > $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/"temp">/\n/g' -e 's/^.*icons-wind\///g' -e 's/^.*text-align:center\;\">//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' -e 's/mb.*$/mb/g' $HOME/1b1_accuweather_images/curr_cond
    sed -i -e 's/-s\|-xl.*$//g' -e 's/in &.*$/in/g' -e 's/\.gif.*$//g' -e 's/<\/div>.*$//g' $HOME/1b1_accuweather_images/curr_cond
    time=$(sed -n 1p $HOME/1b1_accuweather_images/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 3a- $HOME/1b1_accuweather_images/curr_cond
	fi
    line35=$(sed -n 35p $HOME/1b1_accuweather_images/curr_cond)
    sed -i '35d' $HOME/1b1_accuweather_images/curr_cond
    sed -i 35a$line35 $HOME/1b1_accuweather_images/curr_cond
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 27p $HOME/1b1_accuweather_images/curr_cond).png $HOME/1b1_accuweather_images/cc.png
fi


#First 5days - first_days file 
if [[ -s $HOME/1b1_accuweather_images/first_days_raw ]]; then

    sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' $HOME/1b1_accuweather_images/first_days_raw
    egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/1b1_accuweather_images/first_days_raw > $HOME/1b1_accuweather_images/first_days

    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e '/realfeel/s/^.*; //g' $HOME/1b1_accuweather_images/first_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/1b1_accuweather_images/first_days
	sed -i -e 's/Today/TODAY/' -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/1b1_accuweather_images/first_days
    sed -i 's/-s\|-l\|-xl.*$//g' $HOME/1b1_accuweather_images/first_days
    time=$(sed -n 1p $HOME/1b1_accuweather_images/curr_cond)
    if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
        sed -i 2a- $HOME/1b1_accuweather_images/first_days
	fi
	L1=$(sed -n 1p $HOME/1b1_accuweather_images/first_days)
    if [[ $L1 == TODAY ]]; then
        sed -i 1d $HOME/1b1_accuweather_images/first_days
	fi
    for (( i=6; i<=21; i+=5 ))
	  do
	      cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/$i.png
	  done
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 25p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/tod.png
	cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n 30p $HOME/1b1_accuweather_images/first_days).png $HOME/1b1_accuweather_images/ton.png

fi


#Last 5days - last_days file 
if [[ -s $HOME/1b1_accuweather_images/last_days_raw ]]; then

    sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' $HOME/1b1_accuweather_images/last_days_raw
    egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/1b1_accuweather_images/last_days_raw > $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/1b1_accuweather_images/last_days
    sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/1b1_accuweather_images/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/1b1_accuweather_images/last_days
    sed -i 's/-s\|-l\|-xl.*$//g' $HOME/1b1_accuweather_images/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
	      cp $HOME/1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p $HOME/1b1_accuweather_images/last_days).png $HOME/1b1_accuweather_images/last_$i.png
	  done

fi

#messages file
sed -n 28p $HOME/1b1_accuweather_images/curr_cond | cut -c -20 > $HOME/1b1_accuweather_images/messages
sed -n 29p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
sed -n 34p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
for (( i=7; i<=22; i+=5 ))
  do
      sed -n ${i}p $HOME/1b1_accuweather_images/first_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
  done
for (( i=3; i<=23; i+=5 ))
  do
      sed -n ${i}p $HOME/1b1_accuweather_images/last_days | cut -c -20 >> $HOME/1b1_accuweather_images/messages
  done
  
# icone direction vent 
wind_direction=$(sed -n 31p $HOME/1b1_accuweather_images/curr_cond)
if [[ $wind_direction == "S" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"02.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "South" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"02.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "SSW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"03.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "SW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"04.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "WSW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"05.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "W" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"06.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "West" ]]; then
	cp $HOME/1b1_accuweather_images/"06.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "WNW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"07.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "NW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"08.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "NNW" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"09.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "N" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"10.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "North" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"10.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "NNE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"11.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "NE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"12.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "ENE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"13.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "E" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"14.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "East" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"14.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "ESE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"15.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "SE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"16.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "SSE" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"17.png" $HOME/1b1_accuweather_images/Wind1.png
elif [[ $wind_direction == "Variable" ]]; then
	cp $HOME/1b1_accuweather_images/vents/"00.png" $HOME/1b1_accuweather_images/Wind1.png
fi

  
## English to French
cp $HOME/1b1_accuweather_images/messages $HOME/1b1_accuweather_images/messages-fr
if [[ -s $HOME/1b1_accuweather_images/messages-fr ]]; then
	sed -i -e 's/Clouds and sun/Nuages et soleil/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Turning cloudy and less humid/Moins nuageux et moins humide/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/A couple of showers/Averses éparses/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Mostly cloudy/Ciel plutôt nuageux/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Rain and drizzle/Pluie et bruine/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Cloudy with a couple/Nuages épars/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Cloudy with a bit of/Nuageux,Faible pluie/' $HOME/1b1_accuweather_images/messages-fr	
	sed -i -e 's/Cloudy/Nuageux/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/A few a.m. showers,/Pluies l'\''après-midi/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Showers around in th/Quelques averses l'\''après-midi/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/breezy/Venteux/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Times of clouds and/Nuages épars avec soleil/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/A little morning rai/Faible pluie le matin/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/a little morning rai/Faible pluie le matin/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/A touch of afternoon/Faible pluie l'\''après-midi/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Periods of rain/Pluies intermittentes/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Rain shover/Averses de pluie/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Rain/Pluie/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Light rain/Pluie/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Foggy/Brumeux/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Dense fog/Brouillard dense/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Light fog/Léger brouillard/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Mist/Brume/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Light rain shower/Pluie faible/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Partly cloudy/Partiellement nuageux/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/shower/averses/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Som sun,then turni/Mitigé/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Sunny/Ensoleillé/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Freezing rain/Pluie verglaçante/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Partly sunny/Partiellement ensoleillé/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/Clear/Clair/' $HOME/1b1_accuweather_images/messages-fr
	sed -i -e 's/snow/neige/' $HOME/1b1_accuweather_images/messages-fr
fi


sed -i -e 's/NW/NO/g' -e 's/WNW/ONO/g' -e 's/NNW/NNO/g' -e 's/W/O/g' -e 's/SSW/SSO/g' -e 's/SW/SO/g' -e 's/WSW/OSO/g' -e 's/W/O/g' /$HOME/1b1_accuweather_images/curr_cond

kill -CONT $(pidof conky)
fichier 1c.sh

Code : Tout sélectionner

#!/bin/bash

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
address="http://www.accuweather.com/en/fr/sarreguemines/57200/weather-forecast/135050"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"

kill -STOP $(pidof conky)
killall wget
rm $HOME/1c_accuweather_images_hourly/*.png

wget --save-cookies $HOME/1c_accuweather_images_hourly/cookie -O $HOME/1c_accuweather_images_hourly/curr_cond_raw $curr_addr
wget --load-cookies $HOME/1c_accuweather_images_hourly/cookie -O $HOME/1c_accuweather_images_hourly/hourly_raw1 $addr1
 
#First 8hrs - hourly_raw1 file
if [[ -s $HOME/1c_accuweather_images_hourly/hourly_raw1 ]]; then
	sed -i -e '/"arrow-small-right">Next 8 hours/,/"chart chart-top"/!d' -e 's/&#176;/°/g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i '/td style="border-right/d' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/^.*<th>//g' -e 's/^.*<td class="//g' -e 's/^.*<div class="//g' $HOME/1c_accuweather_images_hourly/hourly_raw1 
	sed -i -e 's/ icon.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/^">\|first-col">\|last-col">//g' -e 's/<\/td>.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e '60,67s/^.*>//g' -e 's/^.*row">\|<\/th>//g' -e 's/&#174;\|&deg;//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/^.*row">\|<\/th>//g' -e 's/&#174;\|&deg;//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/^.*<\/span><\/div>//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/">/\n/g' -e '/<tr\|<\/tr>/d' -e 's/" class="arrow-small-right.*$//g' -e 's/^.*<span>//g' -e 's/<\/span><br \/>/:/g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/<\/div>.*$//g' -e 's/^.*icon i-//g' -e '/<th class="first/d' -e 's/^.*<th class="//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/^.*<a href="//g' -e 's/" class=".*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e '/<\|;/d' -e 's/\r//g' -e '/^ *$/d' -e 's/^ *//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	sed -i -e 's/day.*$/day/g' -e 's/night.*$/night/g' -e 's/-h.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw1
	for (( i=20; i<=41; i+=3 ))
	  do
    	  cp $HOME/1c_accuweather_images_hourly/Forecast_Images/$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1).png $HOME/1c_accuweather_images_hourly/$i.png
	  done
	for (( i=21; i<=50; i+=3 ))
	  do
		  no=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1|wc -c)
			if (( no<=7 )); then
				sed -i $i"s/$/\n/" $HOME/1c_accuweather_images_hourly/hourly_raw1
				i=$((i+1))
			elif (( no>7 )); then
				sed -i $i"s/^\(.\{7\}\)/\1\n/" $HOME/1c_accuweather_images_hourly/hourly_raw1
				i=$((i+1))
			fi
	  done
fi

addr2=$(sed -n 1p $HOME/1c_accuweather_images_hourly/hourly_raw1)
wget --load-cookies $HOME/1c_accuweather_images_hourly/cookie -O $HOME/1c_accuweather_images_hourly/hourly_raw2 $addr2

#Next 8hrs - hourly_raw2 file
if [[ -s $HOME/1c_accuweather_images_hourly/hourly_raw2 ]]; then
	sed -i -e '/"arrow-small-right">Next 8 hours/,/"chart chart-top"/!d' -e 's/&#176;/°/g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i '/td style="border-right/d' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/^.*<th>//g' -e 's/^.*<td class="//g' -e 's/^.*<div class="//g' $HOME/1c_accuweather_images_hourly/hourly_raw2 
	sed -i -e 's/ icon.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/^">\|first-col">\|last-col">//g' -e 's/<\/td>.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e '60,67s/^.*>//g' -e 's/^.*row">\|<\/th>//g' -e 's/&#174;\|&deg;//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/^.*row">\|<\/th>//g' -e 's/&#174;\|&deg;//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/^.*<\/span><\/div>//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/">/\n/g' -e '/<tr\|<\/tr>/d' -e 's/" class="arrow-small-right.*$//g' -e 's/^.*<span>//g' -e 's/<\/span><br \/>/:/g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/<\/div>.*$//g' -e 's/^.*icon i-//g' -e '/<th class="first/d' -e 's/^.*<th class="//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/^.*<a href="//g' -e 's/" class=".*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e '/<\|;/d' -e 's/\r//g' -e '/^ *$/d' -e 's/^ *//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	sed -i -e 's/day.*$/day/g' -e 's/night.*$/night/g' -e 's/-h.*$//g' $HOME/1c_accuweather_images_hourly/hourly_raw2
	for (( i=20; i<=41; i+=3 ))
	  do
    	  cp $HOME/1c_accuweather_images_hourly/Forecast_Images/$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2).png $HOME/1c_accuweather_images_hourly/$(( $i+100 )).png
	  done
	for (( i=21; i<=50; i+=3 ))
	  do
		  no=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2|wc -c)
			if (( no<=7 )); then
				sed -i $i"s/$/\n/" $HOME/1c_accuweather_images_hourly/hourly_raw2
				i=$((i+1))
			elif (( no>7 )); then
				sed -i $i"s/^\(.\{7\}\)/\1\n/" $HOME/1c_accuweather_images_hourly/hourly_raw2
				i=$((i+1))
			fi
	  done
fi


# Full info - altogether file
rm $HOME/1c_accuweather_images_hourly/altogether
#TEMP
echo "\${color ffffff}\${goto 10}\${hr 1}" > $HOME/1c_accuweather_images_hourly/altogether
echo "Temp.\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=52; i<=59; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "2s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=52; i<=59; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "2s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#REALFEEL
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Res.\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=61; i<=68; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "4s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=61; i<=68; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "4s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#HUMIDITY
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Humiditée\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=70; i<=77; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "6s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=70; i<=77; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "6s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#RAIN
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Prob.pluie\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=79; i<=86; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "8s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=79; i<=86; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "8s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#SNOW
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Prob.neige\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=88; i<=95; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "10s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=88; i<=95; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "10s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#ICE
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Gelée\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=97; i<=104; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "12s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=97; i<=104; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "12s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#WIND
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Vent\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=106; i<=113; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "14s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=106; i<=113; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "14s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#UV INDEX
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Index uv\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=115; i<=122; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "16s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=115; i<=122; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "16s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#CLOUD COVER
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Couv. Nuage\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=124; i<=131; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "18s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=124; i<=131; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "18s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
#DEW POINT
echo "\${color ffffff}\${goto 100}\${hr 1}" >> $HOME/1c_accuweather_images_hourly/altogether
echo "Point rosée (°C)\${color}" >> $HOME/1c_accuweather_images_hourly/altogether
jump_to=100
for (( i=133; i<=140; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw1)
	sed -i "20s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
for (( i=133; i<=140; i+=1 ))
do
	temp=$(sed -n ${i}p $HOME/1c_accuweather_images_hourly/hourly_raw2)
	sed -i "20s/$/\${goto $jump_to}$temp/" $HOME/1c_accuweather_images_hourly/altogether
	jump_to=$(( jump_to+=60 ))
done
 
  ## English to French
cp $HOME/1c_accuweather_images_hourly/hourly_raw1 $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
if [[ -s $HOME/1c_accuweather_images_hourly/hourly_raw1-fr ]]; then
	sed -i -e 's/Clouds and sun/Nuages et soleil/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/A couple of showers/Averses éparses/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr	
	sed -i -e 's/cloudy/Nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Mostly Cloudy/Ciel plutôt nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Rain and drizzle/Pluie et bruine/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Cloudy with a couple/Nuages épars/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Cloudy with a bit of/Nuageux,Faible pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr		
	sed -i -e 's/Showers/Averses/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/breezy/Venteux/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Times of clouds and/Nuages épars avec soleil/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Rain shover/Averses de pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Rain/Pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Light rain/Pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Cloudy/Nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Mostly cloudy/Peu nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Mostly/Peu/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Partly/Partiel./' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Sunny/Ensoleillé/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Clear/Clair/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Fog/Brouillard/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Snow/Neige/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Flurrie/Bourasque/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/s/Neige/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Freezing Rain/Pluie verglassante/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Freezin/Verglas/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/g Rain/et pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
	sed -i -e 's/Freezing Rain/Pluie verglassante/' $HOME/1c_accuweather_images_hourly/hourly_raw1-fr
fi

 ## English to French
cp $HOME/1c_accuweather_images_hourly/hourly_raw2 $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
if [[ -s $HOME/1c_accuweather_images_hourly/hourly_raw2-fr ]]; then
	sed -i -e 's/Clouds and sun/Nuages et soleil/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/A couple of showers/Averses éparses/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr	
	sed -i -e 's/cloudy/Nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Mostly Cloudy/Ciel plutôt nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Rain and drizzle/Pluie et bruine/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Cloudy with a couple/Nuages épars/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Cloudy with a bit of/Nuageux,Faible pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr		
	sed -i -e 's/Showers/Averses/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/breezy/Venteux/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Times of clouds and/Nuages épars avec soleil/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Rain shover/Averses de pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Rain/Pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Light rain/Pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Cloudy/Nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Mostly cloudy/Peu nuageux/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Mostly/Peu/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Partly/Partiel./' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Sunny/Ensoleillé/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Clear/Clair/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Fog/Brouillard/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Snow/Neige/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Flurrie/Bourasque/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/s/Neige/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Freezing Rain/Pluie verglassante/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Freezing/Verglas/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/g Rain/et pluie/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	sed -i -e 's/Freezing Rain/Pluie verglassante/' $HOME/1c_accuweather_images_hourly/hourly_raw2-fr
	
fi
       sed -i -e 's/NW/NO/g' -e 's/WNW/ONO/g' -e 's/NNW/NNO/g' -e 's/W/O/g' -e 's/SSW/SSO/g' -e 's/SW/SO/g' -e 's/WSW/OSO/g' /$HOME/1c_accuweather_images_hourly/altogether
       
 
kill -CONT $(pidof conky)

Ce qui donne ceci :


Image


@+
Hello, c'est dommage les liens sont morts et j'adore ton conky ... si quelqu'un avait la possibilité de réuploader ça quelque-part, ça serait génial !

En tout cas, bravo :)

Avatar du membre
toryx
Messages : 194
Enregistré le : dim. 11 sept. 2016 21:57

Re: Conky version 1.10

Message par toryx »

hello Cyrrus
tu à un lien de la dernière mise à jours juste au dessus de ton reply, et le lien est ok ;)
dual-boot: archlinux-cinnamon - windows11
CPU: i5 10600k - CM: MPG Z490 GP - RAM: Corsair Vengeance LPX DDR4 3200 MHz CL16 (4X 8GO)
GPU: NVIDIA GeForce RTX 3060 LH
NVIDIA GeForce GTX 1050 Ti (pasthrough vers qemu/kvm)
KVM: Windows 11 - MacOS Monterey

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky version 1.10

Message par loutch »

Hello

Conky version cercle fonctionne tel-quel en version 1.9 et en 1.10 j'ai pas d'erreur dans le terminal)

le conkyrc :

Code : Tout sélectionner

# — Conky settings — #
background no
update_interval 1

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

temperature_unit celsius

# — Window specifications — #

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,skip_taskbar,skip_pager,below
minimum_size 1030 120
maximum_width 1030


alignment tl
gap_x 280
gap_y 80

# — Graphics settings — #
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no

# — Text settings — #
use_xft yes
xftfont GE Inspira:size=8
xftalpha 0.5

uppercase no
default_shade_color 000000
default_color ffffff
color1 FFFFFF

# — Lua Load — #

	lua_load ~/.conky/hublot/conky/clock_rings.lua
	lua_draw_hook_pre clock_rings
	
TEXT
${image ~/.conky/hublot/conky/orb-1b.png -p 0,-2} 

${image ~/.conky/hublot/conky/orb-1a.png -p 150,-2}
${alignc 298}${font GE Inspira:size=26}${cpu cpu0}$font
${goto 208}cpu [ % ]
${goto 214}${exec expr `cat /sys/class/hwmon/hwmon2/temp1_input` / 1000}°
${image ~/.conky/hublot/conky/orb-1a.png -p 300,-2}
${goto 354}${voffset -60}${font GE Inspira:size=26}${memperc}$font
${goto 352}mem [ % ]
${goto 358}TC${execi 120 hddtemp -n /dev/sda} °C 
${image ~/.conky/hublot/conky/orb-1a.png -p 450,-2}
${goto 506}${voffset -60}${font GE Inspira:size=26}${fs_used_perc /}$font
${goto 506}rac.[ % ]
${goto 506}TD${hwmon 0 temp 1} °C
${image ~/.conky/hublot/conky/orb-1a.png -p 600,-2}
${goto 655}${voffset -60}${font GE Inspira:size=26}${fs_used_perc /home}$font
${goto 649}home ${color}[ % ] 
${image ~/.conky/hublot/conky/orb-1a.png -p 750,-2}
${alignc -300}${voffset -40}${font GE Inspira:size=16}${downspeedf wlp2s0}$font
${goto 798}entrant [ k/s ]
${image ~/.conky/hublot/conky/orb-1a.png -p 900,-2}
${alignc -452}${voffset -40}${font Ge Inspira:size=16}${upspeedf wlp2s0}$font
${goto 950}sortant [ k/s ]
${voffset -240}
le clock_rings.lua

Code : Tout sélectionner

--[[
Infinity by Harshit 
original by someone i can't remeber the name
This script draws the left rings of the screen that is with the clock

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
	lua_load ~/scripts/haunted.lua
	lua_draw_hook_pre ring_stats
	
Changelog:
+ v1.0 -- Original release (07/06/2012)
]]

settings_table = {
	{
		-- Edit this table to customise your rings.
		-- You can create more rings simply by adding more elements to settings_table.
		-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
		name='time',
		-- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
		arg='%I.%M',
		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
		max=12,
		-- "bg_colour" is the colour of the base ring.
		bg_colour=0xffffff,
		-- "bg_alpha" is the alpha value of the base ring.
		bg_alpha=0.0,
		-- "fg_colour" is the colour of the indicator part of the ring.
		fg_colour=0x86eeff,
		-- "fg_alpha" is the alpha value of the indicator part of the ring.
		fg_alpha=0.0,
		-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
		x=67, y=61,
		-- "radius" is the radius of the ring.
		radius=30,
		-- "thickness" is the thickness of the ring, centred around the radius.
		thickness=2,
		-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
		start_angle=0,
		-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle.
		end_angle=360
	},
	{
		name='cpu',
		arg='cpu0',
		max=100,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=222, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
	{
		name='memperc',
		arg='',
		max=100,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=372, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
	{
		name='fs_used_perc',
		arg='/',
		max=100,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=522, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
	{
		name='fs_used_perc',
		arg='/home',
		max=100,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=672, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
	{
		name='downspeedf',
		arg='wlp2s0',
		max=450,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=822, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
	
	{
		name='upspeedf',
		arg='wlp2s0',
		max=450,
		bg_colour=0xffffff,
		bg_alpha=0.0,
		fg_colour=0xffffff,
		fg_alpha=0.2,
		x=972, y=59,
		radius=36,
		thickness=8,
		start_angle=-90,
		end_angle=180
	},
		
}

-- Use these settings to define the origin and extent of your clock.

clock_r=29



clock_x=71
clock_y=61

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.


clock_colour=0xffffff
clock_alpha=0.5



show_seconds=true

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
	local w,h=conky_window.width,conky_window.height

	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

	local angle_0=sa*(2*math.pi/360)-math.pi/2
	local angle_f=ea*(2*math.pi/360)-math.pi/2
	local t_arc=t*(angle_f-angle_0)

	

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
	cairo_set_line_width(cr,ring_w)
	cairo_stroke(cr)

	

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
	cairo_stroke(cr)
end

function draw_clock_hands(cr,xc,yc)
	local secs,mins,hours,secs_arc,mins_arc,hours_arc
	local xh,yh,xm,ym,xs,ys

	secs=os.date("%S")
	mins=os.date("%M")
	hours=os.date("%I")

	secs_arc=(2*math.pi/60)*secs
	mins_arc=(2*math.pi/60)*mins+secs_arc/60
	hours_arc=(2*math.pi/12)*hours+mins_arc/12

	

	xh=xc+0.7*clock_r*math.sin(hours_arc)
	yh=yc-0.7*clock_r*math.cos(hours_arc)
	cairo_move_to(cr,xc,yc)
	cairo_line_to(cr,xh,yh)

	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
	cairo_set_line_width(cr,5)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
	cairo_stroke(cr)

	

	xm=xc+clock_r*math.sin(mins_arc)
	ym=yc-clock_r*math.cos(mins_arc)
	cairo_move_to(cr,xc,yc)
	cairo_line_to(cr,xm,ym)

	cairo_set_line_width(cr,3)
	cairo_stroke(cr)

	

	if show_seconds then
		xs=xc+clock_r*math.sin(secs_arc)
		ys=yc-clock_r*math.cos(secs_arc)
		cairo_move_to(cr,xc,yc)
		cairo_line_to(cr,xs,ys)

		cairo_set_line_width(cr,1)
		cairo_stroke(cr)
	end
end

function conky_clock_rings()
	local function setup_rings(cr,pt)
		local str=''
		local value=0

		str=string.format('${%s %s}',pt['name'],pt['arg'])
		str=conky_parse(str)

		value=tonumber(str)
		if value == nil then value = 0 end
		pct=value/pt['max']

		draw_ring(cr,pct,pt)
	end

	

	if conky_window==nil then return end
	local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)

	local cr=cairo_create(cs)	

	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)

	if update_num>5 then
		for i in pairs(settings_table) do
			setup_rings(cr,settings_table[i])
		end
	end

	draw_clock_hands(cr,clock_x,clock_y)
end

--[[ RING WIDGET ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
	"name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
	"arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
	"max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
	"bg_colour" is the colour of the base ring.
	"bg_alpha" is the alpha value of the base ring.
	"fg_colour" is the colour of the indicator part of the ring.
	"fg_alpha" is the alpha value of the indicator part of the ring.
	"x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
	"radius" is the radius of the ring.
	"thickness" is the thickness of the ring, centred around the radius.
	"start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
	"end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]

function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
	local function rgb_to_r_g_b(colour,alpha)
		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
	end
	
	local function draw_ring(pct)
		local angle_0=sa*(2*math.pi/360)-math.pi/2
		local angle_f=ea*(2*math.pi/360)-math.pi/2
		local pct_arc=pct*(angle_f-angle_0)

		-- Draw background ring

		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
		cairo_set_line_width(cr,t)
		cairo_stroke(cr)
	
		-- Draw indicator ring

		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
		cairo_stroke(cr)
	end
	
	local function setup_ring()
		local str = ''
		local value = 0
		
		str = string.format('${%s %s}', name, arg)
		str = conky_parse(str)
		
		value = tonumber(str)
		if value == nil then value = 0 end
		pct = value/max
		
		draw_ring(pct)
	end	
	
	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)
	
	if update_num>5 then setup_ring() end
end

--[[ END RING WIDGET ]]
icônes sont ici :

https://drive.google.com/open?id=0Bygxc ... UFKMEp6TnM


ce qui donne ceci


Image

@+
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Avatar du membre
Cyrrus
Messages : 391
Enregistré le : mar. 29 nov. 2016 01:09
Localisation : French County

Re: Conky version 1.10

Message par Cyrrus »

Salut

merci pour le partage ton conky est très chouette ;)

Avatar du membre
Toad_Fr
Messages : 175
Enregistré le : mar. 23 août 2016 13:44
Localisation : Eure

Re: Conky version 1.10

Message par Toad_Fr »

Salut les gens,

Je voudrais me mettre au conky mais après pas mal de recherches j'ai du mal a trouver un tuto claire en français qui ne soit pas totalement obsolète depuis la 1.10, ce qui n'es pas un drame car je n'ai aucune notion des versions précédente donc je commencerais en 1.10 +

je ne suis pas un codeur et mes connaissances se limite au .conf de Minetest et le bidouillage des Mods quand j'ai du bol et que j'ai bien "déchifré" le code.
J'arrive a me dépatouiller quand c'est écrit mais partir de rien c'est une autre histoire.

En doc pour du 1.10 j'ai trouver que ça :

https://github.com/brndnmtthws/conky/wi ... n-Settings
https://github.com/brndnmtthws/conky/wi ... -Variables
https://github.com/brndnmtthws/conky/wiki/Lua-API
......
Je pense que ces liens contiennent toute les infos.
Mais je vous avoue que tout en anglais la c'est chaud et du google translate ça ne le fera pas.
Tout le wiki ubuntu en français semble obsolète a première vu.
Alors es-ce que l'on a dans le forum, un(e) vrai(e) pro, à l’âme charitable et qui maîtrise l'anglais pour nous faire un tuto de la mort en français ?

je veux commencer simple Os, kernel, porocess, ram, reseau up/down, etc...
après les graphs en barre ou arrondi avec les % dans les graph.

Bref je sais que c'est du gros boulot de traduction mais ce serais cool.

Pour ce qui es de :
Installer conky-all, conky-manger .....
Tout ça c'est bon, j'ai tout de fonctionnel déjà.
Image

zeb
Messages : 16473
Enregistré le : ven. 19 juin 2015 22:13
Localisation : plus ici

Re: Conky version 1.10

Message par zeb »

Bonjour ;)
Merci de relancer un sujet digne des plus grandes :l :lol:

Tous les conseils demandé ont étés "résolu" en 2 messages maxi ;)
Même si je considère plus le sujet de loutch comme un tuto, je le laisse ouvert.
Mais attention si la question de casp3r est toujours présente dans 2 pages, je verrouille le sujet ;)

Merci !

@loutch, si tu as un souhait particulier pour ce sujet, →mp ;)

zeb
Messages : 16473
Enregistré le : ven. 19 juin 2015 22:13
Localisation : plus ici

Re: Conky version 1.10

Message par zeb »

Merci d'avoir ouvert un nouveau sujet pour ta question qui je pense va durer plus d'une réponse ;)
En voici le lien viewtopic.php?p=138295#p138295 ;)

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky version 1.10

Message par loutch »

Image

cronographe

pack-cronograph icihttps://www.deviantart.com/hfcf/art/Con ... -278646771
pack-meteo ici https://forums.bunsenlabs.org/viewtopic.php?id=189

conkyrc

Code : Tout sélectionner

conky.config = {
    background = true,
    use_xft = true,
    font = 'hooge 05_53:size=6',
    xftalpha = 1,
    update_interval = 1.0,
    total_run_times = 0,
        net_avg_samples = 2,
    own_window = true,
    own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
    own_window_type = 'normal',
    own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
    double_buffer = true,
    minimum_width = 320, minimum_height = 320,
        maximum_width = 320,
    text_buffer_size = 2048,
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    draw_graph_borders = false,
    default_color = 'white',
    default_outline_color = 'white',
    alignment = 'top_right',
    gap_x = 120,
    gap_y = 70,
    no_buffers = true,
    uppercase = false,
    cpu_avg_samples = 2,
    override_utf8_locale = true,
imlib_cache_flush_interval = 60,
    imlib_cache_size = 10000,
    stippled_borders = 5,
-- Couleurs
    default_color         = '#ffffff',      --ffd579
    default_shade_color   = '#333333',
    default_outline_color = 'black',
color0 = 'white',
color1 = 'orange',
color2 = 'green',
color3 = '#000000',
color4 = '#FF0000',
color5 = '#696969',
color6 = '#BDB76B',
color7 = '#00FF01',
color8 = '#cccccc',
 lua_load = '~/.conky/cronograph/scripts/cups.lua',
lua_draw_hook_post = 'main',
};
conky.text = [[
${execi 3600 bash $HOME/1_accuweather/1_accuweather -f2016}
${voffset 85}${goto 85}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 215}UPTIME:
${voffset 2}${goto 72}${time %a %d %b}${goto 215}${uptime}
${voffset 2}${goto 90}${time %Y}${alignc -75}Temp.${hwmon 0 temp 1}°C
${voffset 84}${goto 75}Signal: ${wireless_link_qual_perc wlo1} %
${voffset -60}${goto 146}${font conkyweather:size=34}${execi 600  sed -n '22p' $HOME/1_accuweather/curr_cond}${font}
${voffset -60}${goto 154}${font hooge 05_53:size=12}${execpi 600 sed -n '2p' ~/1_accuweather/curr_cond}°C${font}
${voffset -16}${goto 200}${execpi 600 sed -n '4p' ~/1_accuweather/curr_cond | cut -c1-14}
              ${goto 200}${execpi 600 sed -n '4p' ~/1_accuweather/curr_cond | cut -c15-30}
              ${goto 200}Vent: ${execpi 600 sed -n '5p' ~/1_accuweather/curr_cond} ${execpi 600 sed -n '6p' ~/1_accuweather/curr_cond}
              ${goto 200}Hum: ${execpi 600 sed -n '7p' ~/1_accuweather/curr_cond}
${voffset -3}${font conkyweather:size=20}${goto 230}${execi 600  sed -n '27p' $HOME/1_accuweather/first_days}${font}
${voffset 1}${goto 220}${execi 600  sed -n '9p' $HOME/1_accuweather/first_days}°C - ${execi 600sed -n '8p' $HOME/1_accuweather/first_days}°C                              
            ${goto 225}${execi 3600 echo `date --date="1 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="1 day" | awk '{print $2}'`}\
${voffset -10}${font conkyweather:size=20}
${goto 90}${execi 600  sed -n '28p' $HOME/1_accuweather/first_days}
${voffset -34}${goto 226}${execi 600  sed -n '29p' $HOME/1_accuweather/first_days}${font}
${voffset -1}
${goto 80}${execi 600  sed -n '14p' $HOME/1_accuweather/first_days}°C - ${execi 600  sed -n '13p' $HOME/1_accuweather/first_days}°C\
${goto 215}${execi 600  sed -n '19p' $HOME/1_accuweather/first_days}°C - ${execi 600  sed -n '18p' $HOME/1_accuweather/first_days}°C
${goto 80}${execi 3600 echo `date --date="2 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="2 day" | awk '{print $2}'`}\
${goto 215}${execi 3600 echo `date --date="3 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="3 day" | awk '{print $2}'`}
${execpi 1 cat ~/.conky/cronograph/scripts/blinkingLED}
]];


conkyrc1 (pour le deuxième lua)

Code : Tout sélectionner

conky.config = {
    background = true,
    use_xft = true,
    font = 'hooge 05_53:size=6',
    xftalpha = 1,
    update_interval = 1.0,
    total_run_times = 0,
        net_avg_samples = 2,
    own_window = true,
    own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
    own_window_type = 'normal',
    own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
    double_buffer = true,
    minimum_width = 320, minimum_height = 320,
        maximum_width = 320,
    text_buffer_size = 2048,
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    draw_graph_borders = false,
    default_color = 'white',
    default_outline_color = 'white',
    alignment = 'top_right',
    gap_x = 120,
    gap_y = 70,
    no_buffers = true,
    uppercase = false,
    cpu_avg_samples = 2,
    override_utf8_locale = true,
imlib_cache_flush_interval = 60,
    imlib_cache_size = 10000,
    stippled_borders = 5,
-- Couleurs
    default_color         = '#ffffff',      --ffd579
    default_shade_color   = '#333333',
    default_outline_color = 'black',
color0 = 'white',
color1 = 'orange',
color2 = 'green',
color3 = '#000000',
color4 = '#FF0000',
color5 = '#696969',
color6 = '#BDB76B',
color7 = '#00FF01',
color8 = '#cccccc',
 lua_load = '~/.conky/cronograph/scripts/clock_rings2a.lua',
lua_draw_hook_pre = 'clock_rings',
};
conky.text = [[
]];

cups.lua

Code : Tout sélectionner

---
--==============================================================================
--                  Cups and Saucers
--                               Lua conky script
--
--  author  : Abu Yahya
--  license : Distributed under the terms of GNU GPL v3
--  30.05.2012
-- v.1.0.1
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
----Adjustable Settings 
coffee_table = {
    {
    name='time',                   arg='%I',                    max_value=12,
    x=170,                         y=170,
    cup_radius=35,
    cup_wall_thickness=90,
    cup_bg_clr=0xffffff,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_length=70,              handle_circ=5,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0, --1.0
    graduation_radius=124,
    graduation_thickness=8,        graduation_mark_circ=1.5,
    graduation_mark_angle=30,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.5,
    saucer_thickness=6,            thick_saucer_circ=11/12,    
    saucer_radius=135,             thin_saucer_circ=11/12,    
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.3, 
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.0,
    inner_saucer=true, 
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=0.0,
    caption='',                    caption2='',
    },
   {
    name='time',                   arg='%H',                    max_value=12,
    x=170,                         y=170,
    cup_radius=2.5,
    cup_wall_thickness=3,
    cup_bg_clr=0xffffff,           cup_bg_alpha=1.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=1.0,
    handle_length=40,              handle_circ=4,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0, --1.0
    graduation_radius=127,
    graduation_thickness=1,        graduation_mark_circ=0.5,
    graduation_mark_angle=3,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.5,
    saucer_thickness=6,            thick_saucer_circ=11/12,    
    saucer_radius=135,             thin_saucer_circ=11/12,    
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.0, 
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.0,
    inner_saucer=true, 
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=0.0,
    caption='',                    caption2='',
    },
    {
    name='time',                   arg='%M',                    max_value=60,
    x=170,                         y=170,
    cup_radius=55,
    cup_wall_thickness=120,
    cup_bg_clr=0xffffff,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    graduation_radius=123,
    graduation_thickness=10,       graduation_mark_circ=2.5,
    graduation_mark_angle=90,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.5,
    handle_length=110,              handle_circ=3,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0, --1.0
    saucer_thickness=6,            thick_saucer_circ=11/12,
    saucer_radius=155,             thin_saucer_circ=11/12,    
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.0,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=0.0,
    caption='',                    caption2='',
    },
    {
    name='time',                   arg='%S',                    max_value=60,
    x=170,                         y=170,
    cup_radius=59,
    cup_wall_thickness=120,
    cup_bg_clr=0xffffff,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,             cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0, --1.0
    handle_length=118,              handle_circ=1,
    graduation_radius=125,
    graduation_thickness=6,        graduation_mark_circ=0.5,
    graduation_mark_angle=6,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.5,
    saucer_thickness=5,           thick_saucer_circ=1,
    saucer_radius=145,             thin_saucer_circ=11/12,    
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.4,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.4,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=0.0,
    caption='',                    caption2='',
},
    {
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=170,                         y=100,
    cup_radius=20,
    cup_wall_thickness=40,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= -5,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=1,
    caption=' CPU ',               caption2=' %',
    graduation_radius=25,
    graduation_thickness=3,        graduation_mark_circ=2,
    graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.6,
    saucer_thickness=3,            thick_saucer_circ=0.85,
    saucer_radius=30,              thin_saucer_circ=0.85,
    saucer_fg_clr=0xFFFFFF,       saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
    },
    {
    name='freq_g',                 arg='/',                  max_value=5,
    x=170,                         y=100,
    cup_radius=12,
    cup_wall_thickness=23,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= 10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=1,
    caption='',           caption2=' GHz',
    graduation_radius=25,
    graduation_thickness=4,        graduation_mark_circ=4,
    graduation_mark_angle=30,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.0,
    saucer_thickness=3,            thick_saucer_circ=0.75,
    saucer_radius=35,              thin_saucer_circ=0.75,
    saucer_fg_clr=0xFFFFFF,       saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
},
---------------1/2
{
    name='downspeedf',                arg='wlo1',                      max_value=100,
    x=100,                         y=170,
    cup_radius=12,
    cup_wall_thickness=23,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= -5,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=1,
    caption='E. ',             caption2='',
    graduation_radius=25,
    graduation_thickness=3,        graduation_mark_circ=2,
    graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.6,
    saucer_thickness=3,           thick_saucer_circ=0.85,
    saucer_radius=30,              thin_saucer_circ=0.85,    
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha= 0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
},   
{
    name='upspeedf',               arg='wlo1',                      max_value=100,
    x=100,                         y=170,
    cup_radius=12,
    cup_wall_thickness=27,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= 10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=1,
    caption='S ',             caption2='',
    graduation_radius=25,
    graduation_thickness=4,        graduation_mark_circ=4,
    graduation_mark_angle=30,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.0,
    saucer_thickness=3,            thick_saucer_circ=0.85,
    saucer_radius=35,              thin_saucer_circ=0.85,     
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
},
------------------2/3    
{
    name='fs_used_perc',           arg='/home',                      max_value=100,
    x=170,                         y=240,
    cup_radius=12,
    cup_wall_thickness=27,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= 10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=1,
    caption=' FS /: ',             caption2=' %',
    graduation_radius=25,
    graduation_thickness=3,        graduation_mark_circ=2,
    graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.6,    
    saucer_thickness=3,            thick_saucer_circ=0.85,
    saucer_radius=30,              thin_saucer_circ=0.85,     
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
    inner_saucer=true,
},
{
    name='fs_used_perc',           arg='/',                      max_value=100,
    x=170,                         y=240,
    cup_radius=12,
    cup_wall_thickness=27,
    cup_start_angle=0,
    cup_bg_clr=0xFFFFFF,           cup_bg_alpha=0.0,
    cup_fg_clr=0xFFFFFF,           cup_fg_alpha=0.0,
    handle_fg_clr=0xFFFFFF,        handle_fg_alpha=0.0,
    handle_length=40,              handle_circ=4,
    xtxt=-20,               ytxt= -5,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_clr=0xFFFFFF,           txt_fg_alpha=0.8,
    caption=' FS H: ',             caption2=' %',
    graduation_radius=25,
    graduation_thickness=4,        graduation_mark_circ=4,
    graduation_mark_angle=36,
    graduation_fg_clr=0xFFFFFF,    graduation_fg_alpha=0.0,
    saucer_thickness=3,            thick_saucer_circ=0.85,
    saucer_radius=35,              thin_saucer_circ=0.85,     
    saucer_fg_clr=0xFFFFFF,        saucer_fg_alpha=0.3,
    saucer_mark_fg_clr=0xFFFFFF,   saucer_mark_fg_alpha=0.5,
},
}
  
--Fixed code -do not edit unless you know what you are doing------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- converts color in hexa to decimal
function rgb_to_r_g_b(clr, alpha)
    return ((clr / 0x10000) % 0x100) / 255., ((clr / 0x100) % 0x100) / 255., (clr % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
------------------------------------------------------------------------
-- displays cups and saucers
local function draw_coffee_table(display, data, value) 
     max_value = data['max_value']
     x, y = data['x'], data['y']
     if x==nil then x=conky_window.width/2 end
     if y==nil then y=conky_window.height/2 end    
     cup_radius = data['cup_radius']    
     if cup_radius==nil then cup_radius=conky_window.width/4 end    
     cup_wall_thickness = data['cup_wall_thickness']
     if cup_wall_thickness==nil then cup_wall_thickness=20 end
     handle_length, handle_circ = data['handle_length'], data['handle_circ']
     if handle_length==nil then handle_length=20 end
     if handle_circ==nil then handle_circ=1 end
     cup_start_angle = data['cup_start_angle']
     if cup_start_angle == nil then cup_start_angle =0 end
     total_angle = data['total_angle']
     if total_angle == nil then total_angle=360 end
     cup_sector_angle = (math.abs(total_angle))/max_value  
     cup_end_angle = total_angle + cup_start_angle
     cup_bg_clr, cup_bg_alpha = data['cup_bg_clr'], data['cup_bg_alpha']
     if cup_bg_clr==nil then cup_bg_clr =0xffffff end
     cup_fg_clr, cup_fg_alpha = data['cup_fg_clr'], data['cup_fg_alpha']
     if cup_fg_clr==nil then cup_fg_clr =0xffffff end
     if cup_fg_alpha==nil then cup_fg_alpha=0 end
     handle_fg_clr, handle_fg_alpha = data['handle_fg_clr'], data['handle_fg_alpha']  
     if handle_fg_clr==nil then handle_fg_clr = 0xffffff end
     if handle_fg_alpha==nil then handle_fg_alpha=0 end
     
     saucer_radius = data['saucer_radius']
     if saucer_radius==nil then saucer_radius=conky_window.width/2 end 
     total_saucer_angle=data['total_saucer_angle']
     if total_saucer_angle==nil then total_saucer_angle=360 end 
     saucer_sector_angle=(math.abs(total_saucer_angle))/max_value  
     saucer_thickness = data['saucer_thickness']
     if saucer_thickness==nil then saucer_thickness=6 end
     saucer_fg_clr = data['saucer_fg_clr']
     if saucer_fg_clr ==nil then saucer_fg_clr=0 end
     saucer_fg_alpha = data['saucer_fg_alpha']
     if saucer_fg_alpha ==nil then saucer_fg_alpha=0 end
     
     saucer_mark_fg_alpha = data['saucer_mark_fg_alpha']
     if saucer_mark_fg_alpha ==nil then saucer_mark_fg_alpha=0 end
     saucer_mark_fg_clr = data['saucer_mark_fg_clr']
     if saucer_mark_fg_clr ==nil then saucer_mark_fg_clr=0xffffff end
     thick_saucer_circ = data['thick_saucer_circ']
     if thick_saucer_circ==nil then thick_saucer_circ =0.9 end
     thin_saucer_circ = data['thin_saucer_circ']
     if thin_saucer_circ==nil then thin_saucer_circ =0.9 end
     inner_saucer = data['inner_saucer']
     
     graduation_radius = data['graduation_radius']
     if graduation_radius ==nil then graduation_radius = conky_window.width/3 end
     graduation_thickness, graduation_mark_circ = data['graduation_thickness'], data['graduation_mark_circ']
     if graduation_thickness ==nil then graduation_thickness = 2 end
     if graduation_mark_circ ==nil then graduation_mark_circ = 1 end
     graduation_mark_angle = data['graduation_mark_angle']
     if graduation_mark_angle == nil then graduation_mark_angle = total_angle/10 end
     graduation_fg_clr, graduation_fg_alpha = data['graduation_fg_clr'], data['graduation_fg_alpha']
     if graduation_fg_clr ==nil then graduation_fg_clr= 0xffffff end
     if graduation_fg_alpha==nil then graduation_fg_alpha =0 end
     
     
     txt_weight, txt_size = data['txt_weight'], data['txt_size']
     if txt_weight == nil then txt_weight=1 end
     if txt_size == nil then txt_size=8 end
     txt_fg_clr, txt_fg_alpha = data['txt_fg_clr'], data['txt_fg_alpha']
     if txt_fg_clr ==nil then txt_fg_clr= 0xffffff end
     if txt_fg_alpha==nil then txt_fg_alpha =0 end
     caption = data['caption']
     if caption==nil then caption='' end
     caption2 = data['caption2']
     if caption2==nil then caption2='' end
     xtxt, ytxt= data ['xtxt'], data['ytxt']
     if xtxt ==nil then xtxt=0 end
     if ytxt ==nil then ytxt=0 end
--convert degree to rad and rotate (0 degree is top/north)
    function angle_to_position(start_angle, current_angle)    
      if total_angle < 0 then 
        local pos = start_angle - current_angle
        return ( ( pos * (math.pi / 180) ) - (math.pi / 2) )
      else 
        local pos = current_angle + start_angle 
        return ( ( pos * (math.pi / 180) ) - (math.pi / 2) ) 
      end   
    end
--cup centre background    
  if cup_bg_alpha >0   then
    if total_angle < 0 then
      cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_end_angle, 0))
    else
      cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, cup_end_angle))
    end
    cairo_set_source_rgba(display, rgb_to_r_g_b(cup_bg_clr, cup_bg_alpha))
    cairo_set_line_width(display, cup_wall_thickness)
    cairo_stroke(display)
  end 
--cup wall fg    
  if cup_fg_alpha > 0 then 
   local fg_stop_arc = (cup_sector_angle * value)
    if total_angle < 0 then
    cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
    else
    cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
    end
    cairo_set_source_rgba(display, rgb_to_r_g_b(cup_fg_clr, cup_fg_alpha))
    cairo_set_line_width(display, cup_wall_thickness)
    cairo_stroke(display)
  end
-- cup handle
  if handle_fg_alpha>0 then 
    local start_handle = (cup_sector_angle * value) - (handle_circ*0.5)
    local stop_handle = (cup_sector_angle * value) +  (handle_circ*0.5)
    if total_angle < 0 then
    cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
    else
    cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
    end
    cairo_set_line_width(display, handle_length)    
    cairo_set_source_rgba(display, rgb_to_r_g_b(handle_fg_clr, handle_fg_alpha))
    cairo_stroke(display)
  end
--saucers   
---thick saucer     
    if saucer_fg_alpha > 0 and (thin_saucer_circ >0 or thick_saucer_circ > 0)
      then 
    if value < (max_value/2) 
        then j = value + ((max_value*total_saucer_angle)/720)
        else j = value - ((max_value*total_saucer_angle)/720)
    end
    
    local start_saucer = (saucer_sector_angle * j) - (value*saucer_sector_angle*0.5*thick_saucer_circ)
    local stop_saucer = (saucer_sector_angle * j) + (value*saucer_sector_angle*0.5*thick_saucer_circ)
    if total_angle < 0 then
    cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
    else
    cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
    end
    cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
    cairo_set_line_width(display, saucer_thickness)
    cairo_stroke(display)
    --thin saucer
      if inner_saucer == true 
      then rt = (saucer_radius - 0.5) + (0.5 * saucer_thickness)
      else rt = (saucer_radius + 0.5) - (0.5 * saucer_thickness)  
      end
    local start_thin_saucer = (saucer_sector_angle * j) - (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
    local stop_thin_saucer = (saucer_sector_angle * j) + (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
    if total_angle < 0 then
    cairo_arc_negative(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
    else
    cairo_arc(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
    end
    cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
    cairo_set_line_width(display, 1)
    cairo_stroke(display)
   end
--saucer mark
    if saucer_mark_fg_alpha > 0 then 
    local start_cm = (saucer_sector_angle * value) - (handle_circ *0.5 )
    local stop_cm = (saucer_sector_angle * value) + (handle_circ *0.5 )
    if total_angle < 0 then
      cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
    else
      cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
    end
    cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_mark_fg_clr, saucer_mark_fg_alpha))
        cairo_set_line_width(display, saucer_thickness)
        cairo_stroke(display)
    end 
--graduation mark 
     if graduation_radius > 0 and graduation_thickness > 0 and graduation_mark_angle > 0 then
        number_graduation = (math.abs(total_angle) +1)/ graduation_mark_angle
        local start_arc_grad = 0
        local stop_arc_grad = 0
    local i = 0
        while i < number_graduation do            
            local start_arc_grad = (graduation_mark_angle * (i)) - (graduation_mark_circ *0.5)
            local stop_arc_grad = (graduation_mark_angle * (i)) + (graduation_mark_circ *0.5)
            if total_angle < 0 then
          cairo_arc_negative(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
        else
          cairo_arc(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
        end
        cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_clr,graduation_fg_alpha))
            cairo_set_line_width(display, graduation_thickness)
        cairo_stroke(display)            
            i = i + 1
        end
    end   
-- text
  if txt_fg_alpha>0 then 
    cairo_select_font_face (display, "hooge 05_53", CAIRO_FONT_SLANT_NORMAL, txt_weight);
    cairo_set_font_size (display,txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_clr, txt_fg_alpha))
    cairo_move_to (display,x+xtxt,y+ytxt)
    cairo_show_text (display, caption ) cairo_show_text (display,value)cairo_show_text (display, caption2 )
    cairo_stroke (display)
  end
end
-------------------------------------------------------------------------------
-- loads data and displays table_settings
function display_coffee_table(display)
    local function load_coffee_table(display, data)
        local str, value = '', 0       
    if data['name'] == 'time2' then
        local max_value = data['max_value']
            str = string.format('${time %s}', data['arg'])
            str = conky_parse(str)
            local value2 = tonumber(str:sub(0,2))
        if value2 == max_value then value2 = 0 end
        value = value2 + (tonumber(str:sub(4,5))/60)                
    else
            str = string.format('${%s %s}',data['name'], data['arg'])
            str = conky_parse(str)
            value = tonumber(str)
        end     
        if value == nil then value = 0 end
        draw_coffee_table(display, data, value)
    end
    for i in pairs(coffee_table) do
        load_coffee_table(display, coffee_table[i])
    end
end
-------------------------------------------------------------------------------
runscheck = 0 -- fix for draw shades running script twice on every update
function conky_main()
    if conky_window == nil then 
        return
    end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    if update_num > 5 then
      cairo_set_antialias (display, CAIRO_ANTIALIAS_SUBPIXEL)
      display_coffee_table(display)
      cairo_set_antialias (display, CAIRO_ANTIALIAS_DEFAULT)
    end    
    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

clocks_rings.lua

Code : Tout sélectionner

--[[
Clock Rings by londonali1010 (2009)
This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/clock_rings-v1.1.1.lua
    lua_draw_hook_pre clock_rings
Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]
settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xFFFFFF,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.0,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xFFFFFF,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.0,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=150, y=150,
        -- "radius" is the radius of the ring.
        radius=133,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=4,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M',
        max=60,
        bg_colour=0xFFFFFF,
        bg_alpha=0.0,
        fg_colour=0xFFFFFF,
        fg_alpha=0.0,
        x=150, y=150,
        radius=140,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xFFFFFF,
        bg_alpha=0.0,
        fg_colour=0xFFFFFF,
        fg_alpha=0.0,
        x=150, y=150,
        radius=147,
        thickness=4,
        start_angle=0,
        end_angle=360
    },
    
    
    
    }
-- Use these settings to define the origin and extent of your clock.
clock_r=127
-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
clock_x=170
clock_y=170
-- Colour & alpha of the clock hands
clock_colour=0xFFFFFF
clock_alpha=1
-- Do you want to show the seconds hand?
show_seconds=true
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)
    -- Draw background ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    -- Draw indicator ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)
end
function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
    -- Draw hour hand
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
    cairo_stroke(cr)
    -- Draw minute hand
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    -- Draw seconds hand
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
        cairo_set_line_width(cr,1) -- (cr,1)
        cairo_stroke(cr)
    end
end
function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        value=tonumber(str)
        if value == nil then value = 0 end
        pct=value/pt['max']
        draw_ring(cr,pct,pt)
    end
    -- Check that Conky has been running for at least 5s
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    local cr=cairo_create(cs)    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    draw_clock_hands(cr,clock_x,clock_y)
end

blinkingLED

Code : Tout sélectionner

${image $HOME/.conky/cronograph/images/Blank.png -p 145, 32 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else  echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 145, 32 -s 40x40}${endif}
${image $HOME/.conky/cronograph/images/Blank.png -p 145, 258 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else  echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 145, 258 -s 40x40}${endif}
${image $HOME/.conky/cronograph/images/Blank.png -p 33, 145 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else  echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 33, 145 -s 40x40}${endif}
${image $HOME/.conky/cronograph/images/Blank.png -p 257, 145 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else  echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 257, 145 -s 40x40}${endif}


Image


Image
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Répondre