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.

#2701 Le 23/08/2010, à 15:40

breakolami

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

Après la version horizontale

http://forum.kubuntu-fr.org/viewtopic.php?pid=3659330#p3659330

Voici la version verticale

verto.th.jpg

Toujours comme base de départ le conky fait avec ConkyWizard GUI

http://code.google.com/p/conkywizard/downloads/list

Et modifié pour ajouter ce que je voulais

Transparence totale, 1050 pixels de haut
Passe mieux sur des fonds sombres (à cause de la transparence)

# Generated with Conky Wizard
# Copyright (C) 2010 José David Abad García
# GPL Version 3
# 
# WARNING! All changes made in this file will be lost if the program runs again!

# Default Fonts
use_xft yes
xftfont Segoe UI:size=10
override_utf8_locale yes

# Performance Settings
update_interval 1
total_run_times 0
double_buffer yes
no_buffers yes
net_avg_samples 2
text_buffer_size 1024

# Window Settings
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Window border
draw_borders no
draw_shades no

# Default Color
default_color E0DFDE

# Color Title.
color0 DD3A21
color9 ff1493
color8 bdfd1a
color7 1ac1fd #bleu
color6 f3ef00 #jaune
color5 f7560b #rouge
color4 0b50f7 #bleu
color3 f78a0b #rouge orangé
color2 0bf7bf #vert fluo
color1 f7e40b #jaune

# Size and position
minimum_size 350 1050
gap_x 0
gap_y 0
alignment top_right

TEXT
${image ~/.ConkyWizardTheme/pix/background.png -p 0,0 -s 350x1050}

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Système${font}${color}
${GOTO 70}Kernel:${GOTO 140}${kernel}
${GOTO 70}Version:${GOTO 140}${execi 86400 lsb_release -si} ${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}${GOTO 270}${color1}$machine${color}
${GOTO 70}CPU 1:${GOTO 140}${color1}${cpubar cpu1 10,140}${color} ${cpu cpu1} %
${GOTO 70}CPU 2:${GOTO 140}${color3}${cpubar cpu2 10,140}${color} ${cpu cpu2} %
${GOTO 70}RAM:${GOTO 140}${color2}${membar 10,140}${color} ${memperc} %
${GOTO 70}Updates: ${GOTO 140}${color1}${execi 3600 aptitude search "~U" | wc -l | tail}${color} Mises à jour dispo
${GOTO 70}Uptime:${GOTO 140}${uptime}

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Disques${font}${color}
${GOTO 70}Système: ${GOTO 140}${fs_used /}${GOTO 200}${color4}${fs_bar 10,140 /}${color}
${GOTO 70}Home: ${GOTO 140}${fs_used /home}${GOTO 200}${color9}${fs_bar 10,140 /home}${color}
${GOTO 70}Divers: ${GOTO 140}${fs_used /media/Divers}${GOTO 200}${color8}${fs_bar 10,140 /media/Divers}${color}
${GOTO 70}Musique: ${GOTO 140}${fs_used /media/Musique}${GOTO 200}${color5}${fs_bar 10,140 /media/Musique}${color}

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Réseau${font}${color}
${GOTO 70}Vitesse UP:${GOTO 170}${upspeedgraph wlan0 10,150 B7B2AD B7B2AD}
${GOTO 70}Vitesse Down:${GOTO 170}${downspeedgraph wlan0 10,150 B7B2AD B7B2AD}
${GOTO 70}Envoyés:${GOTO 170}${totalup wlan0}
${GOTO 70}Téléchargés:${GOTO 170}${totaldown wlan0}
${GOTO 70}IP Locale:${GOTO 170}${addr wlan0}
${GOTO 70}IP Publique:${GOTO 166}${execi 43200 wget  http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1}

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Températures${font}${color}
${GOTO 70}Processeur:${GOTO 170}${exec sensors | grep "CPU Temperature" | awk '{print $3}'}
${GOTO 70}Carte Mère:${GOTO 170}${exec sensors | grep "MB Temperature" | awk '{print $3}'}
${GOTO 70}Disque SDA:${GOTO 170}+${execi 10 hddtemp -n /dev/sda}°C
${GOTO 70}Disque SDB:${GOTO 170}+${execi 10 hddtemp -n /dev/sdb}°C
${GOTO 70}Disque SDC:${GOTO 170}+${execi 10 hddtemp -n /dev/sdc}°C

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Date et Heure${font}${color}
${GOTO 115}${color1}${font arial=12}${time %A}, ${time %d} ${time %B} ${time %Y}${font}${color}
${GOTO 115}${font Astron Boy Wonder:style=Bold:pixelsize=40}${time %H:%M:%S}${font}

${GOTO 36}${font Segoe UI:bold:size=14}${color0}Téléchargements${font}${color}
${GOTO 36}${color1}Hier${GOTO 120}down: ${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}${GOTO 240}up: ${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}
${GOTO 36}${color2}Aujourd'hui${GOTO 120}down: ${execi 300 vnstat --oneline | cut -d\; -f4}${GOTO 240}up: ${execi 300 vnstat --oneline | cut -d\; -f5}
${GOTO 36}${color3}Semaine${GOTO 120}down: ${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}${GOTO 240}up: ${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}
${GOTO 36}${color5}Ce Mois${GOTO 120}down: ${execi 300 vnstat --oneline | cut -d\; -f9}${GOTO 240}up: ${execi 300 vnstat --oneline | cut -d\; -f10}${color}

${GOTO 70}Total Hier:${GOTO 200}${execi 300 vnstat | grep "yesterday" | awk '{print $8 $9}'}
${goto 70}Total Aujourd'hui:${GOTO 200}${execi 300 vnstat --oneline | cut -d\; -f6}${color}
${goto 70}Total Semaine:${GOTO 200}${execi 300 vnstat -w | grep "current week" | awk '{print $9 $10}'}${color}
${goto 70}Total Mois:${GOTO 200}${execi 300 vnstat --oneline | cut -d\; -f11}${color}

${GOTO 80}${color6}Total:${GOTO 130}down: ${execi 300 vnstat --oneline | cut -d\; -f13}${GOTO 240}up: ${execi 300 vnstat --oneline | cut -d\; -f14}${color}

${GOTO 130}${color8}Total général down + up:
${GOTO 170}${font arial=12}${execi 300 vnstat --oneline | cut -d\; -f15}${color}${font}

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

Hors ligne

#2702 Le 23/08/2010, à 17:39

lilone972

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

Voila la version finale de mon conky. Encore quelque petits problèmes d'alignement mais je vais réglé ca...
Changement de police et intégration de Amarok.

conky3final.th.png

Uploaded with ImageShack.us

.conkyrc

# -- Conky settings -- #
background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window no
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
 
border_inner_margin 100
border_outer_margin 1
 

alignment top_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
 
# -- Text settings -- #
use_xft yes
xftfont ethnocentric:size=16
xftalpha 0.4
 
uppercase no

#colors
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
#lime 86c113
color1 cdcdcd
color2 86c113
color3 1994d1
color4 aa0000
 
default_color EEEEEE
 
# -- Lua Load -- #
lua_load ~/Conky/ring.lua
lua_draw_hook_pre ring_stats
 
TEXT

${voffset 70}${color #3782BF}${goto 70}${hwmon 0 temp 1}C° ${goto 295}${font ethnocentric:pixelsize=18}${hwmon 0 fan 1}RPM $font ${goto 1263}${downspeed eth1}${goto 1515}${upspeed eth1}$color
${voffset 0}${goto 735}${font ethnocentric:pixelsize=33}${color #3782BF}${time %H:%M:%S}$font$color
${voffset 0}${goto 755}${font ethnocentric:pixelsize=25}${color #A3A3A3}${time %D}$font
${voffset -35}${color #A3A3A3}${goto 55}Core1 ${goto 300}Core2 ${goto 1265}Down ${goto 1540}Up
${voffset 130}${color #3782BF}${goto 195}${freq_g}Ghz${goto 470}${hwmon 0 temp 2}C°${goto 1110}${fs_free /}${goto 1360}${if_mounted /media/STOCK_1}${fs_free /media/STOCK_1}${else}${goto 1340}${font ethnocentric:pixelsize=18}Non Monte $font $endif $color
${voffset 38}${color #A3A3A3}${goto 200}Core3${goto 450}Core4${goto 1110}${font ethnocentric:pixelsize=18}Ubuntu ${goto 1365}Stock$font
${voffset 123}${color #3782BF}${goto 60}SWAP${goto 325}${nvidia temp}C $color
${voffset 38}${color #A3A3A3}${goto 65}RAM${goto 302}Nvidia

ring.lua

--[[
Ring Meters by londonali1010 (2009)
 
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
 
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
 
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/rings-v1.2.1.lua
    lua_draw_hook_pre ring_stats
 
Changelog:
+ v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
+ 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)
]]
 
conky_background_color = 0x151515
conky_background_alpha = 0

ring_background_color = 0xA3A3A3
ring_background_alpha = 0.9
ring_foreground_color = 0x2EAFFF
ring_foreground_color2 = 0x3782BF
ring_foreground_color3 = 0xaa0000
ring_foreground_alpha = 1

settings_table = {
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=830, y=150,
        radius=110,
        thickness=12,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%I.%M',
        max=12,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=830, y=150,
        radius=130,
        thickness=12,
        start_angle=-160,
        end_angle=-20
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=830, y=150,
        radius=130,
        thickness=12,
        start_angle=20,
        end_angle=160
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=100, y=100,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='hwmon 0 temp 1',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=100, y=100,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
 {
        name='hwmon 0 fan 1',
        arg='',
        max=2300,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=350, y=100,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=350, y=100,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=250, y=320,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='freq_g',
        arg='',
        max=2.67,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=250, y=320,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu4',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=500, y=320,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
     {
        name='hwmon 0 temp 2',
        arg='',
        max=60,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=500, y=320,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=100, y=540,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=100, y=540,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=1160, y=320,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='fs_used_perc',
        arg='/media/STOCK_1/',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=1410, y=320,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='upspeedf',
        arg='eth1',
        max=130,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=1560, y=100,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='downspeedf',
        arg='eth1',
        max=450,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=1310, y=100,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='nvidia temp',
        arg='',
        max=105,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        x=350, y=540,
        radius=70,
        thickness=10,
        start_angle=-90,
        end_angle=90
    },
    {
        name='nvidia gpufreq',
        arg='',
        max=648,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=350, y=540,
        radius=85,
        thickness=10,
        start_angle=-140,
        end_angle=140
    },
    {
        name='execi 10 ~/.conky/amarok progress',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color,
        fg_alpha=ring_foreground_alpha,
        x=1260, y=970,
        radius=60,
        thickness=10,
        start_angle=-180,
        end_angle=180
    },
    }
 
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)
        if value == nil then value = 0 end
        pct=value/pt['max']
 
        draw_ring(cr,pct,pt)
    end
 
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
 
    local cr=cairo_create(cs)    
 
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
 
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
end

.conkyprocess

background yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no
use_xft yes
xftfont ethnocentric:size=11
xftalpha 0.8
update_interval 1

own_window yes
own_window_type override
own_window_transparent yes


double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1

default_color black
default_shade_color black

gap_x 20
gap_y 650
alignment top_left
maximum_width 500
minimum_size 330 10

use_spacer yes
no_buffers yes
uppercase no


#ed141a 88bbff 20a619 e1470b
TEXT

${color #A3A3A3}Processus             ${goto 250} PID      ${goto 335}%CPU    ${goto 420}%MEM
${hr}$color
${color #3782BF}
${top name 1} ${goto 250}${top pid 1}     ${goto 335}${top cpu 1}     ${goto 420}${top mem 1}
${top name 2} ${goto 250}${top pid 2}     ${goto 335}${top cpu 2}     ${goto 420}${top mem 2}
${top name 3} ${goto 250}${top pid 3}     ${goto 335}${top cpu 3}     ${goto 420}${top mem 3}
${top name 4} ${goto 250}${top pid 4}     ${goto 335}${top cpu 4}     ${goto 420}${top mem 4}
${top name 5} ${goto 250}${top pid 5}     ${goto 335}${top cpu 5}     ${goto 420}${top mem 5}
${top name 6} ${goto 250}${top pid 6}     ${goto 335}${top cpu 6}     ${goto 420}${top mem 6}$color

${color #A3A3A3}Memoire
${hr}$color
${color #3782BF}
${top_mem name 1} ${goto 250}${top_mem pid 1}   ${goto 335}${top_mem cpu 1}   ${goto 420}${top_mem mem 1}
${top_mem name 2} ${goto 250}${top_mem pid 2}   ${goto 335}${top_mem cpu 2}   ${goto 420}${top_mem mem 2}
${top_mem name 3} ${goto 250}${top_mem pid 3}   ${goto 335}${top_mem cpu 3}   ${goto 420}${top_mem mem 3}
${top_mem name 4} ${goto 250}${top_mem pid 4}   ${goto 335}${top_mem cpu 4}   ${goto 420}${top_mem mem 4}
${top_mem name 5} ${goto 250}${top_mem pid 5}   ${goto 335}${top_mem cpu 5}   ${goto 420}${top_mem mem 5}
${top_mem name 6} ${goto 250}${top_mem pid 6}   ${goto 335}${top_mem cpu 6}   ${goto 420}${top_mem mem 6}
$color

.conkyvnstat

background yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no
use_xft yes
xftfont ethnocentric:size=11
xftalpha 0.8
update_interval 1

own_window yes
own_window_type override
own_window_transparent yes


double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1

default_color black
default_shade_color black

gap_x 1200
gap_y 500
alignment top_left
maximum_width 500
minimum_size 450 10

use_spacer yes
no_buffers yes
uppercase no


#ed141a 88bbff 20a619 e1470b
TEXT
${color #A3A3A3}Net Stats             ${goto 200}Download ${goto 365}Upload
${hr}$color
${color #3782BF}
Aujourd'hui${alignc}${goto 200}${execi 300 vnstat --oneline | cut -d\; -f4}${alignr}${goto 365}${execi 300 vnstat --oneline | cut -d\; -f5}
Hier${alignc}${goto 200}${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}${alignr}${goto 365}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}
Semaine${alignc}${goto 200}${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}${alignr}${goto 365}${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}
Mois${alignc}${goto 200}${execi 300 vnstat --oneline | cut -d\; -f9}${alignr}${goto 365}${execi 300 vnstat --oneline | cut -d\; -f10}
Général${alignc}${goto 200}${execi 300 vnstat --oneline | cut -d\; -f13}${alignr}${goto 365}${execi 300 vnstat --oneline | cut -d\; -f14}$color

.conkyforecast

background yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no
use_xft yes
xftfont ethnocentric:size=12
xftalpha 0.8
update_interval 1

own_window yes
own_window_type override
own_window_transparent yes


double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1

default_color white
default_shade_color black

gap_x 1200
gap_y 680
alignment top_left
maximum_width 700
minimum_size 450 10

use_spacer yes
no_buffers yes
uppercase no


#ed141a 88bbff 20a619 e1470b

TEXT
${color #A3A3A3}Météo
${hr}$color
${color #3782BF}${font ethnocentric:size=14}${execi 1800 conkyForecast --location=FRXX3053 --datatype=CT}${font}$color
${color #A3A3A3}${voffset 20}${font ConkyWeather:style=Bold:size=50}${execi 1800 conkyForecast --location=FRXX3053  --datatype=WF}   ${font ConkyWeather:size=50}${execi 1800 conkyForecast --startday=1 --location=FRXX3053 --datatype=WF}${font}       ${voffset -45}  ${font ConkyWeather:size=50}${execi 1800 conkyForecast --startday=2 --location=FRXX3053 --datatype=WF}${font}        ${voffset -40}${font ConkyWeather:size=50}${execi 1800 conkyForecast --startday=3 --location=FRXX3053 --datatype=WF}${font}$color
${color #3782BF}${font ethnocentric:size=10}${execi 1800 conkyForecast --location=FRXX3053 --datatype=HT --centeredwidth=4} - ${execi 1800 conkyForecast --location=FRXX3053 --datatype=LT --centeredwidth=4}    ${execi 1800 conkyForecast --location=FRXX3053 --datatype=HT --startday=1 --centeredwidth=4} - ${execi 1800 conkyForecast --location=FRXX3053 --datatype=LT --startday=1 --centeredwidth=4}    ${execi 1800 conkyForecast --location=FRXX3053 --datatype=HT --startday=2 --centeredwidth=4} - ${execi 1800 conkyForecast --location=FRXX3053 --datatype=LT --startday=2 --centeredwidth=4}    ${execi 1800 conkyForecast --location=FRXX3053 --datatype=HT --startday=3 --centeredwidth=4} - ${execi 1800 conkyForecast --location=FRXX3053 --datatype=LT --startday=3 --centeredwidth=4}$color

.conkyrcamarok

background yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no
use_xft yes
xftfont ethnocentric:size=9
xftalpha 0.8
update_interval 1

own_window yes
own_window_type override
own_window_transparent yes


double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1

default_color white
default_shade_color black

gap_x 1340
gap_y 925
alignment top_left
maximum_width 700
minimum_size 10 10

use_spacer yes
no_buffers yes
uppercase no


TEXT
${color #A3A3A3}${if_running amarok}
${alignc}${execi 10 ~/.conky/amarok artist}
${alignc}${execi 10 ~/.conky/amarok title}
${alignc}"${execi 10 ~/.conky/amarok album}"
${alignc}${execi 10 ~/.conky/amarok year} - ${alignc}${execi 10 ~/.conky/amarok genre}$endif

.conkyrc2

background yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no
use_xft yes
xftfont Terminal Bitstream Vera Sans Mono:size=12
xftalpha 0.8
update_interval 1

own_window yes
own_window_type override
own_window_transparent yes


double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1

default_color white
default_shade_color black

gap_x 550
gap_y 800
alignment top_left
maximum_width 800
minimum_size 330 10

use_spacer yes
no_buffers yes
uppercase no


#ed141a 88bbff 20a619 e1470b
TEXT


${font ethnocentric:pixelsize=38}${color #3782BF}        DEATHSTAR
${font ethnocentric:pixelsize=20} ${color #A3A3A3}                 ${execi 86400 lsb_release -si} : ${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}$font

${font ethnocentric:pixelsize=15}    Local: ${addr eth1}      Adresse Ip:${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}

Dernière modification par lilone972 (Le 23/08/2010, à 18:13)

Hors ligne

#2703 Le 23/08/2010, à 21:05

sunkart

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

Levi59 a écrit :

Je viens de tester sur mon EeePC et en effet il y avait un problème... j'ai donc réécris ceci mais je ne comprend pas pourquoi celui ci fonctionne et pas l'autre (j'ai aussi retiré la partition racine et home pour mon usage... il suffit de retirer les 2 grep en plus pour revenir à l'ancienne détection.)
Sur mon PC de bureau par contre, aucun problème. Étrange

j'ai fait différent test avec tes lignes de codes.

Si je les prends telles quelles :

test1
${execpi 30 grep -E ^\/dev /etc/mtab | grep -vE [\ ,]ro[\ ,]  | cut -d" " -f2 | while read line ; do
echo $line '${fs_used_perc '$line'}% ${fs_bar '$line'}'
done }

test
${execpi 30 grep -E ^\/dev /etc/mtab | grep -vE [\ ,]ro[\ ,] | grep -vE \ /\  | grep -vE \ /home\  | cut -d" " -f2 | while read line ; do
echo $line '${fs_used_perc '$line'}% ${fs_bar '$line'}'; 
done }

ça me donne ça : il manque des infos
conkytest1.th.png
Uploaded with ImageShack.us

Si je les modifie et supprime la barre :

test1
${execpi 30 grep -E ^\/dev /etc/mtab | grep -vE [\ ,]ro[\ ,]  | cut -d" " -f2 | while read line ; do
echo $line '${fs_used_perc '$line'}%'
done }

test
${execpi 30 grep -E ^\/dev /etc/mtab | grep -vE [\ ,]ro[\ ,] | grep -vE \ /\  | grep -vE \ /home\  | cut -d" " -f2 | while read line ; do
echo $line '${fs_used_perc '$line'}%'; 
done }

ça me donne ça : tous les points de montages sont affichés ainsi que le %
conkytest2.th.png
Uploaded with ImageShack.us

J'ai fait le test inverse en ne mettant que la barre et ça fonctionne bien :
conkytest3.th.png
Uploaded with ImageShack.us

Je ne connais pas du tout la fonction execpi et grep. Je pense que je suis limité par ça.
Où est-ce que je peux trouver plus de détail sur execpi et grep (surtout pour grep en fait) ? Peux-tu m'expliquer à quoi correspond chaque élément de ton grep ?

Vous noterez au passage que l'affichage de la t° est parti en cachuète pour le premier disque. Comme j'ai allumé le PC avec un lecteur multiu-carte connecté tous les lecteurs ont pris un valeur sdx et l'ancien sda a été pris en dernier. Du coup, mon conky tombe à l'eau ... je n'ai pas réussit à "fixer" la valeur.

A+
Cyril


Cyril

Hors ligne

#2704 Le 23/08/2010, à 22:34

Levi59

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

sunkart a écrit :
Levi59 a écrit :

Je viens de tester sur mon EeePC et en effet il y avait un problème... j'ai donc réécris ceci mais je ne comprend pas pourquoi celui ci fonctionne et pas l'autre (j'ai aussi retiré la partition racine et home pour mon usage... il suffit de retirer les 2 grep en plus pour revenir à l'ancienne détection.)
Sur mon PC de bureau par contre, aucun problème. Étrange

j'ai fait différent test avec tes lignes de codes.

[...]

Pour ça j'ai fais les mêmes constatations sur mon EeePC, par contre là j'ai sous les yeux mon conky PC et ca marche parfaitement... Je ne comprend pas plus que toi.

sunkart a écrit :

Je ne connais pas du tout la fonction execpi et grep. Je pense que je suis limité par ça.
Où est-ce que je peux trouver plus de détail sur execpi et grep (surtout pour grep en fait) ? Peux-tu m'expliquer à quoi correspond chaque élément de ton grep ?

execpi c'est une fonction de conky donc voir dans sa doc. Pour grep, un petit "man grep" en console te donnera toutes les informations nécessaires.
pour ma ligne grep:

grep -E ^\/dev /etc/mtab | grep -vE [\ ,]ro[\ ,] | grep -vE \ /\  | grep -vE \ /home\  | cut -d" " -f2

-E pour comprendre les RegEx (expressions régulières)
^(en début de ligne)
\(échappement pour que grep comprenne que c'est un caractère et non une fonction comme ^)
/dev(le motif recherché)
ensuite le fichier /etc/mtab
| pour indiquer que l'on continue de travailler sur le résultat que la partie précédente
-v pour inverser les résultat, en gros ici j'élimine le motif "ro" situé entre espace et/ou virgule
idem pour pour la racine ( / ) et home ( /home )
enfin cut -d pour indiquer la séparation et -f2 pour le 2eme bloc de la ligne


sunkart a écrit :

Vous noterez au passage que l'affichage de la t° est parti en cachuète pour le premier disque. Comme j'ai allumé le PC avec un lecteur multiu-carte connecté tous les lecteurs ont pris un valeur sdx et l'ancien sda a été pris en dernier. Du coup, mon conky tombe à l'eau ... je n'ai pas réussit à "fixer" la valeur.

Confere la doc sur fstab si ton sda est un périphérique toujours branché et peut être les UUID.

Dernière modification par Levi59 (Le 23/08/2010, à 22:36)

Hors ligne

#2705 Le 24/08/2010, à 07:14

sunkart

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

Levi59 a écrit :
sunkart a écrit :

Vous noterez au passage que l'affichage de la t° est parti en cachuète pour le premier disque. Comme j'ai allumé le PC avec un lecteur multiu-carte connecté tous les lecteurs ont pris un valeur sdx et l'ancien sda a été pris en dernier. Du coup, mon conky tombe à l'eau ... je n'ai pas réussit à "fixer" la valeur.

Confere la doc sur fstab si ton sda est un périphérique toujours branché et peut être les UUID.

C'est bien là le problème, j'ai pas su trouver la réponse à mon problème dans la doc fstab mad (cf. mon sujet : http://forum.ubuntu-fr.org/viewtopic.php?id=407269)

Pour le reste, je ferai d'autres essais ce soir. Au final, je me demande si ce n'est pas la ligne echo qui pose problème ou une histoire de tampon car dans les essais que j'ai fait, j'ai l'impression qu'il est limité en affichage au bout d'un certain temps.

Par contre, je viens de voir dans la doc que la variable execi prenait "beaucoup" de ressource, pourquoi ne pas l'extraire dans un script à part (truc que j'ai jamais fais encore et où je n'y connais rien du tout - pour le moment tongue)


Cyril

Hors ligne

#2706 Le 24/08/2010, à 09:48

Levi59

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

J'ai répondu sur ton fil...

Pour le script, ca peut se faire en créant un fichier dans /tmp avec les bonnes informations. puis un echo sur ce fichier. À essayer.

edit, on va essayer quelque chose:

copie ce script et rend le exécutable:

#!/bin/bash
rm /tmp/infosdd
line=`grep ^\/dev /etc/mtab | grep -v [\ ,]ro[\ ,] | grep -v \ /\  | grep -v \ /home\  | cut -d" " -f2 | while read line ; do
echo $line '${fs_used_perc '$line'}% ${fs_bar '$line'}' >> /tmp/infosdd
done`

Ensuite ajoute ceci à ton conkyrc:

${execpi 30 bash /CHEMIN_VERS_LE_SCRIPT_PRECEDENT.sh && cat /tmp/infosdd}

Actualise et vérifie le résultat. Dis moi si ca marche

Dernière modification par Levi59 (Le 24/08/2010, à 10:29)

Hors ligne

#2707 Le 24/08/2010, à 13:30

wawan60

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

Bonjour à vous !

Je suis de retrour sur ce topic, pour me faire un nouveaux bureaux, avec des jolis ring smile

Petit problème .... je coince sur les couleurs

Vous savez, ou je pourrais trouver une liste de couleurs ? ( sans avoir a installer quoi que ce soit ? )

Il me faudrait un rouge vif, si vous pouviez m'aidé wink

Merci !

Je posterais mon résultat une fois finit


Mon site -> www.retro-wuseum.hostzi.com
Grace Hopper : Pour moi, la programmation est plus qu'un art appliqué important. C'est aussi une ambitieuse
quête menée dans les tréfonds de la connaissance

Hors ligne

#2708 Le 24/08/2010, à 13:50

thisirs

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

Pour du rouge y'a le mot clé red. Sinon le code couleur c'est 6 nombres en hexa, par paquets de 2 ça code pour RGB.
En gros pour le rouge ça donne FF0000.
The Gimp permet de simplifier au lieu d'y aller à tâtons... Tu cliques sur "couleur de premier plan" et "d'arrière plan" y'a une boite de dialogue où tu peux te servir de la pipette à couleurs n'importe où sur l'écran ça te donne pile le codage utilisé ci-dessus!

Voilà!

Hors ligne

#2709 Le 24/08/2010, à 13:53

kurapika29

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

Y'a le soft Gcolor2 qui fait ça en gros http://gcolor2.sourceforge.net/ wink


Disponible sur IRC, sur le serveur irc.freenode.net salon ##ubuntu-voyager (et aussi sur plein d'autre serveur/salon)
Venez si vous avec besoin d'aide ou pour causer ;) suffit d'avoir Xchat ou un autre client IRC
Où sinon en cliquant sur se lien http://kiwiirc.com/client/irc.freenode. … tu-voyager

Hors ligne

#2710 Le 24/08/2010, à 13:55

wawan60

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

thisirs a écrit :

Pour du rouge y'a le mot clé red. Sinon le code couleur c'est 6 nombres en hexa, par paquets de 2 ça code pour RGB.
En gros pour le rouge ça donne FF0000.
The Gimp permet de simplifier au lieu d'y aller à tâtons... Tu cliques sur "couleur de premier plan" et "d'arrière plan" y'a une boite de dialogue où tu peux te servir de la pipette à couleurs n'importe où sur l'écran ça te donne pile le codage utilisé ci-dessus!

Voilà!

Merci ! big_smile

Le pire c'est que je l'utilise pour le html ... ( boulet boy XD )
Et j'ai vu des styles d'anneaux différents, genre sa : images?q=tbn:ANd9GcQ_drX-XaO6KrKuvuUEtQAEYm_Jtn9f5MYiDWV29VAf2YV4JSc&t=1&usg=__dRlOWceXdw9nEP3VnWSLo6I2gDI=
, mais en anneaux, il faut faire comment ? hmm


Mon site -> www.retro-wuseum.hostzi.com
Grace Hopper : Pour moi, la programmation est plus qu'un art appliqué important. C'est aussi une ambitieuse
quête menée dans les tréfonds de la connaissance

Hors ligne

#2711 Le 24/08/2010, à 13:57

Levi59

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

Pour le lua, tu devrai aller voir sur le fil consacré à conky et lua:
./viewtopic.php?id=402081

Hors ligne

#2712 Le 24/08/2010, à 15:24

wawan60

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

Levi59 a écrit :

Pour le lua, tu devrai aller voir sur le fil consacré à conky et lua:
./viewtopic.php?id=402081

Merci ! Les anneaux sera pour plus tard je pense wink

Et vous savez comment faire un texte défilant ? Sa serait sympas wink


Mon site -> www.retro-wuseum.hostzi.com
Grace Hopper : Pour moi, la programmation est plus qu'un art appliqué important. C'est aussi une ambitieuse
quête menée dans les tréfonds de la connaissance

Hors ligne

#2713 Le 24/08/2010, à 15:30

gautier59

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

Bonjour à tous. J'essai d'afficher mes température sur conky mais rien à faire ça ne marche pas.
Voici ce que j'ai fait : J'ai installé sensor. Ensuite quand je tape sensors sur le terminal j'ai bien les température qui s'affiche sur le terminal. Mais quand je les veux sur conky il me mets juste une température pour Temp1 (vous verrez sur le .conkyrc à quoi correspond cette température). Mais sinon le reste est à 0°C ou °C (c'est à dire RIEN °C).
Voici mes commmandes conky :

Computer  : $color$acpitemp°C
M.Board   : $color${execi 10 sensors | grep "M/B Temp:" | cut -b 15-16}°C
Temp1     : $color${execi 10 sensors | grep "temp1:" | cut -b 15-16}°C
Processor : $color${execi 10 sensors | grep "CPU Temp:" | cut -b 15-16}°C
H. Drive  : ${color}${execi 10 hddtemp -n /dev/sda}°C

Et voici ce que me sort le terminal quand je tape sensors :

gautier@gautier-desktop:~$ sensors
it8720-isa-0228
Adapter: ISA adapter
in0:         +0.99 V  (min =  +0.00 V, max =  +4.08 V)   
in1:         +1.58 V  (min =  +0.00 V, max =  +4.08 V)   
in2:         +3.38 V  (min =  +0.00 V, max =  +4.08 V)   
in3:         +3.02 V  (min =  +0.00 V, max =  +4.08 V)   
in4:         +3.04 V  (min =  +0.00 V, max =  +4.08 V)   
in5:         +1.89 V  (min =  +0.00 V, max =  +4.08 V)   
in6:         +4.08 V  (min =  +0.00 V, max =  +4.08 V)   
in7:         +2.13 V  (min =  +0.00 V, max =  +4.08 V)   
Vbat:        +3.09 V
fan1:        769 RPM  (min =    0 RPM)
fan2:          0 RPM  (min =    0 RPM)
fan3:          0 RPM  (min =    0 RPM)
fan4:          0 RPM  (min =    0 RPM)
fan5:          0 RPM  (min =    0 RPM)
temp1:       +37.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
temp2:       +29.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode
temp3:       +34.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
cpu0_vid:   +1.050 V

J'ai aussi essayé cette commande là mais ne marche toujours pas :

CPU:$color ${i2c temp 2}C${color grey} - MB:$color ${i2c temp 1}C

Je sais que c'est une question récurrente mais la j'ai beau avoir cherché je ne trouve pas la solution.

Par contre j'ai vu dans un tutorial qu'il fallait activé ces modules mais je ne sais pas comment on fait. Donc peut être que le problème viendrait de la.

Dernière modification par gautier59 (Le 24/08/2010, à 15:33)

Hors ligne

#2714 Le 24/08/2010, à 18:22

sunkart

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

Levi59 a écrit :

Actualise et vérifie le résultat. Dis moi si ca marche

Bon loupé, ça donne le même résultat :
conkytest1.th.png
Uploaded with ImageShack.us

Je pense que ça doit venir d'echo.


Cyril

Hors ligne

#2715 Le 24/08/2010, à 20:01

chepioq

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

gautier59 a écrit :

Bonjour à tous. J'essai d'afficher mes température sur conky mais rien à faire ça ne marche pas.
Voici ce que j'ai fait : J'ai installé sensor. Ensuite quand je tape sensors sur le terminal j'ai bien les température qui s'affiche sur le terminal. Mais quand je les veux sur conky il me mets juste une température pour Temp1 (vous verrez sur le .conkyrc à quoi correspond cette température). Mais sinon le reste est à 0°C ou °C (c'est à dire RIEN °C).
Voici mes commmandes conky :

Computer  : $color$acpitemp°C
M.Board   : $color${execi 10 sensors | grep "M/B Temp:" | cut -b 15-16}°C
Temp1     : $color${execi 10 sensors | grep "temp1:" | cut -b 15-16}°C
Processor : $color${execi 10 sensors | grep "CPU Temp:" | cut -b 15-16}°C
H. Drive  : ${color}${execi 10 hddtemp -n /dev/sda}°C

Et voici ce que me sort le terminal quand je tape sensors :

gautier@gautier-desktop:~$ sensors
it8720-isa-0228
Adapter: ISA adapter
in0:         +0.99 V  (min =  +0.00 V, max =  +4.08 V)   
in1:         +1.58 V  (min =  +0.00 V, max =  +4.08 V)   
in2:         +3.38 V  (min =  +0.00 V, max =  +4.08 V)   M.Board   : $color${execi 10 sensors | grep "M/B Temp:" | cut -b 15-16}°C
in3:         +3.02 V  (min =  +0.00 V, max =  +4.08 V)   
in4:         +3.04 V  (min =  +0.00 V, max =  +4.08 V)   
in5:         +1.89 V  (min =  +0.00 V, max =  +4.08 V)   
in6:         +4.08 V  (min =  +0.00 V, max =  +4.08 V)   
in7:         +2.13 V  (min =  +0.00 V, max =  +4.08 V)   
Vbat:        +3.09 V
fan1:        769 RPM  (min =    0 RPM)
fan2:          0 RPM  (min =    0 RPM)
fan3:          0 RPM  (min =    0 RPM)
fan4:          0 RPM  (min =    0 RPM)
fan5:          0 RPM  (min =    0 RPM)
temp1:       +37.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
temp2:       +29.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode
temp3:       +34.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
cpu0_vid:   +1.050 V

J'ai aussi essayé cette commande là mais ne marche toujours pas :

CPU:$color ${i2c temp 2}C${color grey} - MB:$color ${i2c temp 1}C

Je sais que c'est une question récurrente mais la j'ai beau avoir cherché je ne trouve pas la solution.

Par contre j'ai vu dans un tutorial qu'il fallait activé ces modules mais je ne sais pas comment on fait. Donc peut être que le problème viendrait de la.

Je pense que tu fais des confusions, par exemple tu as:

M.Board   : $color${execi 10 sensors | grep "M/B Temp:" | cut -b 15-16}°C

alors que dans la sortie de ton sensors tu n'as pas de ligne ou il y a "M/B Temp:"

C'est la même chose pour

Processor : $color${execi 10 sensors | grep "CPU Temp:" | cut -b 15-16}°C

Dans ton sensors tu n'as que temp1, temp2 et temp3 qui indiquent des températures.


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

Hors ligne

#2716 Le 24/08/2010, à 20:49

maestroom

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

lilone972
Voila la version finale de mon conky. Encore quelque petits problèmes d'alignement mais je vais réglé ca...
Changement de police et intégration de Amarok.
http://img818.imageshack.us/i/conky3final.png/

Super lilone972 ton conky lua... et merçi pour le scripts. lua.. tu ma aider a franchir le pas qui me manquais ^^
je te donne un + 100000

voila le résultats du conky
http://a.imageshack.us/img839/6116/monnouveauconky.png

pas contre j'ai 2 petits problème.... mais icons.. sont disparue..... si je mes own_window  a yes... ben mon conky.. est tout décalé.... est-ce normal????

et aussi.... mon 2e
j'ai une image que je veux me servir.. pour remplacer le font nvidia... tout vert est plate... ^^ par une image
mais avec les "voffset" et les "goto" ceci ne fonctionne pas, une solution???

voici le code que j'utilise il fonctionne mes reste en place dans mon coin haut gauche

${image /home/maestroom/Téléchargements/capsula_nvidia/capsula_nvidia2.png -s 79x100 -f 86400}

Dernière modification par maestroom (Le 24/08/2010, à 20:57)


CM: Asus Maximus extreme VI/ cpu: intel Core I7-4770 /carte graphique: nvidia GTX 760 /os: Ubuntu gnome-shell 14.04 "" 64 bits avec dual boot windows 8.1 64bit

Hors ligne

#2717 Le 25/08/2010, à 00:53

Levi59

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

sunkart a écrit :
Levi59 a écrit :

Actualise et vérifie le résultat. Dis moi si ca marche

Bon loupé, ça donne le même résultat :
http://img840.imageshack.us/img840/4965 … st1.th.png
Uploaded with ImageShack.us

Je pense que ça doit venir d'echo.

Bin là je perd mon latin... Il faudrait vraiment qu'un spécialiste nous donne son avis.

Peut-être en essayant de lancer le script à la mano pour voir si le script fonctionne... Puis vérifier le contenu du fichier /tmp/infosdd

Si le fichier est corrompu, c'est la commande, si non, c'est conky qui pose problème...

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

Hors ligne

#2718 Le 25/08/2010, à 03:53

lifala

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

mini_599646Capture.png

je bosse sur ce conky en ce moment, clairement inspiré des script lua que j'ai trouvé, ben parce que je n'y connaissait rien wink. peut on mettre des aiguille? et oui un compteur sans aiguille c'est pas gégé!!!

peu on faire clignoté des chose aussi? comme les voyan des clignotant? affiché des voya rouge ou vert? enfin je pense qu'on ce comprend...

conkyrc

# -- Conky settings -- #
background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2
 
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 2048
imlib_cache_size 0
 
# -- Window specifications -- #
 
own_window no
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
 
border_inner_margin 100
border_outer_margin 1
 

alignment top_left
gap_x 0
gap_y 0
 
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
 
# -- Text settings -- #
use_xft yes
xftfont ethnocentric:size=16
xftalpha 0.4
 
uppercase no

#colors
#good blue 1994d1
#medium blue 083146
#dark blue 041e2c
#lime 86c113
color1 cdcdcd
color2 86c113
color3 1994d1
color4 aa0000
 
default_color EEEEEE
 
# -- Lua load -- #
lua_load ~/.config/conky/rings.lua
#lua_load ~/.config/conky/text.lua
lua_draw_hook_pre main_rings
#lua_draw_hook_post draw_text
 
TEXT

${voffset 320}${color #3782BF}${goto 485}${platform coretemp.0 temp 1}°C ${goto 750}${platform coretemp.1 temp 1}°C $font $color
${font ethnocentric:pixelsize=14}${color #A3A3A3}${voffset 15}${goto 485}Core0 ${goto 755}Core1${voffset -08}
${font ethnocentric:pixelsize=16}${voffset 45}${color #3782BF}${goto 950}${exec nvidia-settings -q gpucoretemp | grep '):' | awk '{print $4}'}°C${goto 470}
${voffset -20}${goto 303}${memperc}%${voffset 15}${goto 612}${freq_g}Ghz
${color #A3A3A3}${font ethnocentric:pixelsize=12}${goto 394}${voffset 27}down: ${downspeed eth0}${voffset 3}${goto 810}up: ${upspeed eth0}
$font${voffset 07}${goto 389}${downspeedgraph eth0 25,90 5e7b7b d8deeb}${voffset 3}${goto 804}${upspeedgraph eth0 25,90 99c8e8 618094}

ano.lua

--[[ RINGS with SECTORS widget
	v1.0 by wlourf (08.08.2010)
	this widget draws a ring with differents effects 
	http://u-scripts.blogspot.com/2010/08/rings-sectors-widgets.html
	
To call the script in a conky, use, before TEXT
	lua_load /path/to/the/script/rings.lua
	lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT


Parameters are :
3 parameters are mandatory
name		- the name of the conky variable to display,
			  for example for {$cpu cpu0}, just write name="cpu"
arg			- the argument of the above variable,
			  for example for {$cpu cpu0}, just write arg="cpu0"
		  	  arg can be a numerical value if name=""
max			- the maximum value the above variable can reach,
			  for example for {$cpu cpu0}, just write max=100
	
Optional parameters:
xc,yc		- coordinates of the center of the ring,
			  default = middle of the conky window
radius		- external radius of the ring, in pixels,
			  default = quarter of the width of the conky window
thickness	- thickness of the ring, in pixels, default = 10 pixels
start_angle	- starting angle of the ring, in degrees, value can be negative,
			  default = 0 degree
end_angle	- ending angle of the ring, in degrees,
			  value must be greater than start_angle, default = 360 degrees
sectors		- number of sectors in the ring, default = 10
gap_sectors - gap between two sectors, in pixels, default = 1 pixel
cap			- the way to close a sector, available values are
				"p" for parallel , default value 
				"r" for radial (follow the radius)
inverse_arc	- if set to true, arc will be anticlockwise, default=false
border_size	- size of the border, in pixels, default = 0 pixel i.e. no border
fill_sector	- if set to true, each sector will be completely filled,
			  default=false, this parameter is inoperate if sectors=1
background	- if set to false, background will not be drawn, default=true
foreground	- if set to false, foreground will not be drawn, default=true

Colours tables below are defined into braces :
{position in the gradient (0 to 1), colour in hexadecimal, alpha (0 to 1)}
example for a single colour table : 
{{0,0xFFAA00,1}} position parameter doesn't matter
example for a two-colours table : 
{{0,0xFFAA00,1},{1,0x00AA00,1}} or {{0.5,0xFFAA00,1},{1,0x00AA00,1}}
example for a three-colours table : 
{{0,0xFFAA00,1},{0.5,0xFF0000,1},{1,0x00AA00,1}}

bg_colour1	- colour table for background,
			  default = {{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
fg_colour1	- colour table for foreground,
			  default = {{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
bd_colour1	- colour table for border,
			  default = {{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}			  

Seconds tables for radials gradients :
bg_colour2	- second colour table for background, default = no second colour
fg_colour2	- second colour table for foreground, default = no second colour
bd_colour2	- second colour table for border, default = no second colour

v1.0 (08 Aug. 2010) original release

]]


require 'cairo'
function conky_main_rings()
-- START PARAMETERS HERE
rings_settings={

	{
	--Ring 1 :seconds
	name="time",
	arg="%S",
	max=60,
	xc=645,
	yc=792,
	radius=88,
	thickness=08,
	sectors=59,
	gap_sectors=06,
	fill_sector=true,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--ring 2 :cpu core0
	name="cpu",
	arg="cpu1",
	max=100,
	xc=510,
	yc=373,
	radius=110,
	thickness=10,
	start_angle=-130,
	end_angle=130,
	sectors=35,
	gap_sectors=10,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--ring 2 :cpu core0
	name="hwmon 0 temp 1",
	arg="",
	max=100,
	xc=510,
	yc=373,
	radius=70,
	thickness=08,
	start_angle=-90,
	end_angle=90,
	sectors=15,
	gap_sectors=08,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--ring 2 :cpu core1
	name="cpu",
	arg="cpu2",
	max=100,
	xc=777,
	yc=373,
	radius=110,
	thickness=10,
	start_angle=-130,
	end_angle=130,
	sectors=35,
	gap_sectors=10,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--ring 2 :cpu core1
	name="hwmon 0 temp 2",
	arg="",
	max=100,
	xc=777,
	yc=373,
	radius=70,
	thickness=08,
	start_angle=-90,
	end_angle=90,
	sectors=15,
	gap_sectors=08,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
        name='hwmon 0 in 3',
        arg='',
        max=100,
        bg_colour=ring_background_color,
        bg_alpha=ring_background_alpha,
        fg_colour=ring_foreground_color2,
        fg_alpha=ring_foreground_alpha,
        xc=777,
	yc=370,
        radius=110,
        thickness=05,
	sectors=12,
	gap_sectors=09,
        start_angle=140,
        end_angle=220,
	},
        {
	--ring 3 : memory
	name="memperc",
	arg="",
	max=100,
	xc=316,
	yc=430,
	radius=55,
	thickness=10,
	start_angle=-180,
	end_angle=180,
	sectors=30,
	gap_sectors=08,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	{
	--ring 3 : swap
	name="swapperc",
	arg="",
	max=100,
	xc=317,
	yc=430,
	radius=35,
	thickness=05,
	start_angle=-90,
	end_angle=90,
	sectors=15,
	gap_sectors=04,
	bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
	fg_colour1={{0,0XFFFF00,0},{0.5,0xFFFF00,1}, {1,0xFFFF00,0}},
	fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
	bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
	},
	}
--END OF PARAMETERS HERE

--main function

	if conky_window==nil then return end

	local cs=cairo_xlib_surface_create(conky_window.display,
		conky_window.drawable, 
		conky_window.visual, conky_window.width, conky_window.height)
	cr=cairo_create(cs)

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

	cairo_destroy(cr)

end




function draw_ring(t)

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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


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

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

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

		 cairo_restore(cr)

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

	cairo_restore(cr)
end


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


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

merci, bye

Dernière modification par lifala (Le 02/09/2010, à 13:16)


conky 1 --- conky 2 --- conkyForecast 2.09 --- Tuto Finch
Lucid minimal + openbox

Hors ligne

#2719 Le 25/08/2010, à 06:38

sunkart

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

Levi59 a écrit :

Bin là je perd mon latin... Il faudrait vraiment qu'un spécialiste nous donne son avis.

Peut-être en essayant de lancer le script à la mano pour voir si le script fonctionne... Puis vérifier le contenu du fichier /tmp/infosdd

Si le fichier est corrompu, c'est la commande, si non, c'est conky qui pose problème...

Le fichier n'est pas corronpu puisque toutes les lignes apparaissent bien dans le fichier infosdd. Par contre, ça part en sucette à l'affichage dans conky.
Peut-être un problème de mémoire tampon pour afficher le contenu d'un fichier dans Conky. Est-ce que genre de chose arrive avec les fichier todo ou autre ? Je n'en utilise pas.


Cyril

Hors ligne

#2720 Le 25/08/2010, à 07:22

Levi59

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

Comme on utilise echo et cat, peut être que cette option pourrait régler bien des choses:

text_buffer_size 2048        #Taille du cache pour le texte

Hors ligne

#2721 Le 25/08/2010, à 07:33

maaduck

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

lifala a écrit :

http://img203.imageshack.us/img203/5600 … e6a.th.png

je bosse sur ce conky en ce moment, clairement inspiré des script lua que j'ai trouvé, ben parce que je n'y connaissait rien wink. peut on mettre des aiguille? et oui un compteur sans aiguille c'est pas gégé!!!

peu on faire clignoté des chose aussi? comme les voyan des clignotant? affiché des voya rouge ou vert? enfin je pense qu'on ce comprend...

merci, bye

je cherche aussi de mon coté pour faire un compteur avec aiguille, pour le moment j'ai rien trouver de bon.. j'essai de voir si on peut réutiliser le script LUA de l'horloge cité par woulf ici

mais ne sachant pas crer ou modifier un quelconque script je suis perdu lol

Hors ligne

#2722 Le 25/08/2010, à 08:34

sunkart

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

Levi59 a écrit :

Comme on utilise echo et cat, peut être que cette option pourrait régler bien des choses:

text_buffer_size 2048        #Taille du cache pour le texte
Documentation Officiel Conky a écrit :

text_buffer_size : Size of the standard text buffer (default is 256 bytes). This buffer is used for intermediary text, such as individual lines, output from $exec vars, and various other variables. Increasing the size of this buffer can drastically reduce Conky's performance, but will allow for more text display per variable. The size of this buffer cannot be smaller than the default value of 256 bytes.

D'après la définition sur le site de Conky ça devrait correspondre. Je testerai ce soir.


Cyril

Hors ligne

#2723 Le 25/08/2010, à 14:23

lifala

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

@ maaduck

je fais mes recherche et je poste je suis ça avec toi.

bye


conky 1 --- conky 2 --- conkyForecast 2.09 --- Tuto Finch
Lucid minimal + openbox

Hors ligne

#2724 Le 25/08/2010, à 17:04

sunkart

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

@Levi59

Le buffer permet bien  de tout afficher correctement, dc problème résolu lol


Cyril

Hors ligne

#2725 Le 25/08/2010, à 17:37

Medieval__Times

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

Bonjour je n'ai pas l'intention de passer les 109 pages mais est-ce qu'il y a un moyen de faire en sorte que le débit internet soit le combiner de eth0 et wlan0 ? big_smile

MERCI d'avance pour les réponses


Archlinux est un environnement KISS que j'ai adopté avec OpenBox en standalone !!! 184Mo de RAM d'utilisé après démarrage (ordinateur Principale)... que dire de plus !?! Ah oui, une pure merveille à ne pas prendre à la légère. Dépendance d'ArchLinux garantie à 96% si l'on prend le temps de l'apprivoisé correctement !!!

Hors ligne