Nos conky 2017

Bureaux,conky et autres personnalisations esthétiques.
Avatar du membre
Dickanom
Messages : 257
Enregistré le : mer. 17 août 2016 18:32
Localisation : Villeneuve-Loubet (06)

Re: Nos conky 2017

Message par Dickanom »

Dernier message de la page précédente :

Salut a tous

mon petit conky de débutent rien a voir avec les vôtres messieurs.. ;)

Image
Linux Mint 21.1 Cinnamon 64 Bit
Pc Dell Optiplex 7040 sff
Ram:8 Go - Graphique: Intel HD 530
Ssd 500 Go x2 - Noyau Linux 5.15.0-56

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

Re: Nos conky 2017

Message par zeb »

Salut ;)
Sympa le bureau (même le conky "simple") ;)
Tu peux poster ton bureau aussi dans le sujet "nos bureaux" 8-)

Avatar du membre
Arizona
Messages : 9
Enregistré le : mar. 31 janv. 2017 11:49

Re: Nos conky 2017

Message par Arizona »

Voici pour mon conky. C'est une compilation de plusieurs conkys trouvés sur le net que j'ai modifié à mon goût et ma configuration. Il est compatible conky 1.10 ( je n'ai pas testé sur d'autres versions ).

Image

conkyrc :

Code : Tout sélectionner

-- ----------------------------------
--
-- Conky météo + informations système
-- Arizona
-- 15/01/2017
-- 
-- ----------------------------------

conky.config = {

-- ---------------------------------- Paramètres de la fenêtre
    background = true,       
    own_window = true,
    own_window_type = 'override',
    own_window_transparent = true,
    own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
    double_buffer = true,
    no_buffers = true,
    text_buffer_size = 2048,

-- ---------------------------------- Position de la fenêtre
    gap_x = 10,
    gap_y = 70,
    alignment = 'top_right',
    minimum_width = 510,
    minimum_height = 920,
    maximum_width = 560,
    border_inner_margin = 0,
    border_outer_margin= 0,

-- ---------------------------------- Police
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    draw_graph_borders = false,
    override_utf8_locale = true,
    use_xft = true,
    font = 'GE Inspira:size=9',
    xftalpha = 0.5,
    uppercase = false,

-- ---------------------------------- Divers
    update_interval = 1,                
    cpu_avg_samples = 2,                
    net_avg_samples = 2,                
    temperature_unit = celsius,         

-- ---------------------------------- Variables couleurs
    color1 = '#000000',
    color2 = '#FFFFFF',
    color3 = '#888888',
    color4 = '#666666',
    color5 = '#4a8cea',
    color6 = '#0030d5',
    color7 = '#2850ED',
    color8 = '#2750d7',
    color9 = '#EDB48C',
    color0 = '#FC7303',

-- ---------------------------------- Chargement des differents modules
lua_load = '~/.conky/conkyrc.lua',
lua_draw_hook_pre = 'main',

};

conky.text = [[

# ####################### Lancement du script de récupération des infos météo
${execi 600 bash $HOME/1_accuweather/1_accuweather -f2015 -h2015}

# ####################### Affichage des informations système
${voffset 30}${goto 10}${font Ubuntu :size=9}${texeci 86400 lsb_release -sd}
${goto 10}${font Ubuntu :size=9}$sysname $kernel $machine
${goto 10}Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
${goto 10}ATI Radeon HD 7970
${image $HOME/.conky/logo_header.png -p 40,15 -s 46x43}

# ####################### Affichage de la date et de l'heure
${voffset -120}${goto 460}${color3}${font ubuntu :size=40:weight=bold}${time %e}${color2}${offset -140}${font ubuntu :size=20:weight=bold}${time %A}
${goto 430}${color2}${voffset -2}${font ubuntu :size=10:weight=bold}${time %b}${voffset -2} ${color3}${font ubuntu :size=12:weight=bold}${time %Y}${font}
${voffset -105}${goto 150}${color5}${font ubuntu :size=40:weight=bold}${time %H:%M:%S}

# ####################### Affichage météo de l'heure + levée et coucher soleil et lune
${goto 20}${voffset -5}${font Helvetica LT Std :size=10:style=bold}${color2}Chambray Les Tours
${image $HOME/1_accuweather/hourly_2015/hourly_1.png -p 10,170 -s 167x100}
${image $HOME/1_accuweather/Forecast_Images_2015/1.png -p 260,155 -s 120x65}
${image $HOME/1_accuweather/Forecast_Images_2015/33.png -p 410,155 -s 120x65}
${voffset 10}${goto 260}${font Helvetica LT Std :size=6:style=bold}Lever du soleil ${execi 90 sed -n '23p' $HOME/1_accuweather/curr_cond} h
${voffset -10}${goto 410}${font Helvetica LT Std :size=6:style=bold}Lever de la lune ${execi 90 sed -n '26p' $HOME/1_accuweather/curr_cond} h
${voffset 10}${goto 260}${font Helvetica LT Std :size=6:style=bold}Coucher du soleil ${execi 90 sed -n '24p' $HOME/1_accuweather/curr_cond} h
${voffset -10}${goto 410}${font Helvetica LT Std :size=6:style=bold}Coucher de la lune ${execi 90 sed -n '25p' $HOME/1_accuweather/curr_cond} h
${voffset 10}${goto 260}${font Helvetica LT Std :size=6:style=bold}Durée ${execi 90 sed -n '16p' $HOME/1_accuweather/curr_cond}
${voffset -10}${goto 410}${font Helvetica LT Std :size=6:style=bold}Durée ${execi 90 sed -n '20p' $HOME/1_accuweather/curr_cond}

# ####################### Affichage température + vent
${voffset -25}${goto 20}${font Helvetica LT Std :style=bold:size=8}Température : ${execi 90 sed -n '2p' $HOME/1_accuweather/curr_cond} °C (${execi 90 sed -n '3p' $HOME/1_accuweather/curr_cond} °C )
${goto 20}${font Helvetica LT Std :style=bold:size=8}Vent : ${execi 90 sed -n '5p' $HOME/1_accuweather/curr_cond}  ${execi 90 sed -n '6p' $HOME/1_accuweather/curr_cond}

# ####################### Affichage météo à 5 jours
${voffset 7}${goto 60}${execi 90 sed -n '1p' $HOME/1_accuweather/first_days}
${voffset -13}${goto 160}${execi 90 sed -n '6p' $HOME/1_accuweather/first_days}
${voffset -13}${goto 260}${execi 90 sed -n '11p' $HOME/1_accuweather/first_days}
${voffset -13}${goto 360}${execi 90 sed -n '16p' $HOME/1_accuweather/first_days}
${voffset -13}${goto 460}${execi 90 sed -n '21p' $HOME/1_accuweather/first_days}
${image $HOME/1_accuweather/forecast_2015/forecast_1.png -p 40,325 -s 83x50}
${image $HOME/1_accuweather/forecast_2015/forecast_2.png -p 150,325 -s 83x50}
${image $HOME/1_accuweather/forecast_2015/forecast_3.png -p 260,325 -s 83x50}
${image $HOME/1_accuweather/forecast_2015/forecast_4.png -p 350,325 -s 83x50}
${image $HOME/1_accuweather/forecast_2015/forecast_5.png -p 450,325 -s 83x50}
${voffset -6}${goto 50}${color2}${font Ubuntu :size=10:weight=bold}${execi 90 sed -n '4p' $HOME/1_accuweather/first_days}°C / ${execi 90 sed -n '3p' $HOME/1_accuweather/first_days}°C
${voffset -13}${goto 160}${color2}${font Ubuntu :size=10:weight=bold}${execi 90 sed -n '9p' $HOME/1_accuweather/first_days}°C / ${execi 90 sed -n '8p' $HOME/1_accuweather/first_days}°C
${voffset -13}${goto 270}${color2}${font Ubuntu :size=10:weight=bold}${execi 90 sed -n '14p' $HOME/1_accuweather/first_days}°C / ${execi 90 sed -n '13p' $HOME/1_accuweather/first_days}°C
${voffset -13}${goto 370}${color2}${font Ubuntu :size=10:weight=bold}${execi 90 sed -n '19p' $HOME/1_accuweather/first_days}°C / ${execi 90 sed -n '18p' $HOME/1_accuweather/first_days}°C
${voffset -13}${goto 470}${color2}${font Ubuntu :size=10:weight=bold}${execi 90 sed -n '24p' $HOME/1_accuweather/first_days}°C / ${execi 90 sed -n '23p' $HOME/1_accuweather/first_days}°C

# ####################### Affichage informations cpu
${image ~/.conky/img/cpu.png -p 10,410}
${voffset -10}${goto 60}${font Ubuntu :size=10:weight=bold}CPU
${voffset 20}${goto 10}${font}Avg use: ${font Ubuntu :size=10}${cpu cpu0}%
${goto 10}Freq: ${font Ubuntu :size=10}${freq_g} Ghz
${goto 10}${font}Temp: ${font Ubuntu :size=10}${acpitemp} °C
${goto 10}Fan: ${exec sensors | grep 'fan2' | cut -c25-28}tr/mn
${voffset -95}${goto 300}${color5}${font Ubuntu :size=8:weight=bold}${top name 1}${alignr}${top cpu 1}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top name 2}${alignr}${top cpu 2}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top name 3}${alignr}${top cpu 3}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top name 4}${alignr}${top cpu 4}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top name 5}${alignr}${top cpu 5}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top name 6}${alignr}${top cpu 6}%
${goto 300}${font Ubuntu :size=8:weight=normal}${processes} process 

# ####################### Affichage informations mémoire
${image ~/.conky/img/ram.png -p 10,520}
${voffset 5}${goto 60}${font Ubuntu :size=10:weight=bold}Mémoire
${voffset 25}${goto 10}${font Ubuntu :size=10}${color2}Utilisation             ${mem} ---- ${memperc} %
${goto 10}${font Ubuntu :size=10}${color2}Mémoire totale   ${memmax}
${voffset -70}${goto 300}${color5}${font Ubuntu :size=8:weight=bold}${top_mem name 1}${alignr}${top_mem mem 1}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top_mem name 2}${alignr}${top_mem mem 2}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top_mem name 3}${alignr}${top_mem mem 3}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top_mem name 4}${alignr}${top_mem mem 4}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top_mem name 5}${alignr}${top_mem mem 5}%
${goto 300}${color2}${font Ubuntu :size=8:weight=normal}${top_mem name 6}${alignr}${top_mem mem 6}%

# ####################### Affichage informations température système et ventilos
${image ~/.conky/img/system.png -p 10,610}
${voffset -5}${goto 60}${font Ubuntu :size=10:weight=bold}Système
${voffset 25}${goto 10}${font Ubuntu :size=10}${color2}Temp. Carte mère              ${hwmon 0 temp 1} °C
${goto 10}${font Ubuntu :size=10}${color2}Temp. Carte graphique    ${hwmon 1 temp 1} °C
${voffset -70}${goto 300}Fan1 :${color2}${alignr}${exec sensors | grep 'fan1' | cut -c25-28}tr/mn
${goto 300}Fan2 :${color2}${alignr}${exec sensors | grep 'fan3' | cut -c25-28}tr/mn
${goto 300}Fan3 :${color2}${alignr}${exec sensors | grep 'fan4' | cut -c25-28}tr/mn
${goto 300}Fan3 :${color2}${alignr}${exec sensors | grep 'fan5' | cut -c25-28}tr/mn

# ####################### Affichage informations disques durs + température
${image ~/.conky/img/files.png -p 10,700}
${voffset 6}${goto 60}${font Ubuntu :size=10:weight=bold}Partition  /
${voffset -12}${goto 180}${font Ubuntu :size=10:weight=bold}${fs_used /}/${fs_free /}
${goto 245}${execi 60 hddtemp -n /dev/sda} °C
${image ~/.conky/img/files.png -p 290,700}
${voffset -42}${goto 340}${font Ubuntu :size=10:weight=bold}Données
${voffset -12}${goto 460}${font Ubuntu :size=10:weight=bold}${fs_used /media/arizona/Donnees}/${fs_free /media/arizona/Donnees}
${goto 525}${execi 60 hddtemp -n /dev/sdb} °C
${image ~/.conky/img/files.png -p 10,810}
${voffset 63}${goto 60}${font Ubuntu :size=10:weight=bold}HDD Save
${voffset -12}${goto 180}${font Ubuntu :size=10:weight=bold}${if_mounted /media/arizona/DiskSauvegarde}${fs_used /media/arizona/DiskSauvegarde}/${fs_free /media/arizona/DiskSauvegarde}${else}${goto 240}unmt${endif}

# ####################### Affichage informations internet
${image ~/.conky/img/networklow.png -p 290,810}
${voffset -40}${goto 340}${font Ubuntu :size=10:weight=bold}Internet
${voffset 30}${goto 290}${font Ubuntu :size=10:weight=bold}${color2}IP Locale : ${alignr}${addr eno1}
${goto 290}${font Ubuntu :size=10:weight=bold}${color2}IP Publique : ${alignr}${texeci 600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${goto 290}Download : ${downspeed eno1}  /  Upload : ${upspeed eno1}
##${font Ubuntu:size=10:weight=bold}${color9}INTERNET ${hr 2}
##${voffset 20}${color0}IP Publique : ${alignr}${color9}${texeci 600 wget http://checkip.dyndns.org -O - -o /dev/null | ##cut -d : -f 2 | cut -d \< -f 1}

# ####################### Affichage du premier cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 0 560 140}

# ####################### Affichage du second cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 150 560 140}

# ####################### Affichage du troisième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 300 560 100}

# ####################### Affichage du quatrième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 410 560 100}

# ####################### Affichage du cinquième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 520 560 80}

# ####################### Affichage du sixième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 610 560 80}

# ####################### Affichage du septième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 700 280 100}

# ####################### Affichage du huitième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 280 700 280 100}

# ####################### Affichage du neuvième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 810 280 100}

# ####################### Affichage du dixième cadre
${lua fDrawImage $HOME/1_accuweather/fond/base.png 280 810 280 100}

]];
conkyrc.lua

Code : Tout sélectionner

require 'cairo'
home = os.getenv ('HOME')

gauge = {
{
    name='fs_used_perc',            arg='/',                  max_value=100,
    x=140,                          y=845,
    graph_radius=110,
    graph_thickness=5,
    graph_start_angle=-60,
    graph_unit_angle=1.2,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x1793d0,       hand_fg_alpha=1.0,
    txt_radius=120,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x1793d0,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',            arg='/media/arizona/Donnees',                  max_value=100,
    x=420,                          y=840,
    graph_radius=110,
    graph_thickness=5,
    graph_start_angle=-60,
    graph_unit_angle=1.2,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x1793d0,       hand_fg_alpha=1.0,
    txt_radius=120,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x1793d0,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',            arg='/media/arizona/DiskSauvegarde',                  max_value=100,
    x=140,                          y=950,
    graph_radius=110,
    graph_thickness=5,
    graph_start_angle=-60,
    graph_unit_angle=1.2,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x1793d0,       hand_fg_alpha=1.0,
    txt_radius=120,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x1793d0,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
}


--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)

   path = string.gsub(path, "~", home)
   path = string.gsub(path, "$HOME", home)

   local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
   
   local function fDrawImage(path,x,y,w,h,arc)
      x=x+(w/2)
      y=y+(h/2)
      local img =  cairo_image_surface_create_from_png(path)
      local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)

      local cr = cairo_create (cs)
      cairo_translate (cr, x, y)

      if arc then
         cairo_rotate (cr, arc)
      end

      cairo_scale (cr, w/w_img, h/h_img)
      cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
      cairo_paint (cr)
      cairo_destroy(cr)
      cairo_surface_destroy (img)
   end
   fDrawImage(path,x,y,w,h,arc)
   cairo_surface_destroy(cs)
   return ""
end

-------------------------------------------------------------------------------
--                                                                 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_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_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_gauge_rings(display)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)

end
@+
Kernel: 4.4.0-53-generic x86_64 (64 bit) Desktop: MATE 1.16.1 Distro: Linux Mint 18.1 Serena
Mobo: ASUSTeK model: Z87-DELUXE
CPU: Quad core Intel Core i7-4770K
Graphics: Card: Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X]

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

Re: Nos conky 2017

Message par Cyrrus »

Merci beaucoup

Répondre