[Conky] Vos .conkyrc !

Ce qui ne concerne ni le forum ni des problèmes
Avatar de l’utilisateur
onyx67
Elfe
Messages : 766
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Vos .conkyrc !

Message par onyx67 »

super!
juste une question: le script python se nomme cal.py si j'ai bien compris?
En tous cas merci, je vais l'essayer prochainement :)
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
onyx67
Elfe
Messages : 766
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Vos .conkyrc !

Message par onyx67 »

Script cal.py de chipster que j'ai personnalisé un peu:

Image

@ chipster> Encore merci :chinois:
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
banditblue
Elfe
Messages : 591
Inscription : dim. 10 janv. 2010, 10:19

Re: [Conky] Vos .conkyrc !

Message par banditblue »

onyx67 a écrit :super!
juste une question: le script python se nomme cal.py si j'ai bien compris?
En tous cas merci, je vais l'essayer prochainement :)
pas mal j'aime bien le style
mais dit moi ? est il comme le fait la barre des menus !! disparait-il ? ou est il pertinament sur l'ecran ?
La connaîssance n'a pas de limite.
Mais sa valeur, est d'autant plus grande, une fois partagé


Pc fixe --- MSI MPG Z490 Gaming Edge WiFi, I9-9900Kf, RTX3070Ti, 64Go DDR4, SSD 1Tera nvme gen4 Samsung 980 pro, SSD 1Tera WD Blacksn850X,3HDD 5Tera
Eeepc Asus 1015pem --- Intel Atom N550 Dual-core 1.5Ghz / DD 1Tera 7200rpm / Ram 2Go

Screenshot + Les Conky ===> http://forums.archlinux.fr/post85405.html#p85405
Avatar de l’utilisateur
onyx67
Elfe
Messages : 766
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Vos .conkyrc !

Message par onyx67 »

@ banditblue > non il reste en permanence, c'est un vrai conky.
J'ai un calendrier dans la barre de tâche et en fait je pourrai l'afficher en permanence, mais serai toujours en avant plan. Et puis bon, je trouve celui-ci bien plus classe...
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
claudef
Chu Ko Nu
Messages : 428
Inscription : mer. 07 sept. 2011, 18:06
Localisation : Fourmies Nord

Re: [Conky] Vos .conkyrc !

Message par claudef »

Je mets mon conky pour banditblue http://imageshack.us/photo/my-images/72 ... t1gbh.png/ salut claude
Je finirai bien par y arriver un jour prochain quoique,
Avatar de l’utilisateur
onyx67
Elfe
Messages : 766
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Vos .conkyrc !

Message par onyx67 »

@ claudef >> Intéressant; tu pourrais poster ton .conkyrc STP?
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
claudef
Chu Ko Nu
Messages : 428
Inscription : mer. 07 sept. 2011, 18:06
Localisation : Fourmies Nord

Re: [Conky] Vos .conkyrc !

Message par claudef »

voila le .conkyrc comme tu vois le point de départ est un conkyrc russe que j'ai mitonné à ma sauce

Code : Tout sélectionner

                    #conky от Sega 
#благодарим форум!!! http://forum.ubuntu.ru/index.php?topic=63273.msg1055254#msg1055254 
                    #http://forum.ubuntu.ru/index.php?topic=754 

# -- Paramètres Conky -- # 
    background no # Pour que conky tourne ou pas en arrière plan 
    update_interval 1 # Indique que Conky doit se mettre à jour toutes les 1 secondes

 # Nombre de processeurs pris en compte: ici 2 
    cpu_avg_samples 2 
    net_avg_samples 2 

    override_utf8_locale yes # Pour avoir les caractères accentués 

# Indique que le double buffer est activé, ce qui évite le clignotement gênant 
    double_buffer yes 
    no_buffers yes 

    text_buffer_size 2048 
    imlib_cache_size 0 

    # -- Position et taille de la fenêtre -- # 

    own_window yes 
    own_window_type override 
    own_window_transparent yes # Conky dessine une fenêtre transparente 
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below 

    border_inner_margin 0 
    border_outer_margin 0 

    minimum_size 310 1000 
    maximum_width 280 1000 # largeur de la fenêtre 
    
    alignment tr # alignement de la fenêtre, ici en haut à droite 
    gap_x 20     # Ecart avec le bord x=gauche ou droit 
    gap_y 20     # Ecart avec le bord y=gauche ou droit 

    # -- Graphics settings -- # 
    draw_shades no 
    draw_outline no 
    draw_borders no # Affiche ou pas les bordures de la fenêtre 
    draw_graph_borders yes 

    # -- Text settings -- # 
    use_xft yes 
    # Police et taille utilisée si rien d'autre précisék             
    xftfont URW Chancery L:style=Medium Italic:pixelsize=24 
    xftalpha 0.9 # Opacité de la police xft 

    uppercase no 

    #couleur par défaut 8b8b8b 
    default_color 000000
#lua 

lua_draw_hook_post main 

##-- Options Lua --## 

lua_load ~/.conky/sega/cercles.lua 
lua_load ~/.conky/sega/aiguilles.lua 

lua_draw_hook_pre clock_rings 
         
TEXT 
# Image 
${image ~/.conky/myconky_v2/transparent.png  -s 250x20 -p 10,-1} 
# indication du kernel 
   ${voffset -15}Kernel$alignr$Kernel 
# Démarrage 
   Démarré depuis:$alignr$uptime 
# Utilisé dans racine 
   /${fs_used}      sur$alignr ${fs_size /} 
# Occupation dans Home 
   /home ${fs_used /home/}   sur$alignr ${fs_size /home/} 
# alignr 
   ${time %A %d %B %Y} 
${voffset -15}   $hr 
######### Affichage en % du CPU et RAM ###############
${goto 145}${voffset 227}${color 040afd}  ${cpu cpu1}%  CPU 
${goto 145}${voffset -15}  ${cpu cpu2}% 
${goto 110}${voffset 5}${color fd0404}Ram:${offset 10}$memperc % 
# 
# Ligne séparative ####################### 
${color black}   $hr       
# Processus en cours 
   ${voffset -15}Processus en cours:${alignr}$running_processes/ $processes 
# Fréquence du processus 
   Fréquence:${alignr}${freq_g}GHz 
# Température du processus 
   Temp du process:$alignr${exec /usr/bin/acpi -t|awk '{print $4" "}'}° 
# Température de la carte graphique 
   Temp. CG${alignr}${execi 30 nvidia-settings -q gpucoretemp | grep '):' | sed 's/\./°/g' | awk '{print $4}'} 
# 
#########processus en cours###### 
#trait# 
${voffset -15}   $hr 
# 
# Utilisation du CPU 
${voffset -15}   Utilisation CPU 
   Noms     ${alignr} PID ${alignr} CPU% 
    ${top name 1}${alignr}${top pid 1}${alignr} ${top cpu 1}    
    ${top name 2}${alignr}${top pid 2}${alignr} ${top cpu 2}   
    ${top name 3}${alignr}${top pid 3}${alignr}   ${top cpu 3} 
#trait# 
${voffset -5}   $hr
le ~/.conky/sega/cercles.lua

Code : Tout sélectionner

settings_table = {
	{
		name='cpu',
		arg='cpu0', -- "arg" Est l'argument du type de statistique,
		max=100,    -- occupation de l'anneau (ici 100%)
		bg_colour=0x040afd,-- "bg_colour" est la couleur de fond de l'anneau.
		bg_alpha=0.2,      -- "bg_alpha" est la valeur de transparence du fond de l'anneau.
		fg_colour=0x040afd,-- est la couleur de la partie indicateur de l'anneau.
		fg_alpha=1, -- "fg_alpha" Est la valeur de transparence de la partie d'indicateur de l'anneau.
		x=140, y=330, -- "x" and "y" Sont les coordonnées de x et y du centre de l'anneau, par rapport            au coin supérieur gauche de la fenêtre de Conky.
		radius=105, -- "radius" Est le rayon de l'anneau.
		thickness=4, -- "thickness" Est l'épaisseur de l'anneau, centré autour du rayon.
		start_angle=180, -- "start_angle" Est l'angle commençant de l'anneau, dans les degrés, dans le sens des aiguilles d'une montre en partant de midi. La valeur peut être positive ou négative.
		end_angle=500-- "end_angle" Est l'angle de fin de l'anneau, dans les degrés, dans le sens des aiguilles d'une montre en partant de midi. La valeur peut être positive ou négative, mais doit être plus grand (par exemple plus dans le sens des aiguilles d'une montre) que l'angle de départ.angle de fin 
	},
{
		name='cpu',
		arg='cpu1', 
		max=100,   
		bg_colour=0x040afd,
		bg_alpha=0.2,    
		fg_colour=0x040afd,--couleur indicateur
		fg_alpha=1,
		x=140, y=330, 
		radius=120, 
		thickness=4,
		start_angle=180,
		end_angle=500
	},
	{
		name='memperc',
		arg='',
		max=100,
		bg_colour=0x040afd,
		bg_alpha=0.2,
		fg_colour=0xfd0404,
		fg_alpha=0.6,
		x=140, y=330,
		radius=135,
		thickness=4,
		start_angle=180,
		end_angle=535
	},
	}



clock_r=100



clock_x=140
clock_y=330



clock_colour=0x040afd
clock_alpha=0.9



show_seconds=true

require 'cairo'

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

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

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

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

	

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

	

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

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

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

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

	

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

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

	

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

	cairo_set_line_width(cr,3)
	cairo_stroke(cr)

	

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

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

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

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

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

		draw_ring(cr,pct,pt)
	end

	

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

	local cr=cairo_create(cs)	

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

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

	draw_clock_hands(cr,clock_x,clock_y)
end
et le ~/.conky/sega/aiguilles.lua

Code : Tout sélectionner

require 'cairo' 

clock_h = { 
    { 
    name='time',                   arg='%H',                    max_value=12, 
    x=140,                         y=330, 
    graph_radius=55, 
    graph_thickness=7, 
    graph_unit_angle=30,           
    graph_unit_thickness=28, 
    graph_bg_colour=0x040afd,      
    graph_bg_alpha=0, 
    graph_fg_colour=0x040afd,      
    graph_fg_alpha=0, 
    txt_radius=115, 
    txt_weight=1,                  
    txt_size=10, 
    txt_fg_colour=0x040afd,        
    txt_fg_alpha=0, 
    graduation_radius=75, 
    graduation_thickness=12,        
    graduation_mark_thickness=2, 
    graduation_unit_angle=90, 
    graduation_fg_colour=0x040afd, 
    graduation_fg_alpha=1, 
    }, 
} 
clock_m = { 
    { 
    name='time',                   arg='%M',                    max_value=60, 
    x=140,                         y=330, 
    graph_radius=45, 
    graph_thickness=6, 
    graph_unit_angle=6,            
    graph_unit_thickness=4, 
    graph_bg_colour=0x040afd,      
    graph_bg_alpha=0, 
    graph_fg_colour=0x040afd,      
    graph_fg_alpha=0, 
    txt_radius=130, 
    txt_weight=1,                  
    txt_size=10, 
    txt_fg_colour=0x040afd,        
    txt_fg_alpha=0, 
    graduation_radius=75, 
    graduation_thickness=7,        
    graduation_mark_thickness=2, 
    graduation_unit_angle=30, 
    graduation_fg_colour=0x040afd, 
    graduation_fg_alpha=1, 
    }, 
} 
clock_s = { 
    { 
    name='time',                   arg='%S',                    max_value=60, 
    x=140,                         y=330,--x et y du centre 
    graph_radius=80,       --diamètre  du trait 
    graph_thickness=3,     --épaisseur du trait 
    graph_unit_angle=6,            
    graph_unit_thickness=2, 
    graph_bg_colour=0x040afd,      
    graph_bg_alpha=0.1, 
    graph_fg_colour=0x040afd,      
    graph_fg_alpha=0.6, 
    txt_radius=92,        --diamètre du texte 
    txt_weight=1,                  
    txt_size=10,           --taille du texte 
    txt_fg_colour=0x040afd,--couleur du texte          
    txt_fg_alpha=1,        -- transparence du texte 
    graduation_radius=140, 
    graduation_thickness=3,        
    graduation_mark_thickness=1, 
    graduation_unit_angle=6, 
    graduation_fg_colour=0x040afd, 
    graduation_fg_alpha=0, 
    }, 
    } 
------------------------------------------------------------------------------- 
--                                                                 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 
-- 
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 
-- dispays 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 
-- dispays 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 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) 
    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 

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

------------------------------------------------------------------------------- 
--                                                                                                                                        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) 
        
        
    end 

end
voila claude
Je finirai bien par y arriver un jour prochain quoique,
Avatar de l’utilisateur
onyx67
Elfe
Messages : 766
Inscription : dim. 06 nov. 2011, 18:12
Localisation : Alsace

Re: [Conky] Vos .conkyrc !

Message par onyx67 »

Merci :)
"La complication est un effet de la simplicité mal acquise"

Intel i5-2320; Nvidia GeForce GT 520; ATA Hitachi 2To; ArchLinux-KDE
Avatar de l’utilisateur
z3bra
archer
Messages : 127
Inscription : jeu. 28 juin 2012, 23:17

Re: [Conky] Vos .conkyrc !

Message par z3bra »

Salut salut ! Réinstallation de mon laptop oblige, je me paye un tout nouveau bureau dont voici le conky:

Image

L'archive et le « guide d'install » sont dispos ICI
archlinux - 2bwm [ blog | git ]
Avatar de l’utilisateur
fran
yeomen
Messages : 234
Inscription : lun. 27 déc. 2010, 18:47
Localisation : breizh

Re: [Conky] Vos .conkyrc !

Message par fran »

mes conky actuels
Image

Code : Tout sélectionner

######################
# - Conky settings - #
######################
update_interval 1
no_buffers yes
uppercase no
double_buffer yes

#####################
# - Text settings - #
#####################
background yes
use_xft yes
xftalpha 0.8
override_utf8_locale yes

#############################
# - Window specifications - #
#############################
own_window yes
#own_window_colour black
own_window_type override
own_window_transparent yes
#own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager
#own_window_argb_visual yes
#own_window_argb_value 100

alignment center
gap_x 600
gap_y 700

#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 8
border_margin 4
border_width 10
draw_graph_borders no

#default_color 000000
#default_shade_color white
#default_outline_color black

TEXT
${color f5f5f5}${font English:size=50}${offset 25}Archlinux ${font DejaVuSans:size=13}$kernel${color f5f5f5}${voffset -35}${font English:size=70}${alignr}${time %H :}${font English:size=70}${time %M}${font English:size=30} ${time %S}
${hr 3}
${color f5f5f5}${offset 25}${font English:size=30}cpu${font DejaVuSans:size=13}  ${freq}MHz ${acpitemp}°C ${font English:size=30}${voffset -12}${goto 250}core ${font DejaVuSans:size=13}$cpu% ${cpubar 5,50}${font English:size=30}${alignr}${time %A  %d  %B  %Y}
${voffset -18}
${color f5f5f5}${offset 25}${font English:size=30}ram${font DejaVuSans:size=13}$memperc% ${membar 5,50}${font English:size=30}${voffset -12}${goto 220}swp${font DejaVuSans:size=13}$swapperc% ${swapbar 5,50}${font English:size=30}${voffset -12}${goto 390}root${color f5f5f5} ${font DejaVuSans:size=13}${fs_used_perc /}% ${fs_bar 5,50 /}${font English:size=30}${voffset -12}${goto 600}home${color f5f5f5} ${font DejaVuSans:size=13}${fs_used_perc /home/franck}% ${fs_bar 5,50 /home/franck}${color f5f5f5}${font English:size=30}${voffset -12}${goto 820}stock${color f5f5f5} ${font DejaVuSans:size=13}${fs_used_perc /mnt/stockage}% ${fs_bar 5,50 /mnt/stockage}${color f5f5f5}${font English:size=30}${voffset -12}${goto 1030}nas${color f5f5f5} ${font DejaVuSans:size=13}${fs_used_perc /mnt/Disknas}% ${fs_bar 5,50 /mnt/Disknas} 

Code : Tout sélectionner

######################
# - Conky settings - #
######################
update_interval 1
no_buffers yes
uppercase no
double_buffer yes

#####################
# - Text settings - #
#####################
background yes
use_xft yes
xftfont :size=50
xftalpha 0.8
override_utf8_locale yes

#############################
# - Window specifications - #
#############################
own_window yes
#own_window_colour black
own_window_type override
own_window_transparent yes
#own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager
#own_window_argb_visual yes
#own_window_argb_value 100

alignment bottom-left
gap_x 50
gap_y 5

#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 8
border_margin 4
border_width 10
draw_graph_borders no

#default_color 000000
#default_shade_color white
#default_outline_color black

TEXT
${color f5f5f5}${font English:size=30}${goto 50}Music${mpd_status}
${hr 3}
${voffset -30}
${color f5f5f5}${goto 30}${mpd_artist}-${mpd_title}







HP elitebook 2570P : arch xfce
intelNuc 10 :arch kde
Avatar de l’utilisateur
acid_cloridrix
archer
Messages : 117
Inscription : mer. 17 oct. 2012, 15:18

Re: [Conky] Vos .conkyrc !

Message par acid_cloridrix »

Un simple conky en ligne écrit pour un écran de largeur 1600, truffé de conditions, goto, etc... je n'aime pas voir un conky se ballader d'un côté à l'autre :)

Image

Le conkyrc décortiqué et commenté:

Code : Tout sélectionner

background yes
use_xft yes
xftfont open sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window_colour 222222					# couleur de fond
own_window yes
own_window_transparent no					# pas de transparence
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
own_window_argb_visual yes
minimum_size 1591 1
maximum_width 1591
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# default_shade_color e0dfde
# default_outline_color e0dfde
alignment bottom
gap_x 4
gap_y -20 # 0
no_buffers yes
uppercase min
cpu_avg_samples 2
override_utf8_locale yes

# couleur par défaut :

default_color a6a6a6		# gris

# couleur de températures + utilisations CPU :

color2 1eff00					# vert				=> à point
color3 ed7f10					# orange			=> bien cuit
color4 ff0000					# rouge			=> crâmé

# faire ressortir certains résultats :

color5 fdff52					# jaune			=> noyau, freq CPU, RAM, SWAP, utilisation disque/partition
color6 58deff					# bleu clair		=> uptime, down, up
color7 ffffff						# blanc			=> symboles
color1 00aad4					# bleu				=> résultats en %

## Synthaxe: ${police} ${couleur} ${position x} ${position y} ${commande}
## (!) : Fonction "alignc" isolée (uptime, swap, down, up)

TEXT
### Informations Noyau Linux:
${font StyleBats:size=14}${color7}${voffset -4}i\
${font}${color}${goto 27}${voffset -3,5}${sysname}\
${color5}${goto 61}${kernel}\
${color}${goto 141}${voffset -1,5}|\
${voffset 1,5}\
#
### Système en route depuis:
${font StyleBats:size=14}${color7}${goto 153}q
## (!)
${font}${color6}${alignc 593}${voffset -22,5}${uptime}
${color}${goto 245}${voffset -16,5}|\
${voffset 1,5}\
#
### Fréquence:
${font StyleBats:size=14}${color7}${goto 257}A\
${font}${color5}${goto 279}${voffset -3,5}${freq_g cpu} GHz\
${goto 330}${color}${voffset -1,5}|\
${voffset 1,5}\
#
### Informations coeur 1:
## Conditions température (couleur):
${if_match ${hwmon 1 temp 2}>79}${color4}${else}\
${if_match ${hwmon 1 temp 2}>70}${color3}${else}\
${if_match ${hwmon 1 temp 2}>-1}${color2}\
${endif}${endif}${endif}\
${goto 342}${hwmon 1 temp 2} °C\
${font Open Sans:bold:size=8}${color}${goto 375}@${font}\
## Conditions utilisation CPU (couleur):
${if_match ${cpu cpu1}>79}${color4}${else}\
${if_match ${cpu cpu1}>55}${color3}${else}\
${if_match ${cpu cpu1}>-1}${color1}\
${endif}${endif}${endif}\
## Conditions utilisation CPU (position):
${if_match ${cpu cpu1}>9}${goto 391}${else}\
${if_match ${cpu cpu1}>-1}${goto 394}\
${endif}${endif}\
${cpu cpu1} %\
## Barre d'utilisation CPU:
${color}${goto 421}${voffset 2,5}${cpubar cpu1 6,60}\
${goto 490}${voffset -3,5}|\
${voffset 1,5}\
#
### Informations coeur 2:
## Conditions température (couleur):
${if_match ${hwmon 1 temp 3}>79}${color4}${else}\
${if_match ${hwmon 1 temp 3}>70}${color3}${else}\
${if_match ${hwmon 1 temp 3}>-1}${color2}\
${endif}${endif}${endif}\
${goto 502}${hwmon 1 temp 3} °C\
${font Open Sans:bold:size=8}${color}${goto 535}@${font}\
## Conditions utilisation CPU (couleur):
${if_match ${cpu cpu2}>79}${color4}${else}\
${if_match ${cpu cpu2}>55}${color3}${else}\
${if_match ${cpu cpu2}>-1}${color1}\
${endif}${endif}${endif}\
## Conditions utilisation CPU (position):
${if_match ${cpu cpu2}>9}${goto 551}${else}\
${if_match ${cpu cpu2}>-1}${goto 554}\
${endif}${endif}\
${cpu cpu2} %\
## Barre d'utilisation CPU:
${color}${goto 581}${voffset 2,5}${cpubar cpu2 6,60}\
${goto 650}${voffset -3,5}|\
${voffset 1,5}\
#
### Mémoire RAM:
${font StyleBats:size=14}${color7}${goto 662}g\
${font}${color5}${goto 685}${voffset -3,5}${mem}${color} / ${memmax}\
${font Open Sans:bold:size=8}${goto 778}@${font}\
## Centrage de la valeur entre @ et la barre (décimales):
${if_match ${memperc}>9}${goto 794}${else}\
${if_match ${memperc}>-1}${goto 797}\
${endif}${endif}\
${color1}${memperc} %${color}\
## Barre d'utilisation RAM:
${goto 824}${voffset 2,5}${membar 6,60}\
${goto 893}${voffset -3,5}|\
${voffset 1,5}\
#
### Mémoire SWAP:
${font StyleBats:size=14}${color7}${goto 905}j
## (!)
${font}${color5}${alignc -146}${voffset -22,5}${swap}
${color}${goto 968}${voffset -15,5}/ ${swapmax}\
${font Open Sans:bold:size=8}${goto 1021}@${font}\
## Conditions centrage de la valeur:
${if_match ${swapperc}>9}${goto 1037}${else}\
${if_match ${swapperc}>-1}${goto 1040}\
${endif}${endif}\
${color1}${swapperc} %${color}\
## Barre d'utilsation SWAP:
${goto 1067}${voffset 2,5}${swapbar 6,60}\
${goto 1136}${voffset -3,5}|\
${voffset 1,5}\
#
### Réception internet:
${goto 1149}${font PizzaDude Bullets:size=12}${goto 1148}${color7}T
## (!)
${font}${color6}${alignc -396}${voffset -18}${downspeedf wlan0} kb/s
${color}${goto 1228}${voffset -16}|\
${voffset 1,5}\
#
### Envoi internet:
${goto 1240}${font PizzaDude Bullets:size=12}${goto 1240}${color7}N
## (!)
${font}${color6}${alignc -488}${voffset -18}${upspeedf wlan0} kb/s
${color}${goto 1320}${voffset -16}|\
${voffset 2,5}\
#
### Occupation partition ArchLinux:
${font KG Fractions:size=14}${color7}${goto 1332}9\
${font}${color5}${goto 1353}${voffset -3,5}${fs_used /home}${color} / ${fs_size /root}\
${font Open Sans:bold:size=8}${goto 1447}@${font}\
${color1}${goto 1463}${fs_used_perc /home} %${color}\
## Barre d'utilisation partition:
${goto 1496}${voffset 2,5}${fs_bar 6,60 /home}\
${goto 1566}${voffset -2,0}\
## Conditions température (couleur):
${if_match ${hddtemp /dev/sda}>47}${color4}${else}\
${if_match ${hddtemp /dev/sda}>45}${color3}${else}\
${if_match ${hddtemp /dev/sda}>01}${color2}\
${endif}${endif}${endif}\
${hddtemp /dev/sda} °C
#
### Calé en bas :
${voffset -45}
Laisser une marge de 18 pxs (avec openbox) en bas de l'écran pour qu'il soit toujours visible.
HP 500-261ef full 64 bits - Samsung 24 pcs 1920x1080 px
CPU : 4 X Intel ® Core™ i5-4440 @ 3.1 Ghz | RAM : 8 Go
HD : Western Digital 1 To | CG Radeon R5 235


Multiboot UEFI : ArchLinux - Windows 7 - Autre base Debian

Openbox (LXqt)
KDE Plasma 5
Sylvain07
Daikyu
Messages : 80
Inscription : jeu. 13 févr. 2014, 18:34

Re: [Conky] Vos .conkyrc !

Message par Sylvain07 »

Image

mon conky est basé sur celui là : http://www.tux-planet.fr/le-theme-conky-lua-2011/

:) j'ai fait quelques modifications à mon goût.

pour le faire fonctionner il faut installer le paquet conky-luadisponible sur AUR

il y a 2 fichiers : le conkyrc et un fichier Lua : clock_rings.lua

détail du conkyrc :

Code : Tout sélectionner

# 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


# Window specifications #

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

border_inner_margin 0
border_outer_margin 0

minimum_size 310 310
maximum_width 310

alignment tr
gap_x 35
gap_y 0

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

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5

uppercase no

temperature_unit celsius


default_color FFFFFF

# Lua Load  #
lua_load ~/conky/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT

${color 0066FF}${font eufm10:size=25}${nodename}
${font eufm10:size=15}${kernel}




${voffset -70}${color F6FE01}${font eufm10:size=30}${alignr}${time %A}${font}${voffset 36}${alignr 120}${color 0066FF}${font caviar dreams:bold:size=50}${time %e}${font}
${goto 120}${color FFFFFF}${voffset 5}${color FFFFFF}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font caviar dreams:size=20}${time %Y}${font}${color 820C0C}${hr}

${font caviar dreams:bold:size=8}${color F6FE01}${goto 30}${voffset 35}${cpu cpu0}%${color 75B8FB}${font caviar dreams:bold:size=10}${goto 90}${cpu cpu1}%${color FA2626}${goto 150}${cpu cpu2}%
${color 0033FF}${font caviar dreams:size=8}${goto 30}${voffset -5}CPU

${color 0033FF}${goto 25}${voffset 30}RAM${goto 55}${memperc}%${goto 135}Dwn${goto 165}${downspeed wlp0s16f4u3}
${color FA0000}${goto 20}Swap${goto 55}${swapperc}%${goto 135}Up${goto 165}${upspeed wlp0s16f4u3}
Détail de clock_rings.lua

Code : Tout sélectionner

--[[
Clock Rings by Linux Mint (2011) reEdited by despot77

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/clock_rings.lua
    lua_draw_hook_pre clock_rings
    
Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v Mint-lua -- reEdit despot77 (18.02.2011)
]]

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0x0066FF,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=80, y=200,
        -- "radius" is the radius of the ring.
        radius=50,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x0066FF,
        fg_alpha=0.4,
        x=80, y=200,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x0066FF,
        fg_alpha=0.6,
        x=80, y=200,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x0066FF,
        fg_alpha=0.8,
        x=80, y=200,
        radius=70,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0x0066FF,
        fg_alpha=1,
        x=80, y=200,
        radius=76,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0066FF,
        fg_alpha=0.8,
        x=30, y=335,
        radius=25,
        thickness=5,
        start_angle=-180,
        end_angle=90
    },
{
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x75B8FB,
        fg_alpha=0.8,
        x=90, y=335,
        radius=25,
        thickness=5,
        start_angle=-180,
        end_angle=90
    },
{
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFA2626,
        fg_alpha=0.8,
        x=150, y=335,
        radius=25,
        thickness=5,
        start_angle=-180,
        end_angle=90
    },

    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0066FF,
        fg_alpha=0.8,
        x=60, y=420,
        radius=50,
        thickness=4,
        start_angle=-90,
        end_angle=90
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff3300,
        fg_alpha=0.8,
        x=60, y=420,
        radius=45,
        thickness=4,
        start_angle=-90,
        end_angle=90
    },
        {
        name='downspeedf',
        arg='wlp0s16f4u3',
        max=500,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0066FF,
        fg_alpha=0.8,
        x=170, y=420,
        radius=50,
        thickness=4,
        start_angle=-90,
        end_angle=90
    },
        {
        name='upspeedf',
        arg='wlp0s16f4u3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff3300,
        fg_alpha=0.8,
        x=170, y=420,
        radius=45,
        thickness=4,
        start_angle=-90,
        end_angle=90
    },
}

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

clock_r=65

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

clock_x=80
clock_y=200

show_seconds=true

require 'cairo'

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

function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

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

    -- Draw background ring

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

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

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    
    secs=os.date("%S")    
    mins=os.date("%M")
    hours=os.date("%I")
        
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
        
    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        
        value=tonumber(str)
        pct=value/pt['max']
        
        draw_ring(cr,pct,pt)
    end
    
    -- Check that Conky has been running for at least 5s

    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    
    local cr=cairo_create(cs)    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    
    draw_clock_hands(cr,clock_x,clock_y)
end
Je dispose d'une version colorisée vert et d'une version 4 coeurs avec les températures colorisée vert aussi : disponible sur demande
otacon
Chu Ko Nu
Messages : 466
Inscription : sam. 07 sept. 2013, 19:22
Localisation : Limousin

Re: [Conky] Vos .conkyrc !

Message par otacon »

Bonjour,

Image

Code : Tout sélectionner

# Conky #

alignment top_right
gap_x 30
gap_y 60
minimum_size 480

update_interval 2

own_window yes
own_window_class Conky
own_window_transparent yes
own_window_argb_visual yes
own_window_argb_value 255
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background no

use_xft yes
xftfont DejaVu Sans Mono:size=10

cpu_avg_samples 2
net_avg_samples 2
default_color white
draw_borders no
draw_outline no
draw_shades no
double_buffer yes
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
stippled_borders 0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no

TEXT
$sysname-$kernel ${color grey}$alignc démarré depuis:$color $uptime

${goto 55}${color grey}Frequence CPU (GHz): $alignr$color${freq_g 1}   ${freq_g 2}   ${freq_g 3}   ${freq_g 4}
${goto 80}${color grey}Charge CPU:$color $cpu% ${cpubar 5,124}${color grey}$alignr Temp: $color${execi 300 sensors | grep Physical | cut -c18-24}
${goto 104}${color grey}Charge RAM: $color$memperc% ${membar 5,100}$alignr$mem / $memmax
${goto 120}${color grey}Processus:$color $processes  ${color grey}$alignr En cours:$color $running_processes
${goto 135}$color$hr
${goto 148}${color}Name $alignr PID   CPU%   MEM%
${goto 161}${color lightgrey}${top name 1}$alignr${top pid 1} ${top cpu 1} ${top mem 1}
${goto 171}${color lightgrey}${top name 2}$alignr${top pid 2} ${top cpu 2} ${top mem 2}
${goto 181}${color lightgrey}${top name 3}$alignr${top pid 3} ${top cpu 3} ${top mem 3}
${goto 191}${color lightgrey}${top name 4}$alignr${top pid 4} ${top cpu 4} ${top mem 4}
${goto 198}${color lightgrey}${top name 5}$alignr${top pid 5} ${top cpu 5} ${top mem 5}
${goto 205}$color$hr
${goto 210}${color grey}Espace Utilisé: 
${goto 215}${color grey}Racine : $color${fs_used_perc /}% de ${fs_size /} ${fs_bar 5 /}
${goto 220}${color grey}Data   : $color${fs_used_perc /home/data}% de ${fs_size /home/data} ${fs_bar 5 /home/data}
${goto 224}$color$hr
${goto 227}${color grey}Réseau: $color${addr wlp3s0}
${goto 229}${color grey}Up: $color${upspeed wlp3s0} ${color grey} - Down: $color${downspeed wlp3s0}
${goto 230}$color$hr
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 0}${goto 365}${tcp_portmon 1 65535 rservice 0}$alignr${tcp_portmon 1 65535 rport 0}
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 2}${goto 365}${tcp_portmon 1 65535 rservice 2}$alignr${tcp_portmon 1 65535 rport 2}
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 3}${goto 365}${tcp_portmon 1 65535 rservice 3}$alignr${tcp_portmon 1 65535 rport 3}
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 4}${goto 365}${tcp_portmon 1 65535 rservice 4}$alignr${tcp_portmon 1 65535 rport 4}
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 5}${goto 365}${tcp_portmon 1 65535 rservice 5}$alignr${tcp_portmon 1 65535 rport 5}
${goto 230}${color lightgrey}${tcp_portmon 1 65535 rip 6}${goto 365}${tcp_portmon 1 65535 rservice 6}$alignr${tcp_portmon 1 65535 rport 6}
Avatar de l’utilisateur
KorteX39
Daikyu
Messages : 80
Inscription : mer. 12 mars 2014, 15:56

Re: [Conky] Vos .conkyrc !

Message par KorteX39 »

Bonjour a tous je cherche à utiliser le script python cal.py de chipster, or je n'ai pas du tout le résultat escompté et étant une bille en programmation je me tourne vers vous pour m'aider. voici le fichier du script

Code : Tout sélectionner

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import calendar, sys
from datetime import date


def create_a_month(cal, str_month):
   # Si on affiche les numéros des semaines il faut faire un décalage sur le mois et
   # sur les jours de la semaine
   if cal.is_num_week:
      str_month = '   ' + str_month + '   '

   # On ajoute les jours de la semaine à la chaine
   str_month += "Lu Ma Me Je Ve " + cal.col_wknd + "Sa Di" + cal.col_init + "\n"

   # On parcourt la matrice
   for i in cal.matrix_cur:
      for c, j in enumerate(i):
         # On regarde si l'on doit afficher les numéros de semaine
         if cal.is_num_week:
            if c == 0:
               if cal.num_week_cur < 10:
                  str_month += ' '

               str_month        += cal.col_numw + str(cal.num_week_cur) + cal.col_init + ' '
               cal.num_week_cur += 1

         # Si c'est un jour qui n'existe pas il est représenté par 0 et on le remplace par
         # 3 espaces et on ne fait pas la suite
         if j == 0:
            str_month += '   '
            continue

         # Si le jour est inférieur à 10, il faut mettre un espace pour compenser
         elif j < 10:
            str_month += ' '

         # Si on se trouve en colonne 5 ou 6, c'est que l'on se trouve en week-end
         if c == 5 or c == 6:
            # Si le jour d'aujourd'hui est un jour de week-end on ne lui met pas la même
            # couleur
            if not cal.already_passed and cal.day.day == j:
               str_month += cal.col_date + str(j) + cal.col_init
               cal.already_passed = True
            else:
               str_month += cal.col_wknd + str(j) + cal.col_init
         else:
            if not cal.already_passed and cal.day.day == j:
               str_month += cal.col_date + str(j) + cal.col_init
               cal.already_passed = True
            else:
               str_month += str(j)

         # Si on ne se trouve pas dans la dernière colonne, on rajoute un espace
         if c != 6:
            str_month += ' '

      # On saute va à la ligne
      str_month += '\n'

   # On retourne la chaîne construite
   return str_month



# Début de la classe Cal
class Cal():
   def __init__(self):
      self.day            = date.today()
      self.matrix_cur     = calendar.monthcalendar(self.day.year, self.day.month)
      self.col_init       = '${color0}' # Couleur initiale
      self.col_date       = '${color1}' # Couleur de la date courante
      self.col_wknd       = '${color2}' # Couleur du week end
      self.col_numw       = '${color3}' # Couleur des numéros de semaine
      self.num_week_cur   = date(self.day.year, self.day.month, 1).isocalendar()[1]
      self.num_week_next  = str()
      self.matrix_next    = str()
      self.is_next_cal    = False
      self.is_num_week    = False
      self.already_passed = False




# Début du programme principal
if __name__ == "__main__":
   # On définit un object Cal
   cal    = Cal()
   # On écrit les mois de l'année dans un tableau
   month  = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']
   # On initialise les 2 chaînes
   string1 = str()
   string2 = str()

   # Si l'utilisateur souhaite avoir le mois prochain
   if '--next' in sys.argv:
      cal.is_next_cal = True

   # Si l'utilisateur souhaite avoir le numéro des semaines
   if '--num_week' in sys.argv:
      cal.is_num_week = True

   # On passe dans la partie où l'utilisateur souhaite avoir le mois suivant
   if cal.is_next_cal:
      # Si le mois actuel est est décembre, il faut changer l'année
      if cal.day.month == 12:
         cal.matrix_next   = calendar.monthcalendar(cal.day.year + 1, 0)
         cal.num_week_next = date(cal.day.year + 1, 1, 1).isocalendar()[1]
         string2           = month[0].center(20) + '\n'
      # Autrement on calcule le mois suivant le mois actuel
      else:
         cal.matrix_next   = calendar.monthcalendar(cal.day.year, cal.day.month + 1)
         cal.num_week_next = date(cal.day.year, cal.day.month + 1, 1).isocalendar()[1]
         string2           = month[cal.day.month].center(20) + '\n'

      # Si un des deux mois à plus de semaines que l'autre, on ajoute un semaine vide
      if len(cal.matrix_cur) < len(cal.matrix_next):
         cal.matrix_cur.append([0, 0, 0, 0, 0, 0, 0])
      elif len(cal.matrix_cur) > len(cal.matrix_next):
         cal.matrix_next.append([0, 0, 0, 0, 0, 0, 0])

      string1 = month[cal.day.month - 1].center(20) + '\n'
      string1 = create_a_month(cal, string1)[:-2]

      # On copie toutes les valeurs de next dans cur
      cal.matrix_cur   = cal.matrix_next
      cal.num_week_cur = cal.num_week_next
      string2 = create_a_month(cal, string2)

      # On découpe les chaînes toutes les lignes
      string1 = string1.split('\n')
      string2 = string2.split('\n')

      # On met les deux chaines bout-à-bout
      string_tot = str()
      for i in range(len(string1)):
         string_tot += string1[i] + '   ' + string2[i] + '\n'

      print(string_tot, end='')

   # Partie où on n'affiche pas le mois suivant
   else:
      string1 = month[cal.day.month - 1].center(20) + '\n'
      string1 = create_a_month(cal, string1)
      print(string1, end='')
Le résultat obtenu en console

Code : Tout sélectionner

        Mars
Lu Ma Me Je Ve ${color2}Sa Di${color0}
                ${color2}1${color0}  ${color2}2${color0}
 3  4  5  6  7  ${color2}8${color0}  ${color2}9${color0}
10 11 ${color1}12${color0} 13 14 ${color2}15${color0} ${color2}16${color0}
17 18 19 20 21 ${color2}22${color0} ${color2}23${color0}
24 25 26 27 28 ${color2}29${color0} ${color2}30${color0}
31

Et la capture d'ecran de mon conky

Image
Vivre libre ou mourir
Avatar de l’utilisateur
acid_cloridrix
archer
Messages : 117
Inscription : mer. 17 oct. 2012, 15:18

Re: [Conky] Vos .conkyrc !

Message par acid_cloridrix »

Tu dois parler des problèmes d'alignement, il te faut des polices de type mono genre monospace ou autres.
HP 500-261ef full 64 bits - Samsung 24 pcs 1920x1080 px
CPU : 4 X Intel ® Core™ i5-4440 @ 3.1 Ghz | RAM : 8 Go
HD : Western Digital 1 To | CG Radeon R5 235


Multiboot UEFI : ArchLinux - Windows 7 - Autre base Debian

Openbox (LXqt)
KDE Plasma 5
Avatar de l’utilisateur
KorteX39
Daikyu
Messages : 80
Inscription : mer. 12 mars 2014, 15:56

Re: [Conky] Vos .conkyrc !

Message par KorteX39 »

Euh excuse moi acid_cloridrix je suis une lame mais j'ai des ttf mono déjà installé pourtant il me semble comment puis-je les utiliser? (je débute vraiment sous conky c'est mon 1er et je me contente d'utiliser des bout de code par ci par la en modifiant un peu ce que je sais)
Vivre libre ou mourir
Avatar de l’utilisateur
acid_cloridrix
archer
Messages : 117
Inscription : mer. 17 oct. 2012, 15:18

Re: [Conky] Vos .conkyrc !

Message par acid_cloridrix »

En ajoutant (par exemple):

Code : Tout sélectionner

${font monospace:size=10}
avant la commande appelant le script...

??
HP 500-261ef full 64 bits - Samsung 24 pcs 1920x1080 px
CPU : 4 X Intel ® Core™ i5-4440 @ 3.1 Ghz | RAM : 8 Go
HD : Western Digital 1 To | CG Radeon R5 235


Multiboot UEFI : ArchLinux - Windows 7 - Autre base Debian

Openbox (LXqt)
KDE Plasma 5
Avatar de l’utilisateur
KorteX39
Daikyu
Messages : 80
Inscription : mer. 12 mars 2014, 15:56

Re: [Conky] Vos .conkyrc !

Message par KorteX39 »

Alors il y a du nouveau. Tu avais vu juste l'alignement est desormais correcte. Le hic, c'est que la date s'arrete au 18 (merde seulement 18 jour de paye je vais ramer :D) je ne reposte pas la photo puisque le probleme etait déjà présent sur la premiere.

P.S : Par contre lancer en console le script me renvoie bien 31 jour pour mars c'est donc encore une mauvaise config de mon conkyrc
Vivre libre ou mourir
Avatar de l’utilisateur
acid_cloridrix
archer
Messages : 117
Inscription : mer. 17 oct. 2012, 15:18

Re: [Conky] Vos .conkyrc !

Message par acid_cloridrix »

Au pif, ajoute ceci dans la section avant "TEXT":

Code : Tout sélectionner

text_buffer_size 6076
(valeur aléatoire chopée dans un de mes vieux conkys)

Si ça marche pas, poste ton conkyrc, ce serau plus simple.
HP 500-261ef full 64 bits - Samsung 24 pcs 1920x1080 px
CPU : 4 X Intel ® Core™ i5-4440 @ 3.1 Ghz | RAM : 8 Go
HD : Western Digital 1 To | CG Radeon R5 235


Multiboot UEFI : ArchLinux - Windows 7 - Autre base Debian

Openbox (LXqt)
KDE Plasma 5
Avatar de l’utilisateur
KorteX39
Daikyu
Messages : 80
Inscription : mer. 12 mars 2014, 15:56

Re: [Conky] Vos .conkyrc !

Message par KorteX39 »

Merci ca fonctionne peux-tu m'expliquer text_buffer_size stp?
Vivre libre ou mourir
Répondre