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.

#1151 Le 10/11/2011, à 23:00

sam7

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

je débute en conky ... et avec du lua en plus : ça ne me semble pas "trop complexe", mais ça n'est pas évident ... comme tout ce qui est nouveau ...
... dans mon cas, ça se passe ici : http://crunchbanglinux-fr.org/forum/vie … 346#p19346


sam7 @ sweetux.org = "Faire connaître & promouvoir la culture libre"
& @ gafam.fr = "Faire connaître & promouvoir les alternatives aux GAFAMs"

Hors ligne

#1152 Le 13/11/2011, à 22:35

sickboy

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

bonjour,
la variable hr permet d'avoir une ligne horizontal, j'aimerai savoir s'il en existe une pour une ligne vertical ?


Xubuntu Voyager 11.10 / Linux Mint Debian Edition
AMD Phenom II x4 945
Asus Nvidia GeForce GT 440
Asus Xonar Essence STX

Hors ligne

#1153 Le 19/11/2011, à 12:23

TuxBoy38

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

salut à tous,

"linuxien" et motard, il fallait que je fasse un conky à mon image. Et bien voilà:
1321700422.png


bon d'accord, il est assez surchargé, mais je ne suis pas terrible en graphismes.........

les codes:

Données Système et Hardware: ~/.conky/sys

###############################################
#####   DONNEES SYSTEME                       #####
#####   Config MATERIELLE                 #####
#####                                      #####
#####                             by tuxboy38 #####
###############################################



#   #   #   #   #   #   #   #
# CONFIGURATION PRINCIPALE  #
#   #   #   #   #   #   #   #

# 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 utiliser
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 2

# # taille et positon
alignment tl
gap_x 30
gap_y 30
minimum_size 450 180
maximum_width 450

# #  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

# #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
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# #police a utiliser : use_xft doit être a "yes"
xftfont Comic Sans MS:size=9

# # 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

# # Couleurs
default_color 000000 #blanc
default_shade_color 333333
default_outline_color black


#Lua Load
  lua_load ~/.conky/scripts/sys.lua
  lua_draw_hook_pre ring_stats


#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${font Comic Sans MS:size=12:style=Bold}${color 363636}${alignc}Ubuntu ${execp lsb_release -r | sed 's/.*:\t//'} - kernel ${execp uname -r | sed 's/-g.*//'}${font Comic Sans MS:size=9:style=Normal}
${voffset 20}${alignr}${time %A %d %B %Y}
${voffset 50}${offset 30}${time %H:%M:%S}
${voffset -20}${offset 155}${uptime_short}

${voffset -55}${alignr}${execp hwinfo --cpu | grep -m 1 Model | cut -c18-56 | sed 's/(R)//' | sed 's/(TM)//'}
${alignr}${execp hwinfo | grep system.board.vendor | cut -c 26-32} ${execp hwinfo | grep system.board.product | cut -c 27-39}
${alignr}${execp nvidia-settings -q gpus | grep gpu:0 | cut -c 33-47}
${alignr}Corsair Vengeance DDR3 PC12800

Données CPU/MB/GPU: ~/.conky/cpu

###############################################
#####   USAGE et TEMPERATURE CPU           #####
#####   TEMPERATURE MB                    #####
#####    TEMPERATURE GPU                      #####
#####                             by tuxboy38 #####
###############################################



#   #   #   #   #   #   #   #
# CONFIGURATION PRINCIPALE  #
#   #   #   #   #   #   #   #

# 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 utiliser
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 2

# # taille et positon
alignment tl
gap_x 1420
gap_y 30
minimum_size 500 550
maximum_width 500

# #  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

# #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
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# #police a utiliser : use_xft doit être a "yes"
xftfont Comic Sans MS:size=9

# # 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

# # Couleurs
default_color 000000 #blanc
default_shade_color 333333
default_outline_color black


#Lua Load
  lua_load ~/.conky/scripts/cpu.lua
  lua_draw_hook_pre ring_stats


#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${voffset 10}${font Comic Sans MS:size=12:style=Bold}${color 363636}${alignc}Processeurs${font Comic Sans MS:size=9:style=Normal}

${voffset 42}${offset 38}${color 760202}CPU0${color 065c00}${voffset -7}${offset 83}${platform coretemp.0 temp 1}°C
${voffset 18}${offset 38}${color 065c00}CPU1${color 000000}
${voffset -5}${offset 170}Core 0

${voffset -78}${offset 288}${color 760202}CPU2${color 065c00}${voffset -7}${offset 83}${platform coretemp.1 temp 1}°C
${voffset 18}${offset 288}${color 065c00}CPU3${color 000000}
${voffset -5}${offset 420}Core 1

${voffset 82}${offset 38}${color 760202}CPU4${color 065c00}${voffset -7}${offset 83}${platform coretemp.2 temp 1}°C
${voffset 18}${offset 38}${color 065c00}CPU5${color 000000}
${voffset -5}${offset 170}Core 2

${voffset -78}${offset 288}${color 760202}CPU6${color 065c00}${voffset -7}${offset 83}${platform coretemp.3 temp 1}°C
${voffset 18}${offset 288}${color 065c00}CPU7${color 000000}
${voffset -5}${offset 420}Core 3


${voffset 20}${offset 60}${font Comic Sans MS:size=12:style=Bold}${color 363636}Carte Mère${color 363636}${offset 140}Carte Graphique${font Comic Sans MS:size=9:style=Normal}
${color 065c00}${voffset 66}${offset 150}${execi 10 sensors | grep temp3 |cut -c 15-21}${offset 220}${execi 2 nvidia-settings -t -q GPUCoreTemp}°C

Données RAM: ~/.conky/mem

###############################################
#####   USAGE RAM                           #####
#####   5 plus gros USERS                 #####
#####                                      #####
#####                         by tuxboy38 #####
###############################################



#   #   #   #   #   #   #   #
# CONFIGURATION PRINCIPALE  #
#   #   #   #   #   #   #   #

# 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 utiliser
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 2

# # taille et positon
alignment tl
gap_x 30
gap_y 210
minimum_size 450 180
maximum_width 450

# #  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

# #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
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# #police a utiliser : use_xft doit être a "yes"
xftfont Comic Sans MS:size=9

# # 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

# # Couleurs
default_color 000000 #blanc
default_shade_color 333333
default_outline_color black


#Lua Load
  lua_load ~/.conky/scripts/mem.lua
  lua_draw_hook_pre ring_stats


#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${voffset 8}${alignc}${font Comic Sans MS:size=12:style=Bold}${color 363636}RAM${font Comic Sans MS:size=9:style=Normal}
${color 760202}${voffset 47}${offset 150}$mem
${offset 150}$memmax

${color 363636}
${voffset -100}${offset 255}${top_mem name 1}${alignr}${top_mem mem 2}%
${offset 255}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 255}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 255}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 255}${top_mem name 5}${alignr}${top_mem mem 5}%

Données réseau: ~/.conky/net

###############################################
#####   ETAT RESEAU                           #####
#####   IP LAN/WAN                          #####
#####                                      #####
#####                         by tuxboy38 #####
###############################################



#   #   #   #   #   #   #   #
# CONFIGURATION PRINCIPALE  #
#   #   #   #   #   #   #   #

# 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 utiliser
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 2

# # taille et positon
alignment tl
gap_x 1670
gap_y 650
minimum_size 250 400
maximum_width 250

# #  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

# #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
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# #police a utiliser : use_xft doit être a "yes"
xftfont Comic Sans MS:size=9

# # 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

# # Couleurs
default_color 000000 #blanc
default_shade_color 333333
default_outline_color black


#Lua Load
  lua_load ~/.conky/scripts/net.lua
  lua_draw_hook_pre ring_stats


#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${font Comic Sans MS:size=12:style=Bold}${color 363636}${alignc}Réseau          ${font Comic Sans MS:size=9:style=Normal}
${voffset 95}${offset 80}${downspeed eth0}/s
${voffset -67}${offset 134}${downspeedgraph eth0 40,60 760202 065c00 -l -t}
${voffset 141}${offset 80}${upspeed eth0}/s
${voffset -67}${offset 134}${upspeedgraph eth0 40,60 760202 065c00 -l -t}
${alignr}${voffset -125}IP locale: ${addr eth0}  
${alignr}IP Publique: ${execi 300 ~/.conky/scripts/wan.sh}  

${voffset -52}Download
${voffset 130}Upload

${font Comic Sans MS:size=7:style=Normal}
${voffset -280}${offset 55}x10KiB/s
${voffset 137}${offset 55}x10KiB/s

Météo: ~/.conky/met

###############################################
#####   METEO                               #####
#####                                     #####
#####                                      #####
#####                         by tuxboy38 #####
###############################################



#   #   #   #   #   #   #   #
# CONFIGURATION PRINCIPALE  #
#   #   #   #   #   #   #   #

# 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 utiliser
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 2

# # taille et positon
alignment tl
gap_x 30
gap_y 780
minimum_size 280 200
maximum_width 280

# #  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

# #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
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# #police a utiliser : use_xft doit être a "yes"
xftfont Comic Sans MS:size=9

# # 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

# # Couleurs
default_color 000000 #blanc
default_shade_color 333333
default_outline_color black

color2 363636

#   #   #   #   #   #   #
#   INFOS A AFFICHER    #
#   #   #   #   #   #   #
   
TEXT
${alignc}${color2}${font Comic Sans MS:size=12:style=Bold}${execi 120 ~/.conky/meteo/meteo.sh FRXX0153}Météo à ${execi 120 ~/.conky/meteo/meteo2.sh "Ville"}${font Comic Sans MS:size=9:style=Normal}

${color2}Aujourd'hui : ${execi 120 ~/.conky/meteo/meteo2.sh "Température aujourd'hui"}  
${font weather:size=40}${voffset -30}${offset 230}${execi 120 ~/.conky/meteo/meteo2.sh "Conditions aujourd'hui"}${font Comic Sans MS:size=9:style=Normal}${voffset -16}
Vent : ${execi 120 ~/.conky/meteo/meteo2.sh "Vent aujourd'hui"}
Lever du soleil : ${execi 120 ~/.conky/meteo/meteo2.sh "Lever du soleil"}
Coucher du soleil : ${execi 120 ~/.conky/meteo/meteo2.sh "Coucher du soleil"}

Demain : ${execi 120 ~/.conky/meteo/meteo2.sh "Température demain"}
${font weather:size=40}${voffset -30}${offset 230}${execi 120 ~/.conky/meteo/meteo2.sh "Conditions demain"}${font Comic Sans MS:size=9:style=Normal}

Script LUA pour SYS: ~/.conky/scripts/sys.lua

--liste usage des cpu
clock = {
    {
        name='time',
        arg='%H',
        max_value=12,
        x=60,
        y=100,
        graph_radius=35,
        graph_thickness=4,
        graph_unit_angle=30,
        graph_fg_colour=0x065c00,
        graph_fg_alpha=0.7,
    },
    {
        name='time',
        arg='%M',
        max_value=60,
        x=60,
        y=100,
        graph_radius=42,
        graph_thickness=3,
        graph_unit_angle=6,
        graph_fg_colour=0x065c00,
        graph_fg_alpha=0.7,
    },
    {
        name='time',
        arg='%S',
        max_value=60,
        x=60,
        y=100,
        graph_radius=50,
        graph_thickness=2,
        graph_unit_angle=6,
        graph_fg_colour=0x065c00,
        graph_fg_alpha=0.7,
    },
}

uptime = {
    {
        name='execi',
        arg='60 ~/.conky/scripts/uptime.sh -h',
        max_value=12,
        x=170,
        y=90,
        graph_radius=35,
        graph_thickness=4,
        graph_unit_angle=30,
        graph_fg_colour=0x760202,
        graph_fg_alpha=0.7,
    },
    {
        name='execi',
        arg='60 ~/.conky/scripts/uptime.sh -m',
        max_value=12,
        x=170,
        y=90,
        graph_radius=42,
        graph_thickness=3,
        graph_unit_angle=6,
        graph_fg_colour=0x760202,
        graph_fg_alpha=0.7,
    },
}

require 'cairo'

--décomposition des couleurs
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

--degrés -> radians
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

function draw_background(cr, x, y, r)
    local angle_0=210*(2*math.pi/360)-math.pi/2
    local angle_f=450*(2*math.pi/360)-math.pi/2

    cairo_arc(cr, x, y, r, angle_0, angle_f)
    cairo_set_line_width(cr, 3);
    cairo_set_source_rgba(cr, rgb_to_r_g_b(0x363636, 0.6))
    cairo_stroke(cr)

    local xr1, xr2, yr1, yr2
    local rpos
    local xc, yc, ring_r = x, y, r
    for i=0,8 do
        rpos=angle_0 + (30*i)*(2*math.pi/360)
        xr1=xc+ring_r*math.cos(rpos)
        yr1=yc+ring_r*math.sin(rpos)
        xr2=xc+(ring_r-7)*math.cos(rpos)
        yr2=yc+(ring_r-7)*math.sin(rpos)

        cairo_move_to(cr, xr1, yr1)
        cairo_line_to(cr, xr2, yr2)
        cairo_set_line_width(cr,2)
        cairo_stroke(cr)
    end

    cairo_arc(cr, x, y, 2, 0, 2*math.pi)
    cairo_stroke(cr)
end

function draw_aiguille(cr, data, offset)

    local x, y = data['x'], data['y']
    local xf, yf
    local ring_r, ring_w = data['graph_radius'], data['graph_thickness']
    local angle_unit = data['graph_unit_angle']
    local color, alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local str, value = '', 0
    str = string.format('${%s %s}',data['name'], data['arg'])
    str = conky_parse(str)
    value = tonumber(str)

    local angle = angle_to_position(0, (value+offset)*angle_unit)
    xf = x+ring_r * math.cos(angle)
    yf = y+ring_r * math.sin(angle)

    cairo_move_to(cr, x, y)
    cairo_line_to(cr, xf, yf)
    cairo_set_line_width(cr, ring_w)
    cairo_set_source_rgba(cr, rgb_to_r_g_b(color, alpha))
    cairo_stroke(cr)

    return(value)
end

-- dessin du compteur type ER6
function conky_compteur_er6(cr, xc1, yc1, xc2, yc2)
    local ring_r1, ring_r3, ring_w = 58, 100, 2
    local angle_01, angle_f1 = 138*(2*math.pi/360)-math.pi/2, 380*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = -25*(2*math.pi/360)-math.pi/2, 25*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 65*(2*math.pi/360)-math.pi/2, 120*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc2,yc2,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc2-30, yc2, ring_r3, angle_03, angle_f3)
    cairo_line_to(cr, xc1+37, yc1+43)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
end

-- "main"
function conky_ring_stats()
    if lastValue==nil then lastValue = 0 end

    -- init cairo
    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
        --go_clock_rings(cr)
        draw_background(cr, 60, 100, 50)
        draw_background(cr, 170, 90, 50)

        sec = draw_aiguille(cr, clock[3], -1)
        min = draw_aiguille(cr, clock[2], tonumber(sec)/60)
        draw_aiguille(cr, clock[1], tonumber(min)/60)

        min = draw_aiguille(cr, uptime[2],0)
        draw_aiguille(cr, uptime[1],tonumber(min)/60)
    end

    -- dessin des compteurs
    conky_compteur_er6(cr, 60, 100, 170, 90)

end

Script LUA pour CPU/MB/GPU: ~/.conky/scripts/cpu.lua

--liste usage des cpu
cpu_use = {
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=60, y=120,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=60, y=120,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=310, y=120,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu4',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=310, y=120,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu5',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=60, y=280,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu6',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=60, y=280,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu7',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=310, y=280,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='cpu',
        arg='cpu8',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=310, y=280,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
}

-- liste températures (CPU, MB, GPU)
cpu_temp = {
    {
        name='platform',
        arg='coretemp.0 temp 1',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=170, y=110,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='platform',
        arg='coretemp.1 temp 1',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=420, y=110,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='platform',
        arg='coretemp.2 temp 1',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=170, y=270,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='platform',
        arg='coretemp.1 temp 1',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=420, y=270,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='execi',
        arg='10 sensors | grep temp3 |cut -c 15-18',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=80, y=470,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
    {
        name='execi',
        arg='2 nvidia-settings -t -q GPUCoreTemp',
        max=120,
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x065c00,
        fg_alpha=0.8,
        x=330, y=470,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
}

require 'cairo'

--décomposition des couleurs
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

--dessin des températures
function draw_temp(cr,t,pt, value)

    --affiche un texte
    local function set_txt(val, xr2, yr2)
        local txt_radius = 10
        local txt_weight, txt_size = 0, 8.0
        local txt_fg_colour, txt_fg_alpha = 0x363636, 1.0
        cairo_select_font_face (cr, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
        cairo_set_font_size (cr, txt_size);
        cairo_set_source_rgba (cr, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
        cairo_move_to (cr, xr2, yr2);
        cairo_show_text (cr, val);
        cairo_stroke(cr);
    end

    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)

    local xr1, xr2, yr1, yr2
    local rpos

    -- dessin du background (cercle)
    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,3,0,2*math.pi)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

    -- dessin du background (marques)
    for i=0,6 do
        rpos=angle_0+(9.5*i)*(angle_f-angle_0)*(2*math.pi/360)
        xr1=xc+ring_r*math.cos(rpos)
        yr1=yc+ring_r*math.sin(rpos)
        xr2=xc+(ring_r-7)*math.cos(rpos)
        yr2=yc+(ring_r-7)*math.sin(rpos)

        cairo_move_to(cr, xr1, yr1)
        cairo_line_to(cr, xr2, yr2)
        cairo_set_line_width(cr,2)
        cairo_stroke(cr)
    end

    -- dessin texte background
    rpos=angle_0
    xr2=xc+(ring_r-7)*math.cos(rpos) - 1
    yr2=yc+(ring_r-7)*math.sin(rpos) - 1
    set_txt("0", xr2, yr2)
    rpos=angle_0+(9.5)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+1
    yr2=yc+(ring_r-7)*math.sin(rpos)+2
    set_txt("20", xr2, yr2)
    rpos=angle_0+(9.5*2)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+5
    set_txt("40", xr2, yr2)
    rpos=angle_0+(9.5*3)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-2
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("60", xr2, yr2)
    rpos=angle_0+(9.5*4)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-6
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("80", xr2, yr2)
    rpos=angle_0+(9.5*5)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-16
    yr2=yc+(ring_r-7)*math.sin(rpos)+6
    set_txt("100", xr2, yr2)
    rpos=angle_0+(9.5*6)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-16
    yr2=yc+(ring_r-7)*math.sin(rpos)+4
    set_txt("120", xr2, yr2)

    -- dessin aiguille
    local pos=t_arc*(2*math.pi/360)-math.pi/2
    local xf=xc+(ring_r) * math.cos(angle_0+t_arc)
    local yf=yc+(ring_r) * math.sin(angle_0+t_arc)

    cairo_move_to(cr, xc, yc)
    cairo_line_to(cr, xf, yf)
    if value<70 then
        cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    else
        cairo_set_source_rgba(cr,rgb_to_r_g_b(0xFF0000,fga))
    end
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

    -- dessin témoin lumineux
    cairo_move_to(cr, xc-55, yc+40)
    cairo_arc(cr, xc-50, yc+40, 4, 0, 2*math.pi)
    cairo_set_line_width(cr, 8)
    cairo_stroke(cr)
end

--dessin de l'usage cpu
function draw_cpu_use(cr,t,pt)

    --affiche un texte
    local function set_txt(val, xr2, yr2)
        local txt_radius = 10
        local txt_weight, txt_size = 0, 8.0
        local txt_fg_colour, txt_fg_alpha = 0x606060, 1.0
        cairo_select_font_face (cr, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
        cairo_set_font_size (cr, txt_size);
        cairo_set_source_rgba (cr, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
        cairo_move_to (cr, xr2, yr2);
        cairo_show_text (cr, val);
        cairo_stroke(cr);
    end

    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)

    local xr1, xr2, yr1, yr2
    local rpos

    -- dessin du background (cercle)
    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,3,0,2*math.pi)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

    -- dessin du background (marques)
    for i=0,10 do
        rpos=angle_0+(5.7*i)*(angle_f-angle_0)*(2*math.pi/360)
        xr1=xc+ring_r*math.cos(rpos)
        yr1=yc+ring_r*math.sin(rpos)
        xr2=xc+(ring_r-7)*math.cos(rpos)
        yr2=yc+(ring_r-7)*math.sin(rpos)

        cairo_move_to(cr, xr1, yr1)
        cairo_line_to(cr, xr2, yr2)
        cairo_set_line_width(cr,2)
        cairo_stroke(cr)
    end

    -- dessin du texte
    rpos=angle_0
    xr2=xc+(ring_r-7)*math.cos(rpos) - 1
    yr2=yc+(ring_r-7)*math.sin(rpos) - 1
    set_txt("0", xr2, yr2)
    rpos=angle_0+(5.7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+2
    set_txt("10", xr2, yr2)
    rpos=angle_0+(5.7*2)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("20", xr2, yr2)
    rpos=angle_0+(5.7*3)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+5
    set_txt("30", xr2, yr2)
    rpos=angle_0+(5.7*4)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)
    yr2=yc+(ring_r-7)*math.sin(rpos)+7
    set_txt("40", xr2, yr2)
    rpos=angle_0+(5.7*5)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-2
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("50", xr2, yr2)
    rpos=angle_0+(5.7*6)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-4
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("60", xr2, yr2)
    rpos=angle_0+(5.7*7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-6
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("70", xr2, yr2)
    rpos=angle_0+(5.7*8)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-8
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("80", xr2, yr2)
    rpos=angle_0+(5.7*9)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-11
    yr2=yc+(ring_r-7)*math.sin(rpos)+6
    set_txt("90", xr2, yr2)
    rpos=angle_0+(5.7*10)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-16
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("100", xr2, yr2)

    -- dessin de l'aiguille
    local pos=t_arc*(2*math.pi/360)-math.pi/2
    local xf=xc+(ring_r) * math.cos(angle_0+t_arc)
    local yf=yc+(ring_r) * math.sin(angle_0+t_arc)

    cairo_move_to(cr, xc, yc)
    cairo_line_to(cr, xf, yf)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

end

-- dessin du compteur type ER6
function conky_compteur_er6(cr, xc1, yc1, xc2, yc2)
    local ring_r1, ring_r3, ring_w = 58, 100, 2
    local angle_01, angle_f1 = 138*(2*math.pi/360)-math.pi/2, 380*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = -25*(2*math.pi/360)-math.pi/2, 25*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 65*(2*math.pi/360)-math.pi/2, 120*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc2,yc2,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc2-30, yc2, ring_r3, angle_03, angle_f3)
    cairo_line_to(cr, xc1+37, yc1+43)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
end

-- dessin du compteur type Z750
function conky_compteur_z750(cr, xc1, yc1, xc4, yc4, xc5, yc5)
    local ring_r1, ring_r3, ring_r4, ring_w = 62, 79, 120, 2
    local angle_01, angle_f1 = 150*(2*math.pi/360)-math.pi/2, 210*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = 330*(2*math.pi/360)-math.pi/2, 390*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 230*(2*math.pi/360)-math.pi/2, 310*(2*math.pi/360)-math.pi/2
    local angle_04, angle_f4 = 55*(2*math.pi/360)-math.pi/2, 70*(2*math.pi/360)-math.pi/2
    local angle_05, angle_f5 = 110*(2*math.pi/360)-math.pi/2, 125*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc1,yc1,ring_r3,angle_03,angle_f3)
    cairo_arc(cr,xc1,yc1,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc4,yc4,ring_r4,angle_04,angle_f4)
    cairo_arc(cr,xc5,yc5,ring_r4,angle_05,angle_f5)
    cairo_line_to(cr,xc1+29,yc1+54)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
    cairo_rectangle(cr,xc1+60,yc1-20,60,40)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
end

-- "main"
function conky_ring_stats()
    if lastValue==nil then lastValue = 0 end
    
    -- dessin des cadrans températures
    local function setup_temp(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_temp(cr,pct,pt,value)
    end

    -- dessin des cadran usage
    local function setup_cpu_use(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_cpu_use(cr,pct,pt)
    end

    -- init cairo
    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(cpu_temp) do
            setup_temp(cr,cpu_temp[i])
        end
        for i in pairs(cpu_use) do
            setup_cpu_use(cr, cpu_use[i])
        end
    end

    -- dessin des compteurs
    conky_compteur_er6(cr, 60, 120, 170, 110)
    conky_compteur_er6(cr, 310, 120, 420, 110)
    conky_compteur_er6(cr, 60, 280, 170, 270)
    conky_compteur_er6(cr, 310, 280, 420, 270)

    conky_compteur_z750(cr, 80, 470, 110, 510, 110, 430)
    conky_compteur_z750(cr, 330, 470, 360, 510, 360, 430)

end

Script LUA pour RAM: ~/.conky/scripts/mem.lua

--remplissage de la RAM
mem_use = {
    {
        name='execi',
        arg='60 free -t | grep cache: | sed "s/.* //"',
        max='execi 60 free -t | grep Mem | sed "s/Mem://" | cut -c 1-15 | sed "s/ //g"',
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=80, y=100,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
}

require 'cairo'

--décomposition des couleurs
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

--dessin de l'usage cpu
function draw_mem_use(cr,t,pt)

    --affiche un texte
    local function set_txt(val, xr2, yr2)
        local txt_radius = 10
        local txt_weight, txt_size = 0, 8.0
        local txt_fg_colour, txt_fg_alpha = 0x606060, 1.0
        cairo_select_font_face (cr, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
        cairo_set_font_size (cr, txt_size);
        cairo_set_source_rgba (cr, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
        cairo_move_to (cr, xr2, yr2);
        cairo_show_text (cr, val);
        cairo_stroke(cr);
    end

    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)

    local xr1, xr2, yr1, yr2
    local rpos

    -- dessin du background (cercle)
    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,3,0,2*math.pi)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

    -- dessin du background (marques)
    for i=0,10 do
        rpos=angle_0+(5.7*i)*(angle_f-angle_0)*(2*math.pi/360)
        xr1=xc+ring_r*math.cos(rpos)
        yr1=yc+ring_r*math.sin(rpos)
        xr2=xc+(ring_r-7)*math.cos(rpos)
        yr2=yc+(ring_r-7)*math.sin(rpos)

        cairo_move_to(cr, xr1, yr1)
        cairo_line_to(cr, xr2, yr2)
        cairo_set_line_width(cr,2)
        cairo_stroke(cr)
    end

    -- dessin du texte
    rpos=angle_0
    xr2=xc+(ring_r-7)*math.cos(rpos) - 1
    yr2=yc+(ring_r-7)*math.sin(rpos) - 1
    set_txt("0", xr2, yr2)
    rpos=angle_0+(5.7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+2
    set_txt("10", xr2, yr2)
    rpos=angle_0+(5.7*2)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("20", xr2, yr2)
    rpos=angle_0+(5.7*3)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+5
    set_txt("30", xr2, yr2)
    rpos=angle_0+(5.7*4)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)
    yr2=yc+(ring_r-7)*math.sin(rpos)+7
    set_txt("40", xr2, yr2)
    rpos=angle_0+(5.7*5)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-2
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("50", xr2, yr2)
    rpos=angle_0+(5.7*6)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-4
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("60", xr2, yr2)
    rpos=angle_0+(5.7*7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-6
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("70", xr2, yr2)
    rpos=angle_0+(5.7*8)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-8
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("80", xr2, yr2)
    rpos=angle_0+(5.7*9)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-11
    yr2=yc+(ring_r-7)*math.sin(rpos)+6
    set_txt("90", xr2, yr2)
    rpos=angle_0+(5.7*10)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-16
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("100", xr2, yr2)

    -- dessin de l'aiguille
    local pos=t_arc*(2*math.pi/360)-math.pi/2
    local xf=xc+(ring_r) * math.cos(angle_0+t_arc)
    local yf=yc+(ring_r) * math.sin(angle_0+t_arc)

    cairo_move_to(cr, xc, yc)
    cairo_line_to(cr, xf, yf)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

end

-- dessin du compteur type ER6
function conky_compteur_er6(cr, xc1, yc1, xc2, yc2)
    local ring_r1, ring_r3, ring_w = 58, 100, 2
    local angle_01, angle_f1 = 138*(2*math.pi/360)-math.pi/2, 380*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = -25*(2*math.pi/360)-math.pi/2, 25*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 65*(2*math.pi/360)-math.pi/2, 120*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc2,yc2,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc2-30, yc2, ring_r3, angle_03, angle_f3)
    cairo_line_to(cr, xc1+37, yc1+43)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
end

-- dessin du compteur type Z750
function conky_compteur_z750(cr, xc1, yc1, xc4, yc4, xc5, yc5)
    local ring_r1, ring_r3, ring_r4, ring_w = 62, 79, 120, 2
    local angle_01, angle_f1 = 150*(2*math.pi/360)-math.pi/2, 210*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = 330*(2*math.pi/360)-math.pi/2, 390*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 230*(2*math.pi/360)-math.pi/2, 310*(2*math.pi/360)-math.pi/2
    local angle_04, angle_f4 = 55*(2*math.pi/360)-math.pi/2, 70*(2*math.pi/360)-math.pi/2
    local angle_05, angle_f5 = 110*(2*math.pi/360)-math.pi/2, 125*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc1,yc1,ring_r3,angle_03,angle_f3)
    cairo_arc(cr,xc1,yc1,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc4,yc4,ring_r4,angle_04,angle_f4)
    cairo_arc(cr,xc5,yc5,ring_r4,angle_05,angle_f5)
    cairo_line_to(cr,xc1+29,yc1+54)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
    cairo_rectangle(cr,xc1+60,yc1-20,65,40)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
end

-- "main"
function conky_ring_stats()
    if lastValue==nil then lastValue = 0 end
    
    -- dessin des cadran usage
    local function setup_mem_use(cr,pt, max)
        local str=''
        local value=0
        local max=1

        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
        str=string.format('${%s}', pt['max'])
        str=conky_parse(str)
        max=tonumber(str)
        if value==nil then value=0 end
        if max==nil then max=1 end
        pct=(max-value)/max
        draw_mem_use(cr,pct,pt)
    end

    -- init cairo
    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)

    --init graph
    if update_num>5 then
        for i in pairs(mem_use) do
            setup_mem_use(cr, mem_use[i])
        end
    end

    -- dessin des compteurs
--[[    conky_compteur_er6(cr, 60, 100, 170, 90)
    conky_compteur_er6(cr, 310, 100, 420, 90)
    conky_compteur_er6(cr, 60, 240, 170, 230)
    conky_compteur_er6(cr, 310, 240, 420, 230)]]--

    conky_compteur_z750(cr, 80, 100, 110, 140, 110, 60)
                            --80, 410, 110, 450, 110, 370
    --conky_compteur_z750(cr, 330, 410, 360, 450, 360, 370)

end

Script LUA pour Réseau: ~/.conky/scripts/net.lua

--utilisation de ETH0
mem_use = {
    {
        name='execi',
        arg='60 grep "MemFree" /proc/meminfo | sed "s/MemFree: //" | sed "s/ kB//"',
        max='execi 60 grep "MemTotal" /proc/meminfo | sed "s/MemTotal: //" | sed "s/ kB//"',
        bg_colour=0x363636,
        bg_alpha=0.6,
        fg_colour=0x760202,
        fg_alpha=0.8,
        x=80, y=100,
        radius=50,
        thickness=3,
        start_angle=210,
        end_angle=450,
    },
}

require 'cairo'

--décomposition des couleurs
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

--dessin de l'usage cpu
function draw_mem_use(cr,t,pt)

    --affiche un texte
    local function set_txt(val, xr2, yr2)
        local txt_radius = 10
        local txt_weight, txt_size = 0, 8.0
        local txt_fg_colour, txt_fg_alpha = 0x606060, 1.0
        cairo_select_font_face (cr, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
        cairo_set_font_size (cr, txt_size);
        cairo_set_source_rgba (cr, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
        cairo_move_to (cr, xr2, yr2);
        cairo_show_text (cr, val);
        cairo_stroke(cr);
    end

    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)

    local xr1, xr2, yr1, yr2
    local rpos

    -- dessin du background (cercle)
    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,3,0,2*math.pi)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

    -- dessin du background (marques)
    for i=0,10 do
        rpos=angle_0+(5.7*i)*(angle_f-angle_0)*(2*math.pi/360)
        xr1=xc+ring_r*math.cos(rpos)
        yr1=yc+ring_r*math.sin(rpos)
        xr2=xc+(ring_r-7)*math.cos(rpos)
        yr2=yc+(ring_r-7)*math.sin(rpos)

        cairo_move_to(cr, xr1, yr1)
        cairo_line_to(cr, xr2, yr2)
        cairo_set_line_width(cr,2)
        cairo_stroke(cr)
    end

    -- dessin du texte
    rpos=angle_0
    xr2=xc+(ring_r-7)*math.cos(rpos) - 1
    yr2=yc+(ring_r-7)*math.sin(rpos) - 1
    set_txt("0", xr2, yr2)
    rpos=angle_0+(5.7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+2
    set_txt("10", xr2, yr2)
    rpos=angle_0+(5.7*2)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("20", xr2, yr2)
    rpos=angle_0+(5.7*3)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)+2
    yr2=yc+(ring_r-7)*math.sin(rpos)+5
    set_txt("30", xr2, yr2)
    rpos=angle_0+(5.7*4)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)
    yr2=yc+(ring_r-7)*math.sin(rpos)+7
    set_txt("40", xr2, yr2)
    rpos=angle_0+(5.7*5)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-2
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("50", xr2, yr2)
    rpos=angle_0+(5.7*6)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-4
    yr2=yc+(ring_r-7)*math.sin(rpos)+9
    set_txt("60", xr2, yr2)
    rpos=angle_0+(5.7*7)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-6
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("70", xr2, yr2)
    rpos=angle_0+(5.7*8)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-8
    yr2=yc+(ring_r-7)*math.sin(rpos)+8
    set_txt("80", xr2, yr2)
    rpos=angle_0+(5.7*9)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-11
    yr2=yc+(ring_r-7)*math.sin(rpos)+6
    set_txt("90", xr2, yr2)
    rpos=angle_0+(5.7*10)*(angle_f-angle_0)*(2*math.pi/360)
    xr2=xc+(ring_r-7)*math.cos(rpos)-16
    yr2=yc+(ring_r-7)*math.sin(rpos)+3
    set_txt("100", xr2, yr2)

    -- dessin de l'aiguille
    local pos=t_arc*(2*math.pi/360)-math.pi/2
    local xf=xc+(ring_r) * math.cos(angle_0+t_arc)
    local yf=yc+(ring_r) * math.sin(angle_0+t_arc)

    cairo_move_to(cr, xc, yc)
    cairo_line_to(cr, xf, yf)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)

end

-- dessin du compteur type ER6
function conky_compteur_er6(cr, xc1, yc1, xc2, yc2)
    local ring_r1, ring_r3, ring_w = 58, 100, 2
    local angle_01, angle_f1 = 138*(2*math.pi/360)-math.pi/2, 380*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = -25*(2*math.pi/360)-math.pi/2, 25*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 65*(2*math.pi/360)-math.pi/2, 120*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc2,yc2,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc2-30, yc2, ring_r3, angle_03, angle_f3)
    cairo_line_to(cr, xc1+37, yc1+43)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
end

-- dessin du compteur type Z750
function conky_compteur_z750(cr, xc1, yc1, xc4, yc4, xc5, yc5)
    local ring_r1, ring_r3, ring_r4, ring_w = 62, 79, 120, 2
    local angle_01, angle_f1 = 150*(2*math.pi/360)-math.pi/2, 210*(2*math.pi/360)-math.pi/2
    local angle_02, angle_f2 = 330*(2*math.pi/360)-math.pi/2, 390*(2*math.pi/360)-math.pi/2
    local angle_03, angle_f3 = 230*(2*math.pi/360)-math.pi/2, 310*(2*math.pi/360)-math.pi/2
    local angle_04, angle_f4 = 55*(2*math.pi/360)-math.pi/2, 70*(2*math.pi/360)-math.pi/2
    local angle_05, angle_f5 = 110*(2*math.pi/360)-math.pi/2, 125*(2*math.pi/360)-math.pi/2
    cairo_arc(cr,xc1,yc1,ring_r1,angle_01,angle_f1)
    cairo_arc(cr,xc1,yc1,ring_r3,angle_03,angle_f3)
    cairo_arc(cr,xc1,yc1,ring_r1,angle_02,angle_f2)
    cairo_arc(cr,xc4,yc4,ring_r4,angle_04,angle_f4)
    cairo_arc(cr,xc5,yc5,ring_r4,angle_05,angle_f5)
    cairo_line_to(cr,xc1+29,yc1+54)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
    cairo_rectangle(cr,xc1+60,yc1-20,65,40)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(0x363636,0.7))
    cairo_stroke(cr)
end

-- "main"
function conky_ring_stats()
    if lastValue==nil then lastValue = 0 end
    
    -- dessin des cadran usage
    local function setup_mem_use(cr,pt, max)
        local str=''
        local value=0
        local max=1

        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
        str=string.format('${%s}', pt['max'])
        str=conky_parse(str)
        max=tonumber(str)
        if value==nil then value=0 end
        if max==nil then max=1 end
        pct=(max-value)/max
        draw_mem_use(cr,pct,pt)
    end

    -- init cairo
    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)

    --init graph
    if update_num>5 then
        for i in pairs(mem_use) do
            setup_mem_use(cr, mem_use[i])
        end
    end

    -- dessin des compteurs
--[[    conky_compteur_er6(cr, 60, 100, 170, 90)
    conky_compteur_er6(cr, 310, 100, 420, 90)
    conky_compteur_er6(cr, 60, 240, 170, 230)
    conky_compteur_er6(cr, 310, 240, 420, 230)]]--

    conky_compteur_z750(cr, 80, 100, 110, 140, 110, 60)
    --conky_compteur_z750(cr, 330, 410, 360, 450, 360, 370)

end

Script SH pour uptime: ~/.conky/scripts/uptime.sh

#!/bin/sh

h=0
m=0
a=$(uptime)

if [ "$(echo $a | grep 'min')" = '' ]
then
    #uptime > 1h, format hh:mm
    up=$(echo $a | cut -c 12-17)
    h=$(echo "$up" | sed 's/:.*//')
    m=$(echo "$up" | sed 's/.*://' | sed 's/,//')
else
    #uptime < 1h, format mm min
    h=0
    m=$(echo $a | cut -c 12-14)
    m=$(echo "$m" | sed 's/ //')
fi

if [ "$1" = "-h" ]
then
echo $h
exit
fi

if [ "$1" = "-m" ]
then
echo $m
exit
fi

echo $h $m

Script SH pour adresse WAN: ~/.conky/scripts/wan.sh

#!/bin/sh

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

Script SH de lancement: ~/conkystart.sh

#! /bin/bash

if pidof conky | grep [0-9] > /dev/null
then
exec killall conky
else
sleep 5
conky -c ~/.conky/sys &
sleep 1
conky -c ~/.conky/cpu &
sleep 1
conky -c ~/.conky/mem &
sleep 1
conky -c ~/.conky/net &
sleep 1
conky -c ~/.conky/met &
exit
fi

Pour la partie Météo, voir ici, sur ce site (codes légèrement remaniés).

[edit]
- modification script de récupération taille RAM libre/totale
- modification affichage des secondes (horloge)
- script de lancement
[/edit]

Dernière modification par TuxBoy38 (Le 19/11/2011, à 15:10)


___________________________________________________________________________________________
MB Asus P8P67 - Core i7-2600 3.4GHz - 8Go DDR3 Corsair PC12800 - nVidia GTX 580
Ubuntu 10.04 Gnome - kernel 2.6.35

Hors ligne

#1154 Le 23/11/2011, à 17:09

Phyllinux

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

Bonjour,
Après avoir tout essayé dans un peu tous les sens, je me retourne vers la communauté pour essayer de régler mon problème :
J'ai un petit conky tout simple qui utilise Yahoo Quotes pour récupérer les cours de bourse et de places boursières.
Tout tourne sans problème. La difficulté que je rencontre est au niveau de la mise en forme :
Voici le résultat :
slection002c.png

Uploaded with ImageShack.us

Comme vous pouvez le voir, les données ne sont pas alignées les unes en dessous des autres, ce qui rend la lecture désagréable.
Cela vient du fait que Yahoo Quotes, au vu du code de la valeur que je veux faire afficher (ex : ^FCHI qui est le code pour le CAC 40) attribue un nom jusqu'à 8 caractères.
Or, toutes les appellations n'ont pas ces 8 caractères (CAC 40 = 6 caractères)
Du coup, impossible de faire aligner les données correctement.
A noter, la seule ligne que je rentre à la main, c'est celle des titres (Nom, Cotation, Variation, etc...) - Ligne 15 du script

Je vous poste ci dessous les éléments :
Le script :

#!/bin/bash
# stock-conky.sh by livibetter 2010-08-17
# Usage: stock-conky.sh <chart_small|chart_large|header|quote> [ticker symbol] [x y]

case "$1" in
  chart_small)
    wget -q "http://ichart.finance.yahoo.com/t?s=$2&lang=en-US&region=US" -O "/tmp/yahoo.finance.$2.png"
    echo "\${image /tmp/yahoo.finance.$2.png -p $3,$4 -s 192x96 -f 60}"
    ;;
  chart_large)
    wget -q "http://ichart.finance.yahoo.com/b?s=$2&lang=en-US&region=US" -O "/tmp/yahoo.finance.$2.png"
    echo "\${image /tmp/yahoo.finance.$2.png -p $3,$4 -s 512x288 -f 60}"
    ;;
  header)
    echo 'Nom      Cotation      Variation       +Haut    +Bas   Maxi an  Mini an'
    ;;
  quote)
    wget -q "http://download.finance.yahoo.com/d/quotes.csv?s=$2&f=sl1d1t1c1jhgkp2n&e=.csv" -O - | awk -F "\"*,\"*" '{
ticker = substr(substr($11, 0, length($11) - 1), 1, 8);
printf("%-8s %7.2f ", ticker, $2);

if ($5 > 0)
  printf("${color green}")
else if ($5 < 0)
  printf("${color red}")
else
  printf("${color black}");

if ($5 == "N/A")
  printf("    ${color}N/A (   N/A) ")
else
  printf("%7.2f (%5.2f%%)$color ", $5, $10)

#if ($6 == "N/A")
  #printf("    N/A ")
#else
  #printf("%7.2f ", $6);

if ($7 == "N/A")
  printf("    N/A ")
else
  printf("%7.2f ", $7);

if ($8 == "N/A")
  printf("    N/A ")
else
  printf("%7.2f ", $8);

#if ($9 == "N/A")
  #printf("%10s ", "N/A")
#else
  #printf("%10d ", $9);

#printf("%10s %7s", $3, $4);

#le plus haut depuis 52 semaines
printf("%7.2f ", $9)

#le plus bas depuis 52 semaines
printf("%7.2f ", $6)

printf("\n");
}'
    ;;
esac

Le conkyrc

 # -- Conky settings -- #
    background yes
    update_interval 1

    cpu_avg_samples 2
    net_avg_samples 2

    override_utf8_locale yes

    double_buffer yes
    no_buffers yes

    text_buffer_size 2048
    imlib_cache_size 0

    # -- Window specifications -- #

    own_window yes
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    #own_window_type normal 

    border_inner_margin 0
    border_outer_margin 0

    minimum_size 760
    maximum_width 1000
    

    alignment tl
    gap_x 75
    gap_y 40

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

    # -- Text settings -- #
    use_xft yes
    xftfont MaiandraGD:style=bold:size=10
    xftalpha 0.4

    uppercase no

    #default_color 8b8b8b
    default_color ffffff

         TEXT
${voffset 288}${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh header}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^FCHI}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^FTSE}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^GDAXI}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^N225}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^GSPC}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh quote ^IXIC}
${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh chart_large ^FCHI 0 0}${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh chart_small ^FTSE 520 0}${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh chart_small ^GDAXI 520 104}${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh chart_small ^DJI 520 208}${execpi 60 /home/gilles/scripts/Bourse/stock-conky.sh chart_small ^N225 520 312}

Je n'utilise pas toutes les possibilités du script pour l'affichage que je demande. D'où les # placés devant certaines lignes.
Pour ceux qui veulent mieux comprendre à quoi correspond le script, voir ICI

Merci de votre aide pour me permettre de finaliser enfin mon conky smile


The ship is sinking normally...

Hors ligne

#1155 Le 23/11/2011, à 17:59

chepioq

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

Une solution est d'utiliser les "goto" dans ton conky-bourse.
J'ai essayé avec :

         TEXT
${voffset 288}${execpi 60 /home/dominique/Documents/stock-conky.sh header}
${goto 20}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^FCHI}
${goto 18}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^FTSE}
${goto 30}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^GDAXI}
${goto 24}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^N225}
${goto 15}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^GSPC}
${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^IXIC}

C'est aligné (du moins les chiffres...)

Mais la meilleure solution serai de le faire directement dans ton script, mais je ne suis pas assez calé pour cela.

Dernière modification par chepioq (Le 23/11/2011, à 18:02)


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

Hors ligne

#1156 Le 23/11/2011, à 18:21

Phyllinux

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

Effectivement, l'idée d'utiliser goto en prenant comme base la ligne qui a le plus de caractères (NASDAQ en l’occurrence) est une solution palliative à laquelle je n'avais pas pensé sad
Merci pour cette piste smile


The ship is sinking normally...

Hors ligne

#1157 Le 23/11/2011, à 18:22

Jehova

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

salut à tous, je me suis un peu amuser avec un script tout fait pour y mettre les couleur d'ubuntu smile

capture1j.png

Uploaded with ImageShack.us

Avec le bureau tout entier ça fait ceci :

capturepzo.th.png

Uploaded with ImageShack.us

Comme vous pouvez le voir le couleur sont adaptées au fond d'écran ! smile

Le rc :

background yes 
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 10 
gap_y 30 
minimum_size 190 450 
maximum_width 190 
own_window yes 
own_window_type override 
own_window_transparent yes 
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below 
border_inner_margin 0 
border_outer_margin 0 
alignment tr 

draw_shades no 
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 EF5A29
color2 FFCC00
color3 FFCC00
color4 CC0000
color5 DDDDDD
color6 AAAAAA
color7 888888

lua_load ~/.chemin/lenomdu.lua 
lua_draw_hook_post main 

#${voffset 35} 
#${goto 95}${color3}${font ubuntu:size=32}${time %e}${color1}${voffset 0}${offset -60}${font ubuntu:size=10}${time %A} 
#${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font} 
# 
#${voffset 70} 
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager 
 
TEXT 
${voffset 35} 
${goto 95}${color4}${font ubuntu:size=22}${time %e}${color1}${offset -50}${font ubuntu:size=10}${time %A} 
${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font} 

${voffset 80} 
${goto 90}${font Ubuntu:size=7,weight:bold}${color}CPU 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${top name 1}${alignr}${top cpu 1}% 
${goto 90}${font Ubuntu:size=7,weight:normal}${color6}${top name 2}${alignr}${top cpu 2}% 
${goto 90}${font Ubuntu:size=7,weight:normal}${color7}${top name 3}${alignr}${top cpu 3}% 
${goto 90}${cpugraph 10,100 666666 666666} 
${goto 90}${voffset -10}${font Ubuntu:size=7,weight:normal}${color}${threads} process 

${voffset 20} 
${goto 90}${font Ubuntu:size=7,weight:bold}${color}MEM 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${top_mem name 1}${alignr}${top_mem mem 1}% 
${goto 90}${font Ubuntu:size=7,weight:normal}${color6}${top_mem name 2}${alignr}${top_mem mem 2}% 
${goto 90}${font Ubuntu:size=7,weight:normal}${color7}${top_mem name 3}${alignr}${top_mem mem 3}% 

${voffset 15} 
${goto 90}${font Ubuntu:size=7,weight:bold}${color}DISKS 

${goto 90}${diskiograph 30,100 666666 666666}${voffset -30} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color}used: ${fs_used /dev/sda3} /dev/sda  
${goto 90}${font Ubuntu:size=7,weight:normal}${color}used: ${fs_used /home} /home 

${voffset 10} 
${goto 70}${font Ubuntu:size=18,weight:bold}${color7}NET${alignr}${color2}${font Ubuntu:size=7,weight:bold}${color1}${if_up eth0}eth ${addr eth0} ${endif}${if_up wlan0}wifi ${addr wlan0}${endif} 
${goto 90}${font Ubuntu:size=7,weight:bold}${color}open ports: ${alignr}${color2}${tcp_portmon 1 65535 count}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}${offset 10}IP${alignr}DPORT 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  0}${alignr 1}${tcp_portmon 1 65535 rport  0} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  1}${alignr 1}${tcp_portmon 1 65535 rport  1} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  2}${alignr 1}${tcp_portmon 1 65535 rport  2} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  3}${alignr 1}${tcp_portmon 1 65535 rport  3} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  4}${alignr 1}${tcp_portmon 1 65535 rport  4} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  5}${alignr 1}${tcp_portmon 1 65535 rport  5} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  6}${alignr 1}${tcp_portmon 1 65535 rport  6} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  7}${alignr 1}${tcp_portmon 1 65535 rport  7} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  8}${alignr 1}${tcp_portmon 1 65535 rport  8} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip  9}${alignr 1}${tcp_portmon 1 65535 rport  9} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13} 
${goto 90}${font Ubuntu:size=7,weight:normal}${color5}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}

et le lua :

--==============================================================================
--                            conky_orange.lua
--
--  author  : SLK
--  version : v2011062101
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=110,                         y=80,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0xFF9900,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFF9900,      graph_fg_alpha=0.8,
    txt_radius=34,
    txt_weight=0,                  txt_size=15.0,
    txt_fg_colour=0xFF9900,        txt_fg_alpha=0.7,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFF9900, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=110,                         y=80,
    graph_radius=57,
    graph_thickness=2,5,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0x990000,      graph_bg_alpha=0.2,
    graph_fg_colour=0x990000,      graph_fg_alpha=0.5,
    txt_radius=70,
    txt_weight=0,                  txt_size=15.0,
    txt_fg_colour=0x990000,        txt_fg_alpha=0.9,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0x990000, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=110,                         y=80,
    graph_radius=50,
    graph_thickness=2,5,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.4,
    txt_radius=40,
    txt_weight=0,                  txt_size=15.0,
    txt_fg_colour=0xFFFF00,        txt_fg_alpha=0.8,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
    },
}

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=85,                          y=200,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0x990000,      graph_bg_alpha=0.4,
    graph_fg_colour=0x990000,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFF00,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xFF9900,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0x990000, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0x990000,    caption_fg_alpha=0.5,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=85,                          y=200,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0x990000,      graph_bg_alpha=0.5,
    graph_fg_colour=0x990000,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFF00,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xFF9900,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0x990000, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0x990000,    caption_fg_alpha=0.5,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=85,                          y=300,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xFF9900,      graph_bg_alpha=0.5,
    graph_fg_colour=0xFF9900,      graph_fg_alpha=0.5,
    hand_fg_colour=0x990000,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xFFFF00,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFF9900, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFF9900,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/home/',                     max_value=100,
    x=85,                          y=380,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.5,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.5,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x990000,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
    caption='/home',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFF00,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/dev/sda',                max_value=100,
    x=85,                          y=380,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.5,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.5,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0x990000,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.5,
    caption='/dev/sda',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFF00,    caption_fg_alpha=0.5,
},
}

-------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

-------------------------------------------------------------------------------
--                                                              draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = (value % max_value)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = (graph_unit_angle * i) - graph_unit_thickness

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", 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_colour, txt_fg_alpha));
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
    cairo_show_text (display, value);
    cairo_stroke (display);
end

-------------------------------------------------------------------------------
--                                                              draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_start_angle = data['graph_start_angle']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
    local graph_end_angle = (max_value * graph_unit_angle) % 360

    -- background ring
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = value % (max_value + 1)
    local start_arc = 0
    local stop_arc = 0
    local i = 1
    while i <= val do
        start_arc = (graph_unit_angle * i) - graph_unit_thickness
        stop_arc = (graph_unit_angle * i)
        cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
        cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = start_arc

    -- hand
    start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
    stop_arc = (graph_unit_angle * val)
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
    cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
    cairo_stroke(display)

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = graph_end_angle / graduation_unit_angle
        local i = 0
        while i < nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
            stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
            cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "ubuntu", 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_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)

    -- caption
    local caption = data['caption']
    local caption_weight, caption_size = data['caption_weight'], data['caption_size']
    local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
    local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
    cairo_set_font_size (display, caption_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
    cairo_move_to (display, x + tox + 5, y + toy + 1)
    -- bad hack but not enough time !
    if graph_start_angle < 105 then
        cairo_move_to (display, x + tox - 30, y + toy + 1)
    end
    cairo_show_text (display, caption)
    cairo_stroke (display)
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end
    
    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[i])
    end
end

-------------------------------------------------------------------------------
--                                                               go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
    local function load_gauge_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_gauge_ring(display, data, value)
    end
    
    for i in pairs(gauge) do
        load_gauge_rings(display, gauge[i])
    end
end

-------------------------------------------------------------------------------
--                                                                         MAIN
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
        go_clock_rings(display)
        go_gauge_rings(display)
    end
    
    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

Par contre, vous l'aurez remarqué : je n'utilise que 664kb sur mon disque dur sda, alors que mon homme bouffe presque 50% big_smile !
En fait, je suis en dualboot, et j'aimerais que le conky affiche l'utilisation du disque entier et non pas seulement du home de la partition Ubuntu, auriez vous une idée de ce qu'il faut que je modifie ?

Dernière modification par Jehova (Le 23/11/2011, à 19:57)

Hors ligne

#1158 Le 23/11/2011, à 20:55

Jehova

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

Bonsoir, c'est re-moi
Dites, je m'intéresse pas mal à celui-ci de conky...
http://pix.toile-libre.org/?img=1315374902.png
Savez-vous qui donc l'à mis au point et où pourrais-je trouver les scripts ?
Merci smile

Hors ligne

#1159 Le 23/11/2011, à 22:14

nordinatueur

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

C'est dans ce topic !


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

Hors ligne

#1160 Le 24/11/2011, à 08:00

Jehova

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

Oui, oui merci, mais j'ai fouiller 20 pages déja sans trouvé et sans être sur de ne pas être passé à côté ^^
Bon, je me débrouille, ok tongue

Hors ligne

#1161 Le 24/11/2011, à 08:14

Phyllinux

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

Jehova a écrit :

Bonsoir, c'est re-moi
Dites, je m'intéresse pas mal à celui-ci de conky...
http://pix.toile-libre.org/?img=1315374902.png
Savez-vous qui donc l'à mis au point et où pourrais-je trouver les scripts ?
Merci smile

Les conkys qui t'intéressent ont été réalisés par carpediem

Tu peux le contacter directement via Profil carpediem


The ship is sinking normally...

Hors ligne

#1162 Le 24/11/2011, à 08:32

Jehova

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

Merci Phyll

Hors ligne

#1163 Le 24/11/2011, à 10:43

Phyllinux

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

chepioq a écrit :

Une solution est d'utiliser les "goto" dans ton conky-bourse.
J'ai essayé avec :

         TEXT
${voffset 288}${execpi 60 /home/dominique/Documents/stock-conky.sh header}
${goto 20}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^FCHI}
${goto 18}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^FTSE}
${goto 30}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^GDAXI}
${goto 24}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^N225}
${goto 15}${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^GSPC}
${execpi 60 /home/dominique/Documents/stock-conky.sh quote ^IXIC}

C'est aligné (du moins les chiffres...)

Mais la meilleure solution serai de le faire directement dans ton script, mais je ne suis pas assez calé pour cela.

J'ai enfin trouvé la solution, qui était en fait toute simple. Il suffit d'utiliser une police à chasse fixe, et là, pas de goto, pas de manipulation.
En l’occurrence, j'ai utilisé Courier 10 Pitch, et voilà le résultat :
slection003v.th.png

Uploaded with ImageShack.us
smile


The ship is sinking normally...

Hors ligne

#1164 Le 27/11/2011, à 14:42

shamen456

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

Bonjour à Tous...

voici une version "black" du conkyarc
arcblack

petit changement par rapport à la version "gold", la couleur de certains textes change en fonction de la valeur (seuil d'alerte) (T° CPU, %CPU, Top CPU, Top Mem et capacité dsque...)

et voila ce que ca donne sur un desktop de couleur sombre (sur un fond clair ca ne donne pas aussi bien...)
desktop 111127

l'archive est dispo ici


Bon conky a Tous...

Hors ligne

#1165 Le 27/11/2011, à 20:41

torpedolos

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

shamen456 a écrit :

Bonjour à Tous...

voici une version "black" du conkyarc
http://fc05.deviantart.net/fs70/i/2011/ … 4hg16f.png

petit changement par rapport à la version "gold", la couleur de certains textes change en fonction de la valeur (seuil d'alerte) (T° CPU, %CPU, Top CPU, Top Mem et capacité dsque...)

et voila ce que ca donne sur un desktop de couleur sombre (sur un fond clair ca ne donne pas aussi bien...)
http://fc01.deviantart.net/fs70/i/2011/ … 4hg1ot.png

l'archive est dispo ici


Bon conky a Tous...

Wow, super classe !
Tu peux mettre un lien vers une image plus grande ?
Et sinon, qu'est-ce qu'il y a dans "lego star wars" ? ;-)


"La convivialité, c'est pas quand un tuto est bien fait, c'est quand il n'y a pas besoin de tuto !" (moi)
"Je ne suis pas un numéro de hotline !" (ploum) http://ploum.net/post/36-je-ne-suis-pas … geek-libre
"Knowledge belongs to everyone" (Kevin Mitnick)
https://bugs.launchpad.net/ubuntu/+bug/1

Hors ligne

#1166 Le 28/11/2011, à 07:17

shamen456

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

@ Torpedolos : pour une image plus grande tu peux allez voir sur ma page chez deviant-art (Shamen Deviant Art)

dans "Lego Starwars", c'est juste un lien vers le repertoire du jeu PC - j'ai pas pris le temps de creer un lanceur dans la barre et si je fais un lien uniquement vers le .exe, wine deconne...donc j'ouvre le repertoire pour lancer le jeu...

Hors ligne

#1167 Le 28/11/2011, à 09:18

Levi59

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

Pour un lanceur vers un exe wine, il faut mettre comme lien :
wine '/chemin/vers/le/fichier.exe'

Hors ligne

#1168 Le 01/12/2011, à 23:41

kervadort

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

Bonjour à tous

Je n'ai pas la prétention, ni l'envie de faire un conky avec plein d'image et de décoration, j'ai juste besoin d'en faire un efficace et léger.

J'ai donc fait ça pour l'instant,

conkyl.jpg

mais j'ai deux petits soucis :

comment faire pour ne pas afficher les infos LAN quand je suis connecté en wifi et inversement ?

Comment faire afficher un graph bar sous les infos des /dev/sd(a/b/c/d/e)X comme je le fais pour SDA ?

Regardez bien mon conky, tout se passe dans ce seul fichier (sauf l'ip web et ping)

# conky configuration

# set to yes if you want Conky to be forked in the background
background yes

disable_auto_reload no
#maximum_width 1200

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

default_bar_size 100 10

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
#xftfont Bitstream Vera Sans Mono:size=8
xftfont Terminus:size=8

# Text alpha when using Xft
xftalpha 0.8

# Print everything to console?
# out_to_console no

# mail spool
#mail_spool $MAIL

# Update interval in seconds
update_interval .5

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
#own_window_type desktop
own_window_type override
own_window_transparent yes
#own_window_hints yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 10 5

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
#stippled_borders 8

# border margins
border_inner_margin 4

# border width
border_width 1

#param pour hddtemp
hddtemp_host 127.0.0.1
hddtemp_port 7634

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment top_middle
#alignment bottom_left
#alignment bottom_middle


# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 0

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 1

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes


# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right


# stuff after 'TEXT' will be formatted on screen

TEXT
#******************************************************
#******************************************************
#



${color}${sysname} ${kernel}
$color${time %a, %e %B %G} ${font Ubuntu:bold:size=16}
${time %H:%M:%S}${font}
$hr
#Ce qui concerne le processeur
${color #0033FF}CPU1 : ${goto 50}${cpugraph cpu1 10,100}
${color #3333FF}CPU2 : ${goto 50}${cpugraph cpu2 10,100}
${color #6633FF}CPU3 : ${goto 50}${cpugraph cpu3 10,100}
${color #0066FF}CPU4 : ${goto 50}${cpugraph cpu4 10,100}
${color #3366FF}CPU5 : ${goto 50}${cpugraph cpu5 10,100}
${color #6666FF}CPU6 : ${goto 50}${cpugraph cpu6 10,100}
${color #0099FF}CPU7 : ${goto 50}${cpugraph cpu7 10,100}
${color #3399FF}CPU8 : ${goto 50}${cpugraph cpu8 10,100}
${color #ddaa00}Highest CPU:
${color lightgrey}  ${top name 1}${top_mem cpu 1}
${color lightgrey}  ${top name 2}${top cpu 2}
${color lightgrey}  ${top name 3}${top cpu 3}
${color lightgrey}  ${top name 4}${top cpu 4}
${color lightgrey}  ${top name 5}${top cpu 5}
${color #ddaa00}Highest MEM:
${color lightgrey}  ${top_mem name 1}${top_mem mem 1}
${color lightgrey}  ${top_mem name 2}${top_mem mem 2}
${color lightgrey}  ${top_mem name 3}${top_mem mem 3}
${color lightgrey}  ${top_mem name 4}${top_mem mem 4}
${color lightgrey}  ${top_mem name 5}${top_mem mem 5}
${color}$hr
#Ce qui concerne l'espace occupé
MEM: ${color}  ${goto 50}${membar 3,70} $memperc%
SWAP: ${color} ${goto 50}${swapbar 3,70} $swapperc%
ROOT: ${color} ${goto 50}${fs_bar 3,70 /} ${fs_used_perc /}%
HOME: ${color} ${goto 50}${fs_bar 3,70 /home} ${fs_used_perc /home}%
SDA ${goto 50}${diskiograph sda 20,100 c0c0c0 c0c0c0}
${voffset -20}${color #ddaa00}${hddtemp}°C
${color}${execi 1 df -h | grep "/dev/sd" | awk 'BEGIN { print "" } { printf "%s\t%s\t %s\n", $1, $5, $4 }'}
$hr
#Ce qui concerne le réseau
${color slate grey}IP Pas :${goto 60}${color lightgrey}${gw_ip}
${color slate grey}IP Web :${goto 60}${color lightgrey}${execi 600 ~/.conky/ip.sh}
${color slate grey}Ping Google = ${color lightgrey}${execi 60 ~/.conky/ping.sh} ms

${color}LAN: ${goto 50}${addr eth0}
${color #ff0000}Up: ${goto 50}$color${upspeedgraph eth0 20,100 ff0000 ff0000}
${voffset -20}${color #ff0000}${upspeed eth0}${color}
${color #00ff00}Down: ${goto 50}$color${downspeedgraph eth0 20,100 00ff00 00ff00}
${voffset -20}${color #00ff00}${downspeed eth0}${color}

${color}WAN: ${goto 50}${addr wlan0}
SSID: ${goto 50}${wireless_essid wlan0}
Mac AP:${goto 50}${wireless_ap wlan0}
${color #ff0000}Up: ${goto 50}$color${upspeedgraph wlan0 20,100 FF0000 ff0000}
${voffset -20}${color #ff0000}${upspeed wlan0}${color}
${color #00ff00}Down: ${goto 50}$color${downspeedgraph wlan0 20,100 00FF00 00ff00}
${voffset -20}${color #00ff00}${downspeed wlan0}${color}
${color #ddaa00}Signal ${goto 50}${wireless_link_bar wlan0}${color}
$hr
BAT : ${goto 50}${color #FF9933}${battery_bar 10,100}
${color}${battery_short}${goto 52}${battery_time}
$hr

Le problème que j'ai est que eth0 et wlan0 sont actives en permanence, donc impossible d'utiliser le "if_up" pour faire disparaître l'un ou l'autre.
Je cherchais à détecter la présence ou l'absence d'ip, mais je n'ai pas trouvé la formule.

On oublie les scripts lua (après plusieurs tentative, pas moyen de le faire fonctionner)  donc du bash à la rigueur.

Pour le /dev/sd(a/b/c/d/e...)X j'ai essayé de mettre :

${color}${execpi 1 df -h | grep "/dev/sd" | awk 'BEGIN { print ""}{ printf "%s  ", $1 }{ printf "${diskiograph %s 20,50 c0c0c0 c0c0c0}\n", $1 }{ printf "${voffset -20} %s\n", $5 }'}

Qui fonctionne, mais alors en plus de récupérer un espace (interligne plus important) avec le graph du SDA au dessus, tout se décale vers la gauche de 60/70 pixels ... et je trouve pas pourquoi sad

Merci d'avance

Dernière modification par kervadort (Le 01/12/2011, à 23:43)

Hors ligne

#1169 Le 06/12/2011, à 02:18

syruss2009

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

Salut,désolé de casser votre discussion, mais j'ai besoin d'aide car mon coky déconne un peu. On a comme l'impression qu'il est au dessus du bureau. il ne s'intègre pas complètement. Merci d'avance de votre aide.
1323134248.png

Le fichier de conky:

#==============================================================================
#                               conkyrc_orange
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
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 10
gap_y 30
minimum_size 190 450
maximum_width 190
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr

draw_shades no
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 DDDDDD
color2 AAAAAA
color3 888888
color4 EF5A29

lua_load ~/.conky/conky_orange.lua
lua_draw_hook_post main

#${voffset 35}
#${goto 95}${color3}${font ubuntu:size=32}${time %e}${color1}${voffset 0}${offset -60}${font ubuntu:size=10}${time %A}
#${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font}
#
#${voffset 70}


TEXT
${voffset 35}
${goto 95}${color4}${font ubuntu:size=22}${time %e}${color1}${offset -50}${font ubuntu:size=10}${time %A}
${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font}

${voffset 80}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}CPU
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${top name 1}${alignr}${top cpu 1}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color2}${top name 2}${alignr}${top cpu 2}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color3}${top name 3}${alignr}${top cpu 3}%
${goto 90}${cpugraph 10,100 666666 666666}
${goto 90}${voffset -10}${font Ubuntu:size=7,weight:normal}${color}${threads} process 

${voffset 20}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}MEM
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${top_mem name 1}${alignr}${top_mem mem 1}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color2}${top_mem name 2}${alignr}${top_mem mem 2}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color3}${top_mem name 3}${alignr}${top_mem mem 3}%

${voffset 15}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}DISKS

${goto 90}${diskiograph 30,100 666666 666666}${voffset -30}
${goto 90}${font Ubuntu:size=7,weight:normal}${color}free: ${fs_free /media/MEDIA} /MEDIA
${goto 90}${font Ubuntu:size=7,weight:normal}${color}free: ${fs_free /} /

${voffset 10}
${goto 70}${font Ubuntu:size=18,weight:bold}${color3}NET${alignr}${color2}${font Ubuntu:size=7,weight:bold}${color1}${if_up eth0}eth ${addr eth0} ${endif}${if_up wlan0}wifi ${addr wlan0}${endif}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}open ports: ${alignr}${color2}${tcp_portmon 1 65535 count}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}${offset 10}IP${alignr}DPORT
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  0}${alignr 1}${tcp_portmon 1 65535 rport  0}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  1}${alignr 1}${tcp_portmon 1 65535 rport  1}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  2}${alignr 1}${tcp_portmon 1 65535 rport  2}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  3}${alignr 1}${tcp_portmon 1 65535 rport  3}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  4}${alignr 1}${tcp_portmon 1 65535 rport  4}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  5}${alignr 1}${tcp_portmon 1 65535 rport  5}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  6}${alignr 1}${tcp_portmon 1 65535 rport  6}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  7}${alignr 1}${tcp_portmon 1 65535 rport  7}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  8}${alignr 1}${tcp_portmon 1 65535 rport  8}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip  9}${alignr 1}${tcp_portmon 1 65535 rport  9}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13}
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}

Jeune linuxien gabonais
UBUNTU Lucid Lynx
Gateway LT20 Netbook/ Double cœur Intel® Atom™ processor N280-Intel® Atom™ processor N270 - 1 GB of DDR2 -160 GB hard disk drive

Hors ligne

#1170 Le 06/12/2011, à 03:04

sickboy

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

kervadort a écrit :

Comment faire afficher un graph bar sous les infos des /dev/sd(a/b/c/d/e)X comme je le fais pour SDA ?

avec par exemple ceci ça ne fontionne pas ? si c'est bien le genre de graph que tu recherches

SDA ${diskiograph sda 20,100 000000 000000}
SDA5 ${diskiograph /dev/sda5 20,100 000000 000000}
SDA3 ${diskiograph /dev/sda3 20,100 000000 000000}

par exemple pour ton conky :

MEM: ${goto 50}${membar 3,70} $memperc%
SWAP: ${goto 50}${swapbar 3,70} $swapperc%
ROOT: ${goto 50}${fs_bar 3,70 /} ${fs_used_perc /}%
HOME: ${goto 50}${fs_bar 3,70 /home} ${fs_used_perc /home}%
SDA ${goto 50}${diskiograph sda 20,100 c0c0c0 c0c0c0}
${voffset -20}${color #ddaa00}${hddtemp}°C $color
${voffset 5}
SDA5
libre : ${fs_free /dev/sda5}  total : ${fs_size /dev/sda5}  occupé :${fs_used_perc /dev/sda5}%
${goto 50}${diskiograph /dev/sda5 20,100 c0c0c0 c0c0c0}
${voffset 5}
SDA3
libre : ${fs_free /dev/sda3}  total : ${fs_size /dev/sda3}  occupé :${fs_used_perc /dev/sda3}%
${goto 50}${diskiograph /dev/sda3 20,100 c0c0c0 c0c0c0}

ou simplement pour la meme bar que ton home

MEM: ${goto 50}${membar 3,70} $memperc%
SWAP: ${goto 50}${swapbar 3,70} $swapperc%
ROOT: ${goto 50}${fs_bar 3,70 /} ${fs_used_perc /}%
HOME: ${goto 50}${fs_bar 3,70 /home} ${fs_used_perc /home}%
SDA ${goto 50}${diskiograph sda 20,100 000000 000000}
${voffset -20}${color #ddaa00}${hddtemp}°C $color
${voffset 5}
SDA5: ${goto 50}${fs_bar 3,70 /dev/sda5} ${fs_used_perc /dev/sda5}%
SDA3: ${goto 50}${fs_bar 3,70 /dev/sda3} ${fs_used_perc /dev/sda3}%

en remplaçant /dev/sda3 ou 5 par tes points de montage, par exemple chez moi c'est :

libre : ${fs_free /media/sdb1}  total : ${fs_size /media/sdb1}  occupé :${fs_used_perc /media/sdb1}%
${goto 50}${diskiograph /dev/sdb1 20,100 c0c0c0 c0c0c0}

ou

SDB1: ${goto 50}${fs_bar 3,70 /media/sdb1} ${fs_used_perc /media/sdb1}%

Dernière modification par sickboy (Le 06/12/2011, à 04:00)


Xubuntu Voyager 11.10 / Linux Mint Debian Edition
AMD Phenom II x4 945
Asus Nvidia GeForce GT 440
Asus Xonar Essence STX

Hors ligne

#1171 Le 06/12/2011, à 06:58

Didier-T

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

syruss2009 a écrit :

Salut,désolé de casser votre discussion, mais j'ai besoin d'aide car mon coky déconne un peu. On a comme l'impression qu'il est au dessus du bureau. il ne s'intègre pas complètement. Merci d'avance de votre aide.

Bonjour,
à priori, ton code conky est Ok, du moins pour les paramètre de fenêtre.
Tu devrais regarder au niveau de lanceur, et y ajouter une temporisation pour laisser le temps à ton affichage de s’initialiser complètement.
Essaye avec un sleep de 10 dans un premier temps, en général sa suffit.

Hors ligne

#1172 Le 06/12/2011, à 10:23

syruss2009

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

Didier-T a écrit :
syruss2009 a écrit :

Salut,désolé de casser votre discussion, mais j'ai besoin d'aide car mon coky déconne un peu. On a comme l'impression qu'il est au dessus du bureau. il ne s'intègre pas complètement. Merci d'avance de votre aide.

Bonjour,
à priori, ton code conky est Ok, du moins pour les paramètre de fenêtre.
Tu devrais regarder au niveau de lanceur, et y ajouter une temporisation pour laisser le temps à ton affichage de s’initialiser complètement.
Essaye avec un sleep de 10 dans un premier temps, en général sa suffit.


Merci de m'avoir répondu, j'ai script pour la temporisation pour laisser le temps à mon affichage de s’initialiser:

#!/bin/bash
sleep 20
conky -c /home/alex/.conkyrc_orange 

Voici ce qui m'arrive souvent avec conky, carrément au dessus des fenêtres :
1323163229.png


Jeune linuxien gabonais
UBUNTU Lucid Lynx
Gateway LT20 Netbook/ Double cœur Intel® Atom™ processor N280-Intel® Atom™ processor N270 - 1 GB of DDR2 -160 GB hard disk drive

Hors ligne

#1173 Le 06/12/2011, à 10:44

willcoyote

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

Salut
remplace

own_window_type override

par

own_window_type normal

Hors ligne

#1174 Le 06/12/2011, à 11:08

syruss2009

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

willcoyote a écrit :

Salut
remplace

own_window_type override

par

own_window_type normal

Ok will, j'essaye toute suite merci


Jeune linuxien gabonais
UBUNTU Lucid Lynx
Gateway LT20 Netbook/ Double cœur Intel® Atom™ processor N280-Intel® Atom™ processor N270 - 1 GB of DDR2 -160 GB hard disk drive

Hors ligne

#1175 Le 06/12/2011, à 11:17

syruss2009

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

Je viens d'essayer, c'est comme si conky "flotte" au dessus du bureau, pour l'instant, il ne se met plus au dessus des fenêtres. sad


Jeune linuxien gabonais
UBUNTU Lucid Lynx
Gateway LT20 Netbook/ Double cœur Intel® Atom™ processor N280-Intel® Atom™ processor N270 - 1 GB of DDR2 -160 GB hard disk drive

Hors ligne