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.

#2026 Le 06/05/2010, à 14:31

titimoi

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

Muy_Bien a écrit :

Salut tout le monde !
http://nsa14.casimages.com/img/2010/05/ … 790288.png

J'ai plein d'idées encore sur l'integration fun de lua par rapport au fond d'écran. Dés que j'ai le temps je m'y mets et je posterai le résultat ! wink

Est ce que vous aimez ?

Superbe ! en fait c'est le tout que j'aime, tu as simplement un lua pour les cercles blancs n'est-ce pas ? Tes icones (la lune, chrome) etc c'est quoi ? l'affichage de la musique c'est quoi ??
Bravo pour ton boulot c'est très joli !

Dernière modification par titimoi (Le 06/05/2010, à 14:34)

Hors ligne

#2027 Le 06/05/2010, à 14:58

Muy_Bien

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

Hey ! Salut titimoi !
Merci ça fait plaisir ! Mais ce n'est vraiment que le début ! J'ai plein d'idées !!

Oui j'ai un conkyrc pour la droite, un lua pour les 3 cercles (avec un autre conkyrc ... logique), les icones c'est AWN avec icones buuf et l'album c'est un plugin rythmbox qui s'appelle "Cover desktop art".

wink Merci et je reviendrai poster !


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2028 Le 06/05/2010, à 15:12

Seiko Matsumoto

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

Le mien est encore en travaux mais j'ai besoin d'aide ici cool

Voici la capture d'écran
Capture.png
Le conky de gauche marche parfaitement mais il n'affiche que les séries que je suis
C'est un peu le bordel pour poster ici, mais si ça intéresse quelqu'un je peux envoyer un zip

Muy_Bien, ton bureau est un vrai chef d'œuvre yikes


www.utopie57.net

Hors ligne

#2029 Le 07/05/2010, à 13:17

Llaqmataqui

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

Bonjour,
je suis nouveau sur ce forum et j'aimerai expérimenter conky.
Je viens de voir ton travail Muy_Bien et je suis vraiment épaté.
J'aimerai savoir comment tu as fait pour obtenir le panneau de droite (si tu pouvais poster ton .conkyrc se serait vraiment super tongue).

Dernière modification par Llaqmataqui (Le 07/05/2010, à 16:30)

Hors ligne

#2030 Le 08/05/2010, à 01:07

Levi59

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

Mise à jour de mon conky PC! (pas grand changement...)

Llaqmataqui a écrit :

Bonjour,
je suis nouveau sur ce forum et j'aimerai expérimenter conky.
Je viens de voir ton travail Muy_Bien et je suis vraiment épaté.
J'aimerai savoir comment tu as fait pour obtenir le panneau de droite (si tu pouvais poster ton .conkyrc se serait vraiment super tongue).

Le modèle de droite est une config "de base" facile à comprendre! Tu peux trouver un équivalent avec mon conky PC (cf signature) dans le conkyrc1.

Je t'invite également à installer mon filtre de coloration (cf sgnature aussi^^) qui te faciliteras la vie lorsque tu parcourras le code!

Dernière modification par Levi59 (Le 08/05/2010, à 01:25)

Hors ligne

#2031 Le 08/05/2010, à 10:19

Llaqmataqui

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

Merci beaucoup le rendu est super.
Cependant je n'arrive pas à comprendre et à reproduire ton conky du bas.
Pourrais-tu m'expliquer comment tu arrives à avoir des ronds pour afficher les températures ?

EDIT : apparemment les ronds viennent de fonts.
Sais-tu où je pourrais alors trouver des fonts tels que :
webdings, basicshapes, neuropolitical ?

Dernière modification par Llaqmataqui (Le 08/05/2010, à 10:34)

Hors ligne

#2032 Le 08/05/2010, à 11:49

Muy_Bien

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

Salut Llaqmataqui !
Comme l'a dit Levi59 le conky de droite est une config de base ! Je te le file meme si je suis encore en train de l'améliorer. Je posterai ma future config. Je te poste ma config du screen plus haut :
note : il y a dans le code un calendrier qui marchais sous Karmic et qui ne marche plus avec conky 1.8
note 2 : il te faut installer la police webdings avec la commande
sudo apt-get install ttf-mscorefonts-installer

######################
# - Conky settings de MuyBien - #
######################

update_interval 3
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1

imlib_cache_size 0
double_buffer yes
no_buffers yes

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Comic Sans MS:size=9
override_utf8_locale yes
text_buffer_size 2048

#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

alignment top_right
gap_x 30
gap_y 150
minimum_size 260 0
maximum_width 260

default_bar_size 60 8

#########################
# - Graphics settings - #
#########################
draw_shades no

default_color white

color0 4B4B4B
color1 white
color2 FFFF99
color3 FF9999
color4 FF6666
color5 FF3333

TEXT
${voffset -10}${alignc 46}${color}${font Arial Black:size=30}${time %H:%M}${font}${color}
${alignc}${time %d %B %Y}
${alignr}${font}${color}allumé depuis: $uptime

${voffset -2}${color}${font Poky:size=15}${font}${color}${voffset -8}${font Liberation Mono:size=10}${execpi 10800 DJS=`date +%-d`; cal -m | sed 's/^/${goto 30} /' | sed '1d' | sed s/" $DJS "/" "'${font Liberation Mono:style=bold:size=11}${color0}'"$DJS"'${color}${font}${font Liberation Mono:size=10}'" "/}${font}${voffset -14}

${font Liberation Sans:style=Bold:size=8}SYSTEM $stippled_hr
${font}${color}$alignc${execi 86400 lsb_release -si} : ${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}
${font}${color}$alignc$sysname $kernel on $machine
${font}${color}$alignc${exec whoami} @ $nodename
${font}${color}${alignc}Conky $conky_version

${color}Filesystem :
${voffset -18}${goto 80}${font webdings: size=15}${if_match ${fs_used_perc /} >0}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /} >10}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /} >20}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /} >30}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /} >40}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /} >50}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /} >60}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /} >70}${color3}${else}${color0}${endif}=${if_match ${fs_used_perc /} >80}${color4}${else}${color0}${endif}=${if_match ${fs_used_perc /} >90}${color5}${else}${color0}${endif}=${font}
${if_mounted /media/Public_sur_LaLune}${color}LaLune :
${voffset -18}${goto 80}${font webdings: size=15}${if_match ${fs_used_perc /media/Public_sur_LaLune} >0}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >10}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >20}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >30}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >40}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >50}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >60}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >70}${color3}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >80}${color4}${else}${color0}${endif}=${if_match ${fs_used_perc /media/Public_sur_LaLune} >90}${color5}${else}${color0}${endif}=${font}${else}${color}${alignc}LaLune n'est pas montée${endif}
${if_mounted /media/UDISK}${color}Mercure :
${voffset -18}${goto 80}${font webdings: size=15}${if_match ${fs_used_perc /media/UDISK} >0}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >10}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >20}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >30}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >40}${color1}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >50}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >60}${color2}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >70}${color3}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >80}${color4}${else}${color0}${endif}=${if_match ${fs_used_perc /media/UDISK} >90}${color5}${else}${color0}${endif}=${font}${else}${color}${alignc}Mercure n'est pas monté${endif}

${color}${voffset 4}${font Liberation Sans:style=Bold:size=8}PROCESS $stippled_hr${font}
${color}Name            ${goto 120}pid    ${alignr}%cpu    %mem
${color3}${top name 1} ${goto 110}${top pid 1} ${goto 180}${top cpu 1}     ${goto 230}${top mem 1}
${color2}${top name 2} ${goto 110}${top pid 2} ${goto 180}${top cpu 2}     ${goto 230}${top mem 2}
${color}${top name 3} ${goto 110}${top pid 3} ${goto 180}${top cpu 3}     ${goto 230}${top mem 3}
${color}${top name 4} ${goto 110}${top pid 4} ${goto 180}${top cpu 4}     ${goto 230}${top mem 4}
${color}${top name 5} ${goto 110}${top pid 5} ${goto 180}${top cpu 5}     ${goto 230}${top mem 5}

${voffset 4}${font Liberation Sans:style=Bold:size=8}NETWORK $stippled_hr${font}
${if_up eth0}
${voffset -13}${color}${font VariShapes Solid:size=14}${font}${color}${voffset -6}Up: ${font Liberation Sans:style=Bold:size=8}${color}${upspeed eth0}${color}${font}${alignr}${color}${upspeedgraph eth0 8,60 CE5C00 E07A1F}${color}
${voffset -2}${color}${font VariShapes Solid:size=14}${font}${color}${voffset -6}Down: ${font Liberation Sans:style=Bold:size=8}${color}${downspeed eth0}${color}${font}${alignr}${color}${downspeedgraph eth0 8,60 CE5C00 E07A1F}${color}

${voffset -2}${color}${font Poky:size=13}${font}${color}${voffset -4}Local IP : ${alignr}${color}${addr eth0}${color}
${voffset -2}${color}${font Poky:size=13}${font}${color}${voffset -4}General IP : ${alignr}${color}${execi 60 ~/Scripts/ip.sh}${color}

${voffset 4}${font Liberation Sans:style=Bold:size=8}FACTS $stippled_hr${font}
${color}${alignc}${execi 300 fortune chucknorris | iconv -c --silent -f ISO_8859-1 -t UTF-8 | fold -s -w 40}

Dernière modification par Muy_Bien (Le 08/05/2010, à 16:32)


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2033 Le 08/05/2010, à 14:01

Llaqmataqui

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

Merci beaucoup !
Je vais aller jeter un coup d'oeil à ton conky.
Je reviendrai poster mon travail

Hors ligne

#2034 Le 08/05/2010, à 15:53

Muy_Bien

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

Voila mon 2eme projet :

e95341cb421d360578cebe0d20997d3a.png

Je peux poster le ring.lua utilisé même si il faudra adapter tout ça à votre résolution !

Problémes : je n'arrive pas a afficher un ring avec hddtemp.
le calendrier ne marche pas sous conky 1.8 alors que sous 1.7.2 il marchais.
je ne sais pas comment récuperer la T° de ma carte graphique Nvidia.

Dernière modification par Muy_Bien (Le 08/05/2010, à 15:56)


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2035 Le 08/05/2010, à 15:58

carpediem

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

salut Muy_Bien, merci de poster le ring.lua j'aimerai bien tester ce conky
cordialement


"Carpe diem quam minimum credula postero"
(Cueille le jour présent, en te fiant le moins possible au lendemain.)
HORACE

Hors ligne

#2036 Le 08/05/2010, à 16:02

Muy_Bien

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

Le voila ! smile
Si au passage tu trouve comment afficher le ring hddtemp ... smile

--[[
Ring Meters by londonali1010 (2009)
Par MuyBien
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
 
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
 
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/rings-v1.2.lua
    lua_draw_hook_pre ring_stats
 
Changelog:
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
 
settings_table = {
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xFFFFFF,
        bg_alpha=0.2,
        fg_colour=0xFFFFFF,
        fg_alpha=1,
        x=220, y=227,
        radius=172,
        thickness=22,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xFFFFFF,
        bg_alpha=0.4,
        fg_colour=0xFFFFFF,
        fg_alpha=0.8,
        x=220, y=227,
        radius=145,
        thickness=26,
        start_angle=20,
        end_angle=360
    },
{
	name='memperc',
	arg='',
	max=200,
        bg_colour=0xFFFFFF,
        bg_alpha=0.5,
        fg_colour=0xFFFFFF,
        fg_alpha=1,
        x=220, y=227,
        radius=110,
        thickness=10,
        start_angle=340,
        end_angle=560
	},
{
	name='upspeedf',
        arg='eth0',
        max=800,
        bg_colour=0x000000,
        bg_alpha=0.4,
        fg_colour=0xff6b01,
        fg_alpha=0.8,
        x=220, y=227,
        radius=80,
        thickness=22,
        start_angle=280,
        end_angle=480
	},
{
	name='downspeedf',
        arg='eth0',
        max=800,
        bg_colour=0xFFFFFF,
        bg_alpha=0.9,
        fg_colour=0x7dae04,
        fg_alpha=0.8,
        x=220, y=227,
        radius=55,
        thickness=10,
        start_angle=120,
        end_angle=300
	},
{
	name='hddtemp',
        arg='/dev/sda |cut -c34-38',
        max=60,
        bg_colour=0xFFFFFF,
        bg_alpha=0.4,
        fg_colour=0x000000,
        fg_alpha=0.8,
        x=220, y=227,
        radius=20,
        thickness=22,
        start_angle=180,
        end_angle=360
	},
}
 
require 'cairo'
 
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
 
function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
 
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
 
    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)
 
    -- Draw background ring
 
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
 
    -- Draw indicator ring
 
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end
 
function conky_ring_stats()
    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
 
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
 
    local cr=cairo_create(cs)    
 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
end

et le conkyrc

# -- Conky -- #
# -- conky config by MuyBien -- #
background yes
cpu_avg_samples 2
pad_percents 2			
short_units yes			
stippled_borders 3
total_run_times 0
update_interval 1.0
use_spacer right
net_avg_samples 2
no_buffers yes
uppercase no
imlib_cache_size 0

uppercase no
override_utf8_locale yes
use_xft yes
text_buffer_size 8000
xftalpha 0.75
xftfont Comic Sans MS:size=9

own_window yes
own_window_colour 000000	# Black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type override 	## normal
own_window_title conky2

double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no

color0 000000			# black
color1 FFFFFF			# White
default_color 000000		
default_outline_color 000000 	# Black
default_shade_color 000000	# Black

# Layout
alignment top_right
gap_x 750
gap_y 420
max_specials 1024
max_user_text 10000
maximum_width 425
minimum_size 425 450
border_margin 1
border_width 1

# -- Load Lua -- #
lua_load ~/.config/conky/orange/rings.lua
lua_draw_hook_pre ring_stats


TEXT
${color0}${font Purisa:bold:size=8}${voffset 43}${goto 170} CPU1${font}
${color1}${font Purisa:bold:size=8}${voffset 2}${goto 220} CPU2${font}
${color1}${font Purisa:bold:size=8}${voffset 30}${goto 145} RAM${font}
${color1}${font Purisa:bold:size=8}${voffset 0}${goto 190} UP${font}
${color1}${font Purisa:bold:size=8}${voffset 50}${goto 190}HD : ${execi 10 hddtemp /dev/sda |cut -c34-38}
${color1}${font Purisa:bold:size=8}${voffset 23}${goto 180} DOWN${font}

Dernière modification par Muy_Bien (Le 08/05/2010, à 16:31)


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2037 Le 08/05/2010, à 16:12

Llaqmataqui

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

C'est quoi le code pour afficher le logo ubuntu ?
Peux-tu poster ton lua de ton précédent post (celui avec plusieurs ronds) ?
Merci

Hors ligne

#2038 Le 08/05/2010, à 16:24

Muy_Bien

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

Salut !

alors pour l'image c'est tout simplement :
${image $HOME/mon image.jpg -p 10,10 -s 300x300}
ou p regle la position et s la taille

et le rings.lua du 1er screen :

--[[
Ring Meters by londonali1010 (2009)
Par MuyBien
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
 
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
 
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/rings-v1.2.lua
    lua_draw_hook_pre ring_stats
 
Changelog:
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
 
settings_table = {
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xFFFFFF,
        bg_alpha=0,
        fg_colour=0xFFFFFF,
        fg_alpha=0.8,
        x=120, y=120,
        radius=39,
        thickness=22,
        start_angle=0,
        end_angle=360
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xFFFFFF,
        bg_alpha=0,
        fg_colour=0xFFFFFF,
        fg_alpha=0.8,
        x=301, y=136,
        radius=27,
        thickness=15,
        start_angle=0,
        end_angle=360
    },
{
	name='swapperc',
	arg='',
	max=100,
        bg_colour=0xFFFFFF,
        bg_alpha=0,
        fg_colour=0xFFFFFF,
        fg_alpha=0.8,
        x=330, y=464,
        radius=27,
        thickness=15,
        start_angle=0,
        end_angle=360
	},
}
 
require 'cairo'
 
function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
 
function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
 
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
 
    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)
 
    -- Draw background ring
 
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
 
    -- Draw indicator ring
 
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end
 
function conky_ring_stats()
    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
 
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
 
    local cr=cairo_create(cs)    
 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
end

Mias bon celui là c'est juste 3 cercles ... aprés faut l'adapter au fond d'écran qui est "fly forever" (que j'ai légérement modifié) je crois ... sur deviant art ...

Dernière modification par Muy_Bien (Le 08/05/2010, à 16:30)


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2039 Le 08/05/2010, à 16:40

Llaqmataqui

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

Merci smile
Tu pourrais pas me passer le logo ubuntu par hasard ?

Ah oui et aussi pour utiliser lua il faut installer quelque chose en particulier ?

Dernière modification par Llaqmataqui (Le 08/05/2010, à 16:51)

Hors ligne

#2040 Le 08/05/2010, à 16:53

Muy_Bien

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

Pas de probléme smile
Sur Lucid il est là :
/usr/share/icons/HumanLoginIcons/apps/64/computer.png


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2041 Le 08/05/2010, à 17:17

Llaqmataqui

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

Bah je le trouve pas. Je n'ai pas de dossier HumanLoginIcons dans icons hmm

Hors ligne

#2042 Le 08/05/2010, à 17:25

Muy_Bien

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

le voila :
computer.png


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2043 Le 08/05/2010, à 17:40

Llaqmataqui

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

Merci smile

Hors ligne

#2044 Le 08/05/2010, à 18:22

JB-home

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

Muy_Bien a écrit :

Problémes : je n'arrive pas a afficher un ring avec hddtemp.

moi j'y arrive mais il clignote :

--[[
Ring Meters by londonali1010 (2009)

This script draws percentage meters as rings. It is fully customisable; all options are described in the script.

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

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/rings-v1.2.lua
    lua_draw_hook_pre ring_stats

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

settings_table = {
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x740E0E,
        fg_alpha=0.8,
        x=36, y=35,
        radius=30,
        thickness=5,
        start_angle=220,
        end_angle=570
    },
    {
        name='fs_used_perc',
        arg='/mnt/HDD-74Go',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x740E0E,
        fg_alpha=0.8,
        x=175, y=35,
        radius=30,
        thickness=5,
        start_angle=220,
        end_angle=570
    },
    {
        name='hddtemp',
        arg='/dev/sda',
        max=100,
        bg_colour=0x606060,
        bg_alpha=0.6,
        fg_colour=0x740E0E,
        fg_alpha=0.8,
        x=36, y=35,
        radius=23,
        thickness=5,
        start_angle=270,
        end_angle=450
    },
}

require 'cairo'

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

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

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

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

    -- Draw background ring

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

    -- Draw indicator ring

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

function conky_ring_stats()
    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

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

    local cr=cairo_create(cs)    

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

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

Hors ligne

#2045 Le 08/05/2010, à 18:31

Muy_Bien

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

Ah bé oui pareil hmm


Windows est un système d'exploitation de l'homme par l'ordinateur.
Linux, c'est le contraire ... [Brunod]

Hors ligne

#2046 Le 08/05/2010, à 18:37

Fenouille84

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

Je suis encore sous Karmic : conky 1.7.2 et pas de soucis de mon côté avec hddtemp... hmm

Dernière modification par Fenouille84 (Le 08/05/2010, à 18:37)


Ma page Deviant Art : conky inside ;-)
.
-- DropBox (online backup) : 2Go + 250 Mo pour vous et moi par parrainage --

Hors ligne

#2047 Le 08/05/2010, à 19:16

JB-home

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

ah mince , j'suis sous Lucid avec Conky 1.8.0

il serait peut être utile de signaler le problème aux dev de conky ?

Dernière modification par z0rg> (Le 08/05/2010, à 19:26)

Hors ligne

#2048 Le 08/05/2010, à 19:26

Fenouille84

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

Voilà peut être la réponse.
La nouvelle version de conky bug peut être à cet endroit... Ou peut être Lucid et hddtemp...
Va savoir !! roll


Ma page Deviant Art : conky inside ;-)
.
-- DropBox (online backup) : 2Go + 250 Mo pour vous et moi par parrainage --

Hors ligne

#2049 Le 08/05/2010, à 19:28

JB-home

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

je sait qu'on ajoutant seulement ${hddtemp /dev/sda} dans la config de conky, la température clignote, durant quelques secondes la températures s'affiche, puis N/A s'affiche, puis de nouveau la température... ect... donc je pense que s'est un soucis entre conky 1.8.0 et hddtemp hmm

c'est pour cela que le ring lua clignote aussi.

Dernière modification par z0rg> (Le 08/05/2010, à 19:31)

Hors ligne

#2050 Le 08/05/2010, à 19:31

Fenouille84

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

z0rg> a écrit :

je sait qu'on ajoutant seulement ${hddtemp /dev/sda} dans la config de conky, la température clignote, durant quelques secondes la températures s'affiche, puis N/A s'affiche, puis de nouveau la température... ect... donc je pense que s'est un soucis entre conky et hddtemp hmm

c'est pour cela que le ring lua clignote aussi.

+1 smile
Le cercle n'est que le reflet de la valeur que conky lui envoie.
Donc il faudrait déjà résoudre le soucis de conky/hddtemp.

Dernière modification par Fenouille84 (Le 08/05/2010, à 19:34)


Ma page Deviant Art : conky inside ;-)
.
-- DropBox (online backup) : 2Go + 250 Mo pour vous et moi par parrainage --

Hors ligne