Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1026 Le 20/09/2011, à 19:25

Phyllinux

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Quelqu'un pourrait il me dire s'il existe une manip particulière à effectuer pour un affichage des prévisions météo à plus de 4 jours avec conkyforecast ?
En effet, je n'arrive pas à faire afficher au delà de 4 jours.
Le dernier exemple concerne le conky avec horloge et météo ci dessous :
Conky horloge+météo
Tout se passe bien si je reste à 4 jours de prévisions.
En revanche, impossible de faire afficher un 5° jour. Si j'essaye, cela a pour effet de me faire disparaitre toutes les données météo qui sont affichées.
Hors dans la version initiale de ce conky, il devrait y avoir 5 jours de prévisions. J'ai certes un peu modifié le conky, mais je n'ai pas touché la 'structure' même de ce dernier. Et dans la version originale, je n'ai jamais eu que 4 jours de prévisions...
Or j'ai vu qu'il y avait des conkyforecast à 5 voire 7 jours de prévisions... Mais je n'ai jamais réussi à les faire tourner.
Dans le cas présent, ou bien je réussis à afficher le 5° jour, ou bien je vais devoir le modifier, pour équilibrer et aligner les données sur la ligne du bas. Actuellement, je garde espoir, et j'ai laissé la place pour le 5° jour !!!


The ship is sinking normally...

Hors ligne

#1027 Le 21/09/2011, à 04:37

adama88

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour,

J'ai également le même soucis et je n'ai jamais réussi à trouver la solution. Que ce soit sous Ubuntu ou d'autres distributions.

Dernière modification par adama88 (Le 21/09/2011, à 04:38)


Ubuntu 23.10 - Windows 11 famille
Lenovo Y520-15IKBN - Intel® Core™ i5-7300HQ × 4 - Intel® UHD 630  + NVIDIA GeForce GTX 1050
32 Go RAM - Nvme 1To + HDD 1to (DD d'origine)

Hors ligne

#1028 Le 21/09/2011, à 08:54

Phyllinux

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

@ Adama88 et à tous ceux qui veulent augmenter le nombre de jours de prévisions dans leur conkyforecast.
J'ai trouvé la manip à effectuer. Il faut modifier le fichier cokyForecast.py.
Pour cela :

gksudo gedit /usr/share/conkyforecast/conkyForecast.py

A la ligne 90, changer 4 en 7 :

MAXIMUM_DAYS_FORECAST = 7

A la ligne 92, changer http://xoap.weather.com/weather/local/ en xml

BASE_XOAP_URL = "http://xml.weather.com/weather/local/<LOCATION>?cc=*&dayf=10&link=xoap&prod=xoap&par=<XOAP_PARTNER_ID>&key=<XOAP_LICENCE_KEY>&unit=m"

Enregistrer le tout.
Relancer le conky. On peut alors aller vérifier dans le répertoire du cache des données météo (celui défini dans le fichier conkyForecast.config) que nous avons bien 7 jours de données au lieu de 4.
Lorsque l'on va demander au conky d'aller y chercher les prévisions, il trouvera donc son bonheur !!!

La preuve par l'image : Cela fonctionne !!!
Conky horloge+météo à 5 jours

La soluce a été trouvée ici : Conky pitstop


The ship is sinking normally...

Hors ligne

#1029 Le 21/09/2011, à 09:10

adama88

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Merci @Phyllinux


Ubuntu 23.10 - Windows 11 famille
Lenovo Y520-15IKBN - Intel® Core™ i5-7300HQ × 4 - Intel® UHD 630  + NVIDIA GeForce GTX 1050
32 Go RAM - Nvme 1To + HDD 1to (DD d'origine)

Hors ligne

#1030 Le 23/09/2011, à 00:11

bishop

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Conky sur E17 Enlightenment / Natty 11.04

Bishop => Apprenti contructeur occasionnel de Conky.
Tout cela pour dire que je remercie tous les intervenants sur les différents topics consacrés à Conky.
Ils proposent aux non-initiés de s'amuser à contruire des Choses, de s'intéresser et s'initier un tant soit peu au code, ce qui permet à un vieux bonhomme de passer le temps sans trop se faire ch...

E17-Conky.05.mini.jpg

Dernière modification par bishop (Le 23/09/2011, à 00:14)


La plus grande surprise que puisse faire un con c'est de faire une pause.

Hors ligne

#1031 Le 23/09/2011, à 05:32

wido

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

6 cores ?

il y a de quoi utiliser ce processeur pour du boinc

Dernière modification par wido (Le 23/09/2011, à 05:33)

Hors ligne

#1032 Le 23/09/2011, à 07:46

breakolami

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Très beau conky bishop, bien pensé, belle mise en page, bravo.
Tu partages ton code ?


Kubuntu 23.10 sur MSI Katana 17, Intel i7 12ème génération, 1 Nvme M.2 P5 500Go, 1 Nvme M.2 P2 500Go, 16Go de mémoire, Nvidia GeForce RTX 4060
https://www.youtube.com/@ChristopheBrand

Hors ligne

#1033 Le 23/09/2011, à 09:04

rpj

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour, je viens de faire mon 1º lua et je voudrais savoir si il y a des tutos pour dessiner des secteurs sur les cercles.
(tutto pour débutants).
Voici mon conky-lua :
1316764512.png


La ligne de commande UNIX devrait être obligatoire dès la maternelle ! :-)
Debian, XFCE,  FF, .
Android dev (éternel débutant)

Hors ligne

#1034 Le 24/09/2011, à 03:35

bishop

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

breakolami écrit :
Très beau conky bishop, bien pensé, belle mise en page, bravo.
Tu partages ton code ?

Déja... Merci pour ton appréciation, c'est sympa.
Partager le code... pourquoi pas, malgré que je n'ai pas encore finalisé ce Conky, c'est un vrai foutoir. Je dois faire quelques modifs, supprimer les lignes qui ne sont pas nécessaires, annoter les fichiers pour plus de compréhension, essayer de condenser tous ces fichiers quand c'est possible, etc...
Pour l'instant ce sont plein de petits modules, une alternative qui ne me déplait pas puisqu'elle permet de les positionner à volonté.

Pour "Tu partages ton code ?", j'ai préféré développé un p'tit récap en html sans trop de fioritures pour ne pas créé un post trop long sur ce topic. Je trouve cela plus clair, j'y colle quelques infos supplémentaires pour d'éventuels curieux et puis ça m'occupe et me permet de ne pas trop perdre la main et bidouiller différents langages.


Le lien... cliquer sur l'image. yikes

conky.jpg

Dernière modification par bishop (Le 24/09/2011, à 03:42)


La plus grande surprise que puisse faire un con c'est de faire une pause.

Hors ligne

#1035 Le 24/09/2011, à 04:49

willcoyote

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Ahh merci pour ces infos bishop
Je n'avais jamais réussi a afficher les jaquettes du lecteur clémentine
Grâce a toi, en 5mn ça marche

Hors ligne

#1036 Le 24/09/2011, à 05:46

shamen456

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour à tous...

...en me plongeant dans les scripts lua de wlourf j'ai refait complètement mon conkyarc... il passe maintenant en version "gold" avec un aspect 3D et des dégradés de couleurs...

arcgold

le code se trouve dans le fichier zip sur "Deviant Art"

...et apres deux semaines de fonctionnement et d'adaptations mineures, voici le graphe d'historique des pressions en version translucide
barograph

le code se trouve aussi sur deviant...(barograph)
et pour le plaisir un screenshot du desktop complet
desktop septembre 2011

Bon conky à tous....

Dernière modification par shamen456 (Le 24/09/2011, à 06:39)

Hors ligne

#1037 Le 24/09/2011, à 12:29

bishop

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

wido écrit :
il y a de quoi utiliser ce processeur pour du boinc

J'y pense ! J'ai déja fait quelques recherches, visité différents projets et quelques communautés pour voir de quoi il retournait.


willcoyote écrit :
Ahh merci pour ces infos bishop
Je n'avais jamais réussi a afficher les jaquettes du lecteur clémentine
Grâce a toi, en 5mn ça marche

Cool ! Comme quoi... Tout arrive à point à qui sait attendre.


shamen456 !
Superbe ! Ça donne vraiment envie de s'y intéresser.


La plus grande surprise que puisse faire un con c'est de faire une pause.

Hors ligne

#1038 Le 26/09/2011, à 22:33

CaptainAchab

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonsoir , voilà mon soucis depuis 1 semaine j'essaye de faire fonctionner le fichier conkycenter qui se trouve dans conkyblondie que j'ai trouvé sur le site http://gnome-look.org/content/show.php/ … ent=145367, aprés avoir fait X manipulation qui m'ont été dite sur le même site rien à faire conkycenter ne fonctionne pas alors j'en appel à votre aide voici mon conkycenter


background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

#gap_x 518
gap_y 15
minimum_size 350 350
maximum_width 350
own_window yes
own_window_type normal
own_window_class conky-semi
own_window_argb_visual yes
own_window_transparent yes
own_window_argb_value 100
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
#border_inner_margin 0
#border_outer_margin 0
alignment tm

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no

override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no

default_color FFFFFF
color1 FFFFFF
color2 white
color3 000000

lua_load ~/.conky/lua/conkycenter.lua
lua_draw_hook_post main

TEXT
#SYSTEME ${hr 2}
        ${voffset 330}${color gray}${font OpenLogos:size=16}u${font}  Kernel:  ${alignr}${kernel}$color
        ${if_match ${hwmon 0 temp 1}<=49}${exec gconftool-2 -t str --set /desktop/gnome/background/primary_color "#8DADBB"}${color #8DADBB}${font StyleBats:size=16}A${font}  CPU1: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 1}C° ${alignr}(${cpu cpu1}%)${alignr}${cpubar cpu1 8,60}$color${endif}${if_match ${hwmon 0 temp 1}>=50}${exec gconftool-2 -t str --set /desktop/gnome/background/primary_color "#F1A518"}${color #FFC100}${font StyleBats:size=16}A${font}  CPU1: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 1}C° ${alignr}(${cpu cpu1}%)${alignr}${cpubar cpu1 8,60}$color${endif}${if_match ${hwmon 0 temp 1}>=66}${exec gconftool-2 -t str --set /desktop/gnome/background/primary_color "#E21B0C"}${color red}${font StyleBats:size=16}A${font}  CPU1: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 1}C° ${alignr}(${cpu cpu1}%)${alignr}${cpubar cpu1 8,60}$color${endif}${if_match ${hwmon 0 temp 1}>=80}${color red}${font StyleBats:size=16}A${font} CPU WILL BE SHUTDOWN!!! ${execi 200 terminator -e ~/bin/shutdown-now}${endif}

        ${if_match ${hwmon 0 temp 2}<=49}${color #8DADBB}${font StyleBats:size=16}A${font}  CPU2: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 2}C° ${alignr}(${cpu cpu2}%)${alignr}${cpubar cpu2 8,60}$color${endif}${if_match ${hwmon 0 temp 2}>=50}${color #FFC100}${font StyleBats:size=16}A${font}  CPU2: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 2}C° ${alignr}(${cpu cpu2}%)${alignr}${cpubar cpu2 8,60}$color${endif}${if_match ${hwmon 0 temp 2}>=66}${color red}${font StyleBats:size=16}A${font}  CPU2: ${alignc} ${freq_g} GHz / ${hwmon 0 temp 2}C° ${alignr}(${cpu cpu2}%)${alignr}${cpubar cpu2 8,60}$color${endif}${if_match ${hwmon 0 temp 2}>=80}${color red}${font StyleBats:size=16}A${font} CPU WILL BE SHUTDOWN!!! ${execi 200 terminator -e ~/bin/shutdown-now}${endif}

        ${if_match ${memperc}<=59}${color gray}${font StyleBats:size=16}g${font}  RAM: $memperc% ${alignr}${membar 8,60}$color${endif}${if_match ${memperc}>=60}${color red}${font StyleBats:size=16}g${font}  RAM: $memperc% ${alignr}${membar 8,60}$color${endif}
        ${if_match ${swapperc}<=79}${color gray}${font StyleBats:size=16}g${font}  SWAP: $swapperc% ${alignr}${swapbar 8,60}$color${endif}${if_match ${swapperc}>=80}${color red}${font StyleBats:size=16}g${font}  SWAP: $swapperc% ${alignr}${swapbar 8,60}$color${endif}
#${font StyleBats:size=16}q${font}  Ligado: ${alignr}${uptime}

#CAPACITE HDD ${hr 2}
#${color gray}${voffset 4}${font Poky:size=12}y${font}  ${voffset -5}UBUNTU:
#${voffset 4}${fs_used /}/${fs_size /} ${alignr}${fs_bar 8,60 /}
#${voffset 4}${font Poky:size=12}y${font}  ${voffset -5}FAT32:
#${voffset 4}${fs_used /dos}/${fs_size /dos} ${alignr}${fs_bar 8,60 /dos}
##${voffset 4}${font Pie charts for maps:size=12}7${font}   ${voffset -5}Home:
##${voffset 4}${fs_free /home}/${fs_size /home} ${alignr}${fs_bar 8,60 /home}${color}

Hors ligne

#1039 Le 27/09/2011, à 06:21

chepioq

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

@CaptainAchab

Il faudrait que tu lances ton conky en console, et que tu nous rapportes les erreurs éventuellement affichées.


Tout est dans tout et réciproquement....

Hors ligne

#1040 Le 27/09/2011, à 07:43

CaptainAchab

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour
bon à force de chercher et de bidouiller voici la solution à mon problème :
J'ai juste changé cpu1 par cpu0 et cpu2 par cpu1
Merci Chepioq il est vrai que j'aurais dû poster le message d'erreur cela aurait été plus facile .
Bref plus d'une semaine de galère à chercher et a poster pour juste une ligne .
Mais n'est il pas dit qu'ubuntu ça rend beau et intelligent ???

Hors ligne

#1041 Le 27/09/2011, à 10:15

Levi59

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

n'oublie pas les balises code (icône <>) la prochaine fois...

Hors ligne

#1042 Le 27/09/2011, à 20:10

nordinatueur

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Levi59 a écrit :

n'oublie pas les balises code (icône <>) la prochaine fois...

Je pense même qu'il n'est pas trop tard pour rectifier !
Quand d'autres liront, ce sera plus agréable dans des balises de code.


Linux User #508094
Pour une meilleure coopération, utilisez des liens relatifs sur le forum !

Hors ligne

#1043 Le 27/09/2011, à 20:16

Phyllinux

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Conkysiens, Conkysiennes, Bonsoir !
Je viens poser une question qui a déjà été posée de nombreuses fois, mais toutes les réponses que j'ai pu lire ne me permettent pas de régler mon petit souci :
J'ai réalisé 2 conkys, que je souhaite afficher sur le même côté du bureau.
Un s'affiche en haut, et le second en bas. J'ai veillé à ce que les données affichées soit l'une au dessous de l'autre, avec un espce d'une dizaine de lignes entre les 2 conkys.
Je les lance par un script conky_start.sh qui comprend les 2 conkyrc.

#! /bin/bash

sleep 20
conky -c /home/gilles/weather+clock/conkyrc &
conky -c /home/gilles/scripts/conkyrc1 &
exit

Or, je n'arrive pas à les faire s'afficher tous les deux au lancement du système. J'ai l'impression que celui qui est en haut masque celui du bas.
J'ai réglé la variable d'affichage au minimum dans le conkyrc :

minimum_size 200 200
maximum_width 310

Rien n'y fait.
Il n'y en a qu'un seul qui s'affiche. En l'occurence celui du bas maintenant. Je dis maintenant, car, auparavant, celui du bas s'affichait, puis disparaissait pour laisser la place à celui du haut.
Or, si en ligne de commnde par le terminal, je lance le conky du haut, les 2 veulent bien cohabiter...
Je tourne en rond depuis pas mal de temps, alors je me suis dit que l'un de vous pourrait sûrement m'aider à régler ce petit problème... tongue

Question subsidiaire :
Je suis preneur de toute solution qui consiste à fusionner les 2 conkys en un seul pour régler ce problème de lancement. Mais vu que chacun fait appel à des scripts différents, j'ai abandonné cette idée car je n'arrivais pas à faire cohabiter les scripts.

Je ne poste pas les différents fichiers (conkyrc, template et scripts) car ce n'est peut-être pas nécessaire à ce stade, mais je peux les envoyer si cela peut faire avancer la solution big_smile
Merci. smile


The ship is sinking normally...

Hors ligne

#1044 Le 27/09/2011, à 22:52

Levi59

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Sur la première ligne, supprime l'espace entre #! et /bin/bash et réessaye.

Hors ligne

#1045 Le 28/09/2011, à 06:07

Didier-T

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour a tous,

Voila j'ai un petit soucis, j'ai réalisé un conky avec des scripts glanés sur le net et adapté à mes envies, mais voila je me suis aperçus que l'espace mémoire de mes conky ne cessais d'augmenté avec le temps qui passe.

Mon conky
1317183961.png

La capture montrant l'utilisation mémoire au démarrage
1317184224.png

état de la mémoire apres ~2 heures
1317184539.png

Et voici mes scripts :

lauch.sh

#!/bin/bash
sleep 5
killall conky 
cd
sleep 2
conky -d -c /home/didier/.conkyrc1;
sleep 2
conky -d -c /home/didier/.conkyrc2;
sleep 2
conky -d -c /home/didier/.conkyrc3;
exit

.conkyrc1

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0

# affiche le texte sur la sortie standard
out_to_console no

# réglage de la mémoire, pour éviter le clignotement
double_buffer yes
# Soustraire les mémoires tampons de la mémoire utilisée
no_buffers yes
text_buffer_size 2048

# taux de rafraichissement de la fenêtre (en secondes)
update_interval 1

# nombre d'échantillons à utiliser pour calculer la moyenne d'utilisation
cpu_avg_samples 4
net_avg_samples 4

# taille et positon
alignment tr
minimum_size 320 5
maximum_width 320

# écart avec le bord x=gauche ou droit y= haut ou bas
gap_x 5
gap_y 40

#  afficher les ombres
draw_shades yes
# afficher des contours
draw_outline no
# contours autour des blocs de texte
draw_borders no
# largeur du contour
border_width 1
# largeur des marges
border_margin 4

#pour que conky tourne en arrière plan background no pour les tests
background yes

# utiliser sa propre fenêtre
own_window yes
#type de fenêtre : normal(avec le cadre) / override / desktop
own_window_type override # normal / override / desktop
#pseudo transparence si vous avez des icones sous le conky elle ne seront plus accessible une fois conky activé
own_window_transparent yes

# Utiliser Xft (polices lissées etc)
use_xft yes
#xftalpha .1
#override_utf8_locale yes # force UTF8

#police a utiliser : use_xft doit être a "yes"
xftfont Comic sans MS:size=8
xftalpha 0.8
# Tout le texte en majuscule
uppercase no

# Ajoute des espaces après certains objets pour éviter de les faire bouger.
# Fonctionne uniquement avec les polices Fixes
use_spacer right

# Taille de la jauge par défault
default_gauge_size 0 100

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge

color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 BBBBBB

#Lua Load
  lua_load ~/conky/script/rings2.lua
  lua_draw_hook_pre ring_stats

TEXT
${time %A %d %B %Y}
${execi 86400 lsb_release -si} : ${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}
$sysname : $kernel $machine ${freq_g} GHz
Uptime : $uptime
Conky version : $conky_version 

${color black}${cpugraph cpu1}
${color white}${voffset -26}${alignc}Core 0 : ${cpu 1}% ${exec expr `cat /sys/class/hwmon/hwmon0/device/temp1_input` / 1000}°C

${color red}${cpugraph cpu2}
${color white}${voffset -26}${alignc}Core 1 : ${cpu 2}% ${exec expr `cat /sys/class/hwmon/hwmon1/device/temp1_input` / 1000}°C
${color white}
#Top 3 des applications les plus gourmandes en CPU avec leur % d’utilisation, leur nom et leur PID (pour pouvoir les killer rapidement si elle s’affolent)
${color1}${top cpu 1}% ${top name 1}${color} ${alignr}${top pid 1}
${color1}${top cpu 2}% ${top name 2}${color} ${alignr}${top pid 2}
${color1}${top cpu 3}% ${top name 3}${color} ${alignr}${top pid 3}
# ${color2}GMail   :  $color${execi 300 python /home/didier/.conky/gmail.py}
# ajout

${font Ubuntu\-Title:size=15}RESEAU ${hr 2}${font}
IP Internet : ${execpi 90 /home/didier/conky/script/ip-ext.sh}${if_existing /proc/net/route eth0}
IP Réseau: ${addr eth0}
${offset 138}${voffset 38}UP
${offset 110}${voffset 10}${upspeed eth0}/s
${offset 32}${voffset -35}Down
${offset 15}${voffset 10}${downspeed eth0}/s 


Uploaded: ${alignr}${totalup eth0}
Downloaded: ${alignr}${totaldown eth0}${endif}

.conkyrc2

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0

# affiche le texte sur la sortie standard
out_to_console no

# réglage de la mémoire, pour éviter le clignotement
double_buffer yes
# Soustraire les mémoires tampons de la mémoire utilisée
no_buffers yes
text_buffer_size 2048

# taux de rafraichissement de la fenêtre (en secondes)
update_interval 1

# nombre d'échantillons à utiliser pour calculer la moyenne d'utilisation
cpu_avg_samples 4
net_avg_samples 4

# taille et positon
alignment tm
minimum_size 5 5
maximum_width 700

# écart avec le bord x=gauche ou droit y= haut ou bas
gap_x 0
gap_y 10

#  afficher les ombres
draw_shades yes
# afficher des contours
draw_outline no
# contours autour des blocs de texte
draw_borders no
# largeur du contour
border_width 1
# largeur des marges
#border_margin 4

#pour que conky tourne en arrière plan background no pour les tests
background yes

# utiliser sa propre fenêtre
own_window yes
#type de fenêtre : normal(avec le cadre) / override / desktop
own_window_type override # normal / override / desktop
#pseudo transparence si vous avez des icones sous le conky elle ne seront plus accessible une fois conky activé
own_window_transparent yes

# Utiliser Xft (polices lissées etc)
use_xft yes
#xftalpha .1
#override_utf8_locale yes # force UTF8

#police a utiliser : use_xft doit être a "yes"
xftfont Comic sans MS:size=8
xftalpha 0.8
# Tout le texte en majuscule
uppercase no

# Ajoute des espaces après certains objets pour éviter de les faire bouger.
# Fonctionne uniquement avec les polices Fixes
use_spacer right

# Taille de la jauge par défault
default_gauge_size 0 10

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge

color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 BBBBBB

TEXT


${color red}${font Bitstream Vera Sans Mono:style=Bold:size=14}Météo ${hr 2}${font}
${color white}${font Comic sans MS:size=14}
${execpi 7200 ~/conky/script/invisible_weather.sh}
${voffset -35}${execpi 1800 conkyForecast --location=FRXX0282 --template=/home/didier/conky/script/myweather.template} 

.conkyrc3

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0

# affiche le texte sur la sortie standard
out_to_console no

# réglage de la mémoire, pour éviter le clignotement
double_buffer yes
# Soustraire les mémoires tampons de la mémoire utilisée
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0

# taux de rafraichissement de la fenêtre (en secondes)
update_interval 1

# nombre d'échantillons à utiliser pour calculer la moyenne d'utilisation
cpu_avg_samples 4
net_avg_samples 4

# taille et positon
alignment tl
minimum_size 320 5
maximum_width 320

# écart avec le bord x=gauche ou droit y= haut ou bas
gap_x 5
gap_y 40

#  afficher les ombres
draw_shades no
# afficher des contours
draw_outline no
# contours autour des blocs de texte
draw_borders no
# largeur du contour
border_width 1
# largeur des marges
#border_margin 4

#pour que conky tourne en arrière plan background no pour les tests
background yes

# utiliser sa propre fenêtre
own_window yes
#type de fenêtre : normal(avec le cadre) / override / desktop
own_window_type override # normal / override / desktop
#pseudo transparence si vous avez des icones sous le conky elle ne seront plus accessible une fois conky activé
own_window_transparent yes

# Utiliser Xft (polices lissées etc)
use_xft yes
#xftalpha .1
#override_utf8_locale yes # force UTF8

#police a utiliser : use_xft doit être a "yes"
xftfont Comic sans MS:size=8
xftalpha 0.8
# Tout le texte en majuscule
uppercase no

# Ajoute des espaces après certains objets pour éviter de les faire bouger.
# Fonctionne uniquement avec les polices Fixes
use_spacer right

# Taille de la jauge par défault
default_gauge_size 0 10

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge

color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 BBBBBB

#Lua Load
lua_load ~/conky/script/rings.lua
#lua_load ~/conky/script/text.lua
lua_draw_hook_pre main_rings
#lua_draw_hook_post draw_text

#  lua_load ~/conky/script/rings.lua
#  lua_draw_hook_pre ring_stats


#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${voffset 110}${offset 75}${color white}${font Bitstream Charter:style=Bold:size=45}${time %H:%M}
${voffset 109}${offset 132}${color black}${font Japan:style=Bold:size=13}MEM
${voffset -22}${offset 32}SSD
${voffset -22}${offset 232}HOME
${voffset 7}${offset 110}${color white}${font Japan:style=Bold:size=10}${memperc}% ${swapperc}%
${voffset -17}${offset 5}${fs_free /}
${voffset -17}${offset 215}${fs_free /media/Stokage}
${voffset 28}${color black}${font Japan:style=Bold:size=8}Procéssus
${offset 120}${voffset -13}Place MEM
${offset 210}${voffset -13}MEM %
${voffset -13}${alignr}Proc %
${font Japan:style=Bold:size=10}${top_mem name 1}
${offset 120}${voffset -16}${top_mem mem_res 1}
${offset 200}${voffset -16}${top_mem mem 1}%
${alignr}${voffset -16}${top_mem cpu 1}%
${font Japan:style=Bold:size=10}${top_mem name 2}
${offset 120}${voffset -16}${top_mem mem_res 2}
${offset 200}${voffset -16}${top_mem mem 2}%
${alignr}${voffset -16}${top_mem cpu 2}%
${font Japan:style=Bold:size=10}${top_mem name 3}
${offset 120}${voffset -16}${top_mem mem_res 3}
${offset 200}${voffset -16}${top_mem mem 3}%
${alignr}${voffset -16}${top_mem cpu 3}%
${voffset 25}

myweather.template

${voffset 5}${goto 10}${font ConkyWeather:style=Bold:size=60}${image [--datatype=WI] -p 0,40 -s 90x90}${font}
${image $HOME/conky/pix/thermo1.png -p 0,150 -s 40x40}${goto 60}${voffset 15}${font Bitstream Vera Sans Mono:style=Bold:size=16}[--datatype=HT --hideunits --centeredwidth=3]${font}
#/[--datatype=LT --hideunits --centeredwidth=3]
${voffset 10}${goto 10}${image [--datatype=BI] -p 0,205 -s 45x45}${goto 50}${voffset 25}${font Bitstream Vera Sans Mono:style=Bold:size=12}[--datatype=WS --imperial]
${goto 50}${font Bitstream Vera Sans Mono:style=Bold:size=12} [--datatype=WD]${font}  ${voffset -175}${goto 100}${color1}${font Bitstream Vera Sans Mono:style=Bold:size=15 les t}[--datatype=CT]${font}
# datatype OB=Station / CN=Ville
${voffset 20}${goto 120}${color3}Ville : $alignr${color1}[--datatype=CN]
${goto 120}${color3}Précipitations : $alignr${color1}[--datatype=PC --startday=0]
${goto 120}${color3}UV : $alignr${color1}[--datatype=UI] - [--datatype=UT]
${goto 120}${color3}Humidité : $alignr${color1}[--datatype=HM]
${goto 120}${color3}Point de rosée : $alignr${color1}[--datatype=DP]
${goto 120}${color3}Lever/Coucher : $alignr${color1}[--datatype=SR] / [--datatype=SS]
${goto 120}${color3}Pression : $alignr${color1}[--datatype=BR] - [--datatype=BD]
${goto 120}${color3}Lune : $alignr${color1}[--datatype=MP]
${color1}${voffset 80}${goto 25}[--datatype=DW --startday=1 --shortweekday]${offset 64}[--datatype=DW --startday=2 --shortweekday]${offset 64}[--datatype=DW --startday=3 --shortweekday] ${offset 64}[--datatype=DW --startday=4 --shortweekday]
${goto 30}${image [--datatype=WI --startday=1] -p 2,298 -s 60x60}
${goto 30}${image [--datatype=WI --startday=2] -p 85,298 -s 60x60}
${goto 30}${image [--datatype=WI --startday=3] -p 170,298 -s 60x60}
${goto 30}${image [--datatype=WI --startday=4] -p 257,298 -s 60x60}
${goto 18}[--datatype=HT --startday=1 --hideunits --centeredwidth=3]/[--datatype=LT --startday=1 --hideunits --centeredwidth=3]${goto 102}[--datatype=HT --startday=2 --hideunits --centeredwidth=3]/[--datatype=LT --startday=2 --hideunits --centeredwidth=3]${goto 182}[--datatype=HT --startday=3 --hideunits --centeredwidth=3]/[--datatype=LT --startday=3 --hideunits --centeredwidth=3]${goto 272}[--datatype=HT --startday=4 --hideunits --centeredwidth=3]/[--datatype=LT --startday=4 --hideunits --centeredwidth=3]
${image [--datatype=MI] -p 160,215 -s 60x60}
${voffset 5}${goto 5}${color3}Dernière mise à jour météo: ${color1}[--datatype=LU]${font}

conkyForecast.config

# config settings for conkyForecast.py
CACHE_FOLDERPATH = /tmp/
CONNECTION_TIMEOUT = 5
EXPIRY_MINUTES = 30
TIME_FORMAT = %H:%M
DATE_FORMAT = %d-%m-%Y
LOCALE =  fr
XOAP_PARTNER_ID = ##########
XOAP_LICENCE_KEY = ##############

invisible_weather.sh

 #!/bin/bash
   # conkytemplate.sh
   # by Crinos512
   # Usage:
   # ${execpi 3600 ~/.conky/conkyparts/conkytemplate.sh}
   # ${execpi 3600 ~/Conky/scripts/invisible_main.sh} = conkymain
   # ${execpi 3600 ~/Conky/scripts/invisible_weather.sh} = conkyforecast
   # ${execpi 3600 ~/Conky/scripts/invisible_mail.sh} = conkyemail
   #
   BGColor=”black”
   Columns=18
   Rows=7
   Layers=1
   
   ### DO NOT EDIT BELOW THIS LINE

ip-ext.sh

#!/bin/sh

# Afficher ip externe
wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1

rings.lua

--[[
Ring Meters by londonali1010 (2009)

This script draws percentage meters as rings. It is fully customisable; all options are described in the 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 on line 145 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/rings-v1.2.lua
    lua_draw_hook_pre ring_stats

Changelog:
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
 
require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={
{
        name='memperc',
        arg='',
    max=100,
    xc=160,
    yc=360,
    radius=50,
    thickness=10,
    start_angle=270,
    end_angle=570,
    sectors=50,
    gap_sectors=0,
    fill_sector=true,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
    fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
        name='swapperc',
        arg='',
    max=100,
    xc=160,
    yc=360,
    radius=40,
    thickness=10,
    start_angle=270,
    end_angle=450,
    sectors=23,
    gap_sectors=0,
    fill_sector=true,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
    fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
    name="",
    arg=(os.date("%I")-1)+(os.date("%M")/60),
    max=10.99,
    xc=160,
    yc=150,
    radius=110,
    thickness=25,
    sectors=11,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0xFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
    fg_colour2={{0,0X0FF000,0},{0.5,0x0FF000,1}, {1,0x0FF000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
    name="",
    arg=(os.date("%M")-1)+(os.date("%S")/60),
    max=58.99,
    xc=160,
    yc=150,
    radius=130,
    thickness=20,
    start_angle=0,
    end_angle=360,
    sectors=59,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0X0FF000,0},{0.5,0x0FF000,1}, {1,0x0FF000,0}},
    fg_colour2={{0,0xFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
    name="time",
    arg="%S",
    max=59,
    xc=160,
    yc=150,
    radius=150,
    thickness=20,
    start_angle=0,
    end_angle=360,
    sectors=59,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0XFFF000,0},{0.5,0xFFF000,1}, {1,0xFFF000,0}},
    fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
        name='fs_used_perc',
        arg='/',
    max=100,
    xc=55,
    yc=360,
    radius=50,
    thickness=10,
    start_angle=270,
    end_angle=570,
    sectors=50,
    gap_sectors=0,
    fill_sector=true,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
    fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },
    {
        name='fs_used_perc',
        arg='/media/Stokage',
    max=100,
    xc=265,
    yc=360,
    radius=50,
    thickness=10,
    start_angle=270,
    end_angle=570,
    sectors=50,
    gap_sectors=0,
    fill_sector=true,
    bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
    fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
    fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
    bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
    },

}

--END OF PARAMETERS HERE

--main function

    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)
    cr=cairo_create(cs)

    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(rings_settings) do
            draw_ring(rings_settings[i])
        end
    end

    cairo_destroy(cr)

end




function draw_ring(t)

    local function rgba_to_r_g_b_a(tcolour)
        colour,alpha=tcolour[2],tcolour[3]
        return ((colour / 0x10000) % 0x100) / 255., 
            ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
            
            
    local function calc_delta(tcol1,tcol2)
        --calculate deltas P R G B A to table_colour 1

        for x = 1, #tcol1 do
            tcol1[x].dA    = 0
            tcol1[x].dP = 0
             tcol1[x].dR = 0
            tcol1[x].dG = 0
            tcol1[x].dB = 0
            if tcol2~=nil and #tcol1 == #tcol2 then
                local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
                local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
                tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
                 tcol1[x].dR = (r2-r1)/t.sectors
                tcol1[x].dG = (g2-g1)/t.sectors
                tcol1[x].dB = (b2-b1)/t.sectors
                tcol1[x].dA = (a2-a1)/t.sectors        
                
            end
        end
        
        return tcol1
    end

    --check values
    local function setup(t)
        if t.name==nil and t.arg==nil then 
            print ("No input values ... use parameters 'name'" +
                " with 'arg' or only parameter 'arg' ") 
            return
        end

        if t.max==nil then
            print ("No maximum value defined, use 'max'")
            print ("for name=" .. t.name)
            print ("with arg=" .. t.arg)
            return
        end
        if t.name==nil then t.name="" end
        if t.arg==nil then t.arg="" end

        if t.xc==nil then t.xc=conky_window.width/2 end
        if t.yc==nil then t.yc=conky_window.height/2 end
        if t.thickness ==nil then t.thickness = 10 end
        if t.radius ==nil then t.radius =conky_window.width/4 end
        if t.start_angle==nil then t.start_angle =0 end
        if t.end_angle==nil then t.end_angle=360 end
        if t.bg_colour1==nil then 
            t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
        end
        if t.fg_colour1==nil then
            t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
        end
        if t.bd_colour1==nil then
            t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
        end
        if t.sectors==nil then t.sectors=10 end
        if t.gap_sectors==nil then t.gap_sectors=1 end 
        if t.fill_sector==nil then t.fill_sector=false end
        if t.sectors==1 then t.fill_sector=false end
        if t.border_size==nil then t.border_size=0 end
        if t.cap==nil then t.cap="p" end
        --some checks
        if t.thickness>t.radius then t.thickness=t.radius*0.1 end
        t.int_radius = t.radius-t.thickness

        --check colors tables 
        for i=1, #t.bg_colour1 do 
            if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
        end
        for i=1, #t.fg_colour1 do 
            if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
        end
        for i=1, #t.bd_colour1 do 
            if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
        end
    
        if t.bg_colour2~=nil then
            for i=1, #t.bg_colour2 do 
                if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
            end
        end
        if t.fg_colour2~=nil then
            for i=1, #t.fg_colour2 do 
                if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
            end
        end
        if t.bd_colour2~=nil then
            for i=1, #t.bd_colour2 do 
                if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
            end
        end     
        
        if t.start_angle>=t.end_angle then
         local tmp_angle=t.end_angle
         t.end_angle= t.start_angle
         t.start_angle = tmp_angle
         -- print ("inversed angles")
            if t.end_angle-t.start_angle>360 and t.start_angle>0 then
                t.end_angle=360+t.start_angle
                print ("reduce angles")
            end
        
            if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
                t.end_angle=360+t.start_angle
                print ("reduce angles")
            end
        
            if t.int_radius<0 then t.int_radius =0 end
            if t.int_radius>t.radius then
                local tmp_radius=t.radius
                t.radius=t.int_radius
                t.int_radius=tmp_radius
                print ("inversed radius")
            end
            if t.int_radius==t.radius then
                t.int_radius=0
                print ("int radius set to 0")
            end 
        end
        
        t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
        t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
        t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
    end
    
    --initialize table
    setup(t)
    --[[grid
    h=conky_window.height
    w=conky_window.width
    cairo_set_source_rgba(cr,1,1,1,1)
    cairo_set_line_width(cr,0.5)
    cairo_move_to(cr,0,t.yc)
    cairo_line_to(cr,w,t.yc)
    cairo_stroke(cr)
    cairo_move_to(cr,t.xc,0)
    cairo_line_to(cr,t.xc,h)
    cairo_stroke(cr)
    cairo_move_to(cr,t.xc,t.yc)
    cairo_line_to(cr,t.xc+200*math.sin(math.pi/4),t.yc-200*math.cos(math.pi/4))
    cairo_stroke(cr)
    cairo_move_to(cr,0,t.yc-t.radius)
    cairo_line_to(cr,w,t.yc-t.radius)
    cairo_stroke(cr)
    cairo_move_to(cr,0,t.yc-t.int_radius)
    cairo_line_to(cr,w,t.yc-t.int_radius)
    cairo_stroke(cr)
    cairo_move_to(cr,0,t.yc-t.gap_sectors)
    cairo_line_to(cr,w,t.yc-t.gap_sectors)
    cairo_stroke(cr)
    cairo_set_source_rgba(cr,1,0,0,0.5)
    cairo_arc(cr,t.xc,t.yc,t.radius,0,2*math.pi)
    cairo_stroke(cr)
    cairo_arc(cr,t.xc,t.yc,t.int_radius,0,2*math.pi)    
    cairo_stroke(cr)    
    cairo_set_source_rgba(cr,0,1,0,1)    
    cairo_move_to(cr,t.xc+t.gap_sectors,t.yc-t.gap_sectors)
    cairo_line_to(cr,t.xc+400*math.sin(math.pi/4),t.yc-400*math.cos(math.pi/4))
    cairo_stroke(cr)
    --END GRID
    ]]
    
    --initialize cairo context
    cairo_save(cr)
    cairo_translate(cr,t.xc,t.yc)
    cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
    cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)

    --get value
    local value = 0
    if t.name ~="" then
        value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
    else
        value = tonumber(t.arg)
    end
    if value==nil then value =0 end

    --initialize sectors
    --angle of a sector :
    angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
    --value of a sector : 
    valueA = t.max/t.sectors
    --first angle of a sector : 
    lastAngle = t.start_angle*math.pi/180


    local function draw_sector(type_arc,angle0,angle,valpc, idx)
     
        --this function draws a portion of arc
         --type of arc, angle0 = strating angle, angle= angle of sector,
         --valpc = percentage inside the sector, idx = sctor number #
         if type_arc=="bg" then         --background
             if valpc==1 then return end
             tcolor=t.bg_colour1
         elseif type_arc=="fg" then    --foreground
             if valpc==0 then return end
             tcolor=t.fg_colour1
         elseif type_arc=="bd" then    --border
             tcolor=t.bd_colour1
         end 

        --angles equivalents to gap_sector
        local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
        local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))

        --angles of arcs
        local ext_angle=(angle-ext_delta*2)*valpc
        local int_angle=(angle-int_delta*2)*valpc

        --define colours to use for this sector
        if #tcolor==1 then 
            --plain color
            local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
            cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
                                    vG+tcolor[1].dG*idx,
                                    vB+tcolor[1].dB*idx,
                                    vA+tcolor[1].dA*idx    )
        else
            --radient color
            local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
            for i=1, #tcolor do
                local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
                cairo_pattern_add_color_stop_rgba (pat, 
                                    vP+tcolor[i].dP*idx,
                                    vR+tcolor[i].dR*idx,
                                    vG+tcolor[i].dG*idx,
                                    vB+tcolor[i].dB*idx,
                                    vA+tcolor[i].dA*idx    )
            end
            cairo_set_source (cr, pat)
            cairo_pattern_destroy(pat)
        end

        --start drawing
         cairo_save(cr)
        --x axis is parrallel to start of sector
        cairo_rotate(cr,angle0-math.pi/2)

        local ri,re = t.int_radius ,t.radius

        --point A 
        local angle_a
    
        if t.cap == "p" then 
            angle_a = int_delta
            if t.inverse_arc and type_arc ~="bg" then
                angle_a = angle-int_angle-int_delta
            end
            if not(t.inverse_arc) and type_arc =="bg" then
                angle_a = int_delta+int_angle
            end
        else --t.cap=="r"
            angle_a = ext_delta
            if t.inverse_arc and type_arc~="bg" then
                angle_a = angle-ext_angle-ext_delta
            end
            if not(t.inverse_arc) and type_arc=="bg" then
                angle_a = ext_delta+ext_angle
            end
        end
        local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)


        --point B
        local angle_b = ext_delta
        if t.cap == "p" then 
            if t.inverse_arc and type_arc ~="bg" then
                angle_b = angle-ext_angle-ext_delta
            end
            if not(t.inverse_arc) and type_arc=="bg" then
                angle_b = ext_delta+ext_angle
            end
        else
            if t.inverse_arc and type_arc ~="bg" then
                angle_b = angle-ext_angle-ext_delta
            end
            if not(t.inverse_arc) and type_arc=="bg" then
                angle_b = ext_delta+ext_angle
            end
        end
        local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)

        -- EXTERNAL ARC B --> C
        if t.inverse_arc then
            if type_arc=="bg" then
                b0,b1= ext_delta, angle-ext_delta-ext_angle
            else
                b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
            end
        else
            if type_arc=="bg" then
                b0,b1= ext_delta+ext_angle, angle-ext_delta
            else
                b0,b1= ext_delta, ext_angle+ext_delta
            end
        end
        
        ---POINT D
        local angle_c 
        if t.cap == "p" then 
            angle_d = angle-int_delta
            if t.inverse_arc and type_arc=="bg" then
                angle_d = angle-int_delta-int_angle    
            end
            if not(t.inverse_arc) and type_arc~="bg" then
                angle_d=int_delta+int_angle
            end
        else
            angle_d = angle-ext_delta
            if t.inverse_arc and type_arc=="bg" then
                angle_d =angle-ext_delta-ext_angle
            end
            if not(t.inverse_arc) and type_arc~="bg" then
                angle_d = ext_angle+ext_delta
            end
        end
        local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
        
        -- INTERNAL ARC D --> A
        if t.cap=="p" then    
            if t.inverse_arc then    
                if type_arc=="bg" then
                    d0,d1= angle-int_delta-int_angle,int_delta
                else
                    d0,d1= angle-int_delta, angle- int_angle-int_delta
                end
            else
                if type_arc=="bg" then
                    d0,d1= angle-int_delta, int_delta+int_angle
                else
                    d0,d1= int_delta+int_angle, int_delta
                end
            end
        else
            if t.inverse_arc then    
                if type_arc=="bg" then    
                    d0,d1= angle-ext_delta-ext_angle,ext_delta
                else
                    d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
                end
            else
                if type_arc=="bg" then    
                    d0,d1= angle-ext_delta,ext_delta+ext_angle
                else    
                    d0,d1= ext_angle+ext_delta, ext_delta
                end
            end            
        end
            
        --draw sector
        cairo_move_to(cr,ax,ay)
        cairo_line_to(cr,bx,by)
        cairo_arc(cr,0,0,re,b0,b1)
        cairo_line_to(cr,dx,dy) 
        cairo_arc_negative(cr,0,0,ri,d0,d1)
         cairo_close_path (cr);

        --stroke or fill sector
         if type_arc=="bd" then
             cairo_set_line_width(cr,t.border_size)
             cairo_stroke(cr)
         else
             cairo_fill(cr)
         end

         cairo_restore(cr)

     end
    --draw sectors
    local n0,n1,n2 = 1,t.sectors,1
    if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
    local index = 0
    for i = n0,n1,n2 do 
        index = index +1
        local valueZ=1
        local cstA, cstB = (i-1),i
        if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
        
        if value>valueA *cstA and value<valueA*cstB then
            if not t.fill_sector then
                valueZ = (value-valueA*cstA)/valueA
            end
        else
            if value<valueA*cstB then valueZ=0 end
        end
        
        local start_angle= lastAngle+(i-1)*angleA
        if t.foreground ~= false then 
            draw_sector("fg",start_angle,angleA,valueZ, index)
        end
        if t.background ~= false then 
            draw_sector("bg",start_angle,angleA,valueZ, i)
        end
        if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
    end

    cairo_restore(cr)
end


--[[END OF RING-SECTORS WIDGET]]


function axis(ctx,alpha)
    cairo_set_line_width(ctx,1)
    cairo_set_source_rgba(ctx,1,0,0,alpha)
    cairo_move_to(ctx,0,0)
    cairo_line_to(ctx,150,0)
    cairo_stroke(ctx)
    cairo_set_source_rgba(ctx,0,1,0,alpha)
    cairo_move_to(ctx,0,0)
    cairo_line_to(ctx,0,150)
    cairo_stroke(ctx)
end    

rings2.lua

--[[
Ring Meters by londonali1010 (2009)

This script draws percentage meters as rings. It is fully customisable; all options are described in the 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 on line 145 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/rings-v1.2.lua
    lua_draw_hook_pre ring_stats

Changelog:
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]

settings_table = {
    {
    name='downspeedf',
    arg='eth0',
    max=2000,
    bg_colour=0x000000,
    bg_alpha=0.6,
    fg_colour=0xFF0000,
    fg_alpha=0.8,
    x=52, y=315,
    radius=30,
    thickness=5,
    start_angle=270,
    end_angle=570,
    },
    {
        name='upspeedf',
        arg='eth0',
        max=150,
        bg_colour=0x000000,
        bg_alpha=0.6,
        fg_colour=0xFF0000,
        fg_alpha=0.8,
        x=150, y=315,
        radius=30,
        thickness=5,
        start_angle=270,
        end_angle=570,
    },


}

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 conky_ring_stats()
    if lastValue==nil then lastValue = 0 end
    
    local function setup_rings(cr,pt)
        local str=''
        local value=0

        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        if pt['name'] == "hddtemp" then 
            if str=="N/A" then
                value=lastValue
            else
                value=tonumber(str)
                lastValue=value
            end
        else
            value=tonumber(str)
        end
        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
end

Par avance merci pour votre aide.
Didier

Hors ligne

#1046 Le 28/09/2011, à 06:24

Didier-T

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

bonjour Phyllinux,

Phyllinux a écrit :
#! /bin/bash

sleep 20
conky -c /home/gilles/weather+clock/conkyrc &
conky -c /home/gilles/scripts/conkyrc1 &
exit

tu pourrais essayer :

#!/bin/bash

sleep 20
conky -c /home/gilles/weather+clock/conkyrc;
sleep 2
conky -c /home/gilles/scripts/conkyrc1;
exit

Dernière modification par Didier-T (Le 28/09/2011, à 08:06)

Hors ligne

#1047 Le 28/09/2011, à 08:54

wlourf

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

Didier-T a écrit :

Bonjour a tous,

Voila j'ai un petit soucis, j'ai réalisé un conky avec des scripts glanés sur le net et adapté à mes envies, mais voila je me suis aperçus que l'espace mémoire de mes conky ne cessais d'augmenté avec le temps qui passe.

Bonjour,

Regarde du côté des scripts Lua, ils peuvent consommer pas mal de mémoire s'ils sont buggés (désactive les uns à uns pour voir)
Pour le script rings.lua, ça ressemble fortement à un de mes scripts! mais avec quelques différences (par exemple, tu as cr=cairo_create(cs) au lieu de local cr=cairo_create(cs)), télécharge la dernière version du script qui justement corrigeait des fuites de mémoire.

Pareil, pour le script rings2.lua, tu n'as pas la dernière version mais ça ne devrait rien changer pour la mémoire.

Pour les mettre à jour, copie juste les table_settings dans les nouveaux scripts et ça devrait aller.

Hors ligne

#1048 Le 28/09/2011, à 09:14

Didier-T

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

merci wlourf pour cette info, je vais regarder sa de ce pas.

j'en ai profiter pour charger tes autres création, tu as un sacré talent, bravo.

Hors ligne

#1049 Le 28/09/2011, à 09:29

wlourf

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

merci tongue

Hors ligne

#1050 Le 28/09/2011, à 13:28

Phyllinux

Re : (4) Conky : Postez vos conkyrc ou certaines parties intéressantes

@ Levi59 et Didier-T

Merci de votre aide.
Evolution de la situation :
La modif conseillée par Levi59 ne donne pas d'amélioration.
Pour celle de Didier-T, il y a du mieux : Les 2 conkys s'affichent, mais le premier qui s'affiche reste au premier plan (En l'occurence le conky 'système' du bas) !!!
En revanche, si je les ferme tous les 2 par un 'killall conky' et que je les relance en console, alors là, tout est OK, pas de conky en premier plan...
Une idée peut-être ? hmm

Voivi le résultat final escompté :

2 conkys


The ship is sinking normally...

Hors ligne