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.

#901 Le 20/08/2011, à 13:24

clapico

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

torpedolos a écrit :

Et sinon c'est quoi "load" ?

Taux de transfert la dernière mn/les 5 dernières mn/ les 15 dernières mn

torpedolos a écrit :

j'ai mis le temps écoulé depuis le dernier démarrage...

${color3}Session démarrée depuis: ${color1} $uptime

Ça, j'en veux pas, ça me ferait peur de savoir wink

Plein de commandes conky ICI


http://www.clapico.com/ : mon p'tit blog avec mes p'tits trucs et mes p'tites découvertes de p'tit Ubuntéro

Hors ligne

#902 Le 20/08/2011, à 15:16

clapico

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

torpedolos a écrit :

Par contre il a encore la ré-actualisation qui lui grattouille la truffe, faut faire gaffe, ça a vite fait de te griffer ces

C'est bon, il a rentré ses griffes wink

1313847407.png

Dernière modification par clapico (Le 20/08/2011, à 15:37)


http://www.clapico.com/ : mon p'tit blog avec mes p'tits trucs et mes p'tites découvertes de p'tit Ubuntéro

Hors ligne

#903 Le 21/08/2011, à 22:58

torpedolos

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

clapico a écrit :

Plein de commandes conky ICI

Ah ouais, bon a savoir, moi j'utilisais celui-là: http://doc.ubuntu-fr-secours.org/astuce … ables.html


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

Hors ligne

#904 Le 22/08/2011, à 06:30

chepioq

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

torpedolos a écrit :
clapico a écrit :

Plein de commandes conky ICI

Ah ouais, bon a savoir, moi j'utilisais celui-là: http://doc.ubuntu-fr-secours.org/astuce … ables.html

Tant qu'a indiquer le lien vers les variables, autant indiquer aussi le lien vers la configuration (la partie avant TEXT) ; http://conky.sourceforge.net/config_settings.html


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

Hors ligne

#905 Le 22/08/2011, à 13:44

Levi59

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

Et je rappel pour ceux qui utilisent gedit (ou tout autre logiciel d’édition utilisant gtksourceview) qu'il existe un fichier pour activer la coloration synthaxique du code lors de l'edition ICI

Hors ligne

#906 Le 22/08/2011, à 20:04

shamen456

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

Bonjour a tous...

grace au script que chepioq m'a renseigné (merci a MrPeachy pour le script..) j'ai terminé mon barometre lua...
ca ressemble à ca :
Barometre conky

voici les differents codes
conkyrc_baro

#==============================================================================
#                                 conkyrc_barotext
#
#  author  : SLK for the original Lua ring script
#  modified by shamen456 
#  version : v2011-08-21
#  license : Distributed under the terms of GNU GPL version 2 or later
#  for more conky screenshots visit http://shamen456.deviantart.com/
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048
minimum_size 200 00
maximum_size 
#maximum_width 
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 2
border_outer_margin 2
alignment br

gap_x 230
gap_y 10


draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes



override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no
short_units yes

default_color FFFFFF
color1 D2CBC1
color2 red #red, color of current T°
color3 blue #color of feels like T°
color4 B1ADA7
color5 7B7870
color6 3F3C36
color7 black #text color

lua_load ~/.conky/baro/baro.lua
lua_draw_hook_pre main

lua_load ~/.conky/baro/textwriting.lua
lua_draw_hook_post draw_text

TEXT
${image ~/.conky/baro/bigpanel2.png  -s 200x200 -p +0,-5}${font URW Chancery L:style=Bold:size=10}${image /usr/share/conkyforecast/images/weathericons/00.png  -s 40x40 -p 2,90}${image /usr/share/conkyforecast/images/weathericons/40.png  -s 40x40 -p 2,50}${image /usr/share/conkyforecast/images/weathericons/09.png  -s 40x40 -p 25,20}${image /usr/share/conkyforecast/images/weathericons/39.png  -s 40x40 -p 60,0}${image /usr/share/conkyforecast/images/weathericons/28.png  -s 40x40 -p 100,0}${image /usr/share/conkyforecast/images/weathericons/30.png  -s 40x40 -p 135,20}${image /usr/share/conkyforecast/images/weathericons/34.png  -s 40x40 -p 145,50}${image /usr/share/conkyforecast/images/weathericons/32.png  -s 40x40 -p 150,90}



${color7}${voffset 6}${alignc}${execi 1800 conkyForecast --location=XXXX0000 --datatype=CN}   
${color7}${voffset 0}${goto 75}${execi 1800 conkyForecast --location=XXXX0000 --datatype=BR}
${font URW Chancery L:style=Bold:size=8}${goto 82}${voffset -8}(${execi 1800 conkyForecast --location=XXXX0000 --datatype=BD})
${voffset 10}${font URW Chancery L:style=Bold:size=8}${goto 10}Current T°${goto 142}Feels Like
${voffset -8}${font URW Chancery L:style=Bold:size=14}${goto 14}${color2}${execi 1800 conkyForecast --location=XXXX0000 --datatype=HT}${goto 146}${color3}${execi 1800 conkyForecast --location=XXXX0000 --datatype=LT }

baro.lua

--==============================================================================
--                                 baro.lua
--
--  author  : SLK-adapted by shamen456
--  version : v2011-06-13
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'


--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {

{
    name='cpu',                arg='',                      max_value=1060, sub_value=960,
    x=100,                          y=100,
    graph_radius=60,
    graph_thickness=10,
    graph_start_angle=235,
    graph_unit_angle=2.5,          graph_unit_thickness=2.,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.4,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0x000000,       hand_fg_alpha=.0,
    txt_radius=20,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=50,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.8,
},
{
    name='execpi',                arg='1800 conkyForecast --location=XXXX0000 --datatype=BR -u',                      max_value=1050, sub_value=950,
    x=100,                          y=100,
    graph_radius=25,
    graph_thickness=60,
    graph_start_angle=255,
    graph_unit_angle=2.1,          graph_unit_thickness=2.,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.4,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0x000000,       hand_fg_alpha=.5,
    txt_radius=20,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=50,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=1,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.8,
},
{
    name='execi',                arg='1800 conkyForecast --location=XXXX0000 --datatype=LT -u -x',  
    max_value=60,                   sub_value=-30,--valeur de depart du graphe
    x=100,                          y=130,
    graph_radius=20,
    graph_thickness=40,
    graph_start_angle=75,
    graph_unit_angle=2.33,          graph_unit_thickness=1.5,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.4,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0x00FFFF,       hand_fg_alpha=1,
    txt_radius=18,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xC0C0FF,        txt_fg_alpha=0,
    graduation_radius=20,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=11.6,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='execi',                arg='1800 conkyForecast --location=XXXX0000 --datatype=HT -u -x',                      max_value=60, sub_value=-30,
    x=100,                          y=130,
    graph_radius=20,
    graph_thickness=40,
    graph_start_angle=75,
    graph_unit_angle=2.33,          graph_unit_thickness=1.5,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0xED7F77,       hand_fg_alpha=1,
    txt_radius=30,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xED7F77,        txt_fg_alpha=0,
    graduation_radius=22,
    graduation_thickness=14,        graduation_mark_thickness=2,
    graduation_unit_angle=23.3,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=1,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},

}

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

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

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

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

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

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

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

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
    cairo_set_font_size (display, txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)

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


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

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then 
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
    
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    
    if update_num > 5 then
        go_gauge_rings(display)
    end

end

textwriting.lua

--[[circlewriting by mrpeachy (2010)]]
require 'cairo'
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end

function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end

function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2)
end
end

function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end

function conky_draw_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)



--circlewriting variable
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=("Tempete - Pluie - Variable - Beau - Tres Sec")
--text=("Stormy - Rain - Change - Fair - Very Dry") 
--font name must be in quotes
font="URW Chancery L"
fontsize=9
radius=56
positionx=100
positiony=100
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=-115
finish=115
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variables
--mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=(" 0 ")
--font name must be in quotes
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=150
finish=144
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("50")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=268
finish=262
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("40")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=245
finish=239
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("30")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=222
finish=216
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("20")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=199
finish=193
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("10")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=176
finish=170
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("-10")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=134
finish=124
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("-20")
font="URW Chancery L"
fontsize=8
radius=38
positionx=100
positiony=130
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=112
finish=99
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
[[--circlewritingdown variable
hdd=tonumber(conky_parse('${fs_used_perc /}'))
--text must be in quotes
text=("FILESYS " .. (addzero100(hdd)) .. "%") 
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=80
positionx=260
positiony=280
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=180
finish=0
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)]]

[[--circlewriting variables
swap=tonumber(conky_parse('${swapperc}'))
--text must be in quotes
text=("SWAP " .. (addzero100(swap)) .. "% ") 
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=60
positionx=105
positiony=130
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=200
finish=340
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)]]


end
end

pour ceux qui desirent le package complet, j'ai posté un .zip sur deviant

deviant art - shamen456 baro

bon conky a tous...

Hors ligne

#907 Le 22/08/2011, à 21:04

shamen456

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

@clapico : ton fond d'ecran Ocelot m'a donné envie d'adapter les couleurs de mes conky... voici le résultat (moins détaillé que le tien mais ça me suffit...:) faudra que je retravaille la météo...

ocelot
conkyrc

#==============================================================================
#                                 conkyrc_arc
#
#  author  : SLK-modified by shamen456
#  version : v2011-06-13
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 0
gap_y 28

minimum_size 120 0
maximum_size 
#maximum_width 
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 2
border_outer_margin 2
alignment tr

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no


override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no

default_color FFFFFF
color1 D2CBC1
color2 167AAB #309FD4 #ED7F77 #color of lower bars
color3 6B6860
color4 C0C6FF #B1ADA7 #color of empty arcs and HDD Temp bar
color5 7B7870
color6 3F3C36
color7 black

lua_load ~/.conky/arcs_blue.lua
lua_draw_hook_pre main

TEXT
#${image ./pix/bigpanel2.png  -s 130x395 -p +0,-10}
${voffset 0}${goto 20}${font Ubuntu:size=7,weight:bold}${color}System ${hr 1}
${goto 20}${font Ubuntu:size=7,weight:normal}${color}Kernel ${kernel}${font Ubuntu:size=7,weight:bold}
${goto 89}${voffset 4}RAM
${voffset 6}${goto 89}${font Ubuntu:size=7,weight:bold}CPU
${voffset -1}${goto 84}${cpugraph 15,38 C0C6FF 167AAB}
${goto 75}${font Ubuntu:size=14,weight:normal}${hwmon 0 temp 1} °C
${voffset 5}${goto 85}${color2}${hr 7}${font Ubuntu:size=7,weight:normal}
${voffset -12}${goto 88}${color}${font Ubuntu:size=6,weight:bold}CPU 1
${voffset -3}${goto 85}${color2}${hr 7}
${voffset -9}${goto 88}${color}${font Ubuntu:size=6,weight:bold}CPU 2
${voffset 15}${goto 85}${color7}${hr 25}
${color4}${voffset -15}${goto 89}${font Ubuntu:size=6,weight:bold}${mem}
${voffset -1}${goto 85}${font Ubuntu:size=6,weight:bold} /${memmax}
${voffset 0}${goto 20}${color}Top CPU
${voffset -3}${goto 30}${color2}${top cpu 1}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top name 1}
${voffset -3}${goto 30}${color1}${top cpu 2}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top name 2}
${voffset -3}${goto 30}${color1}${top cpu 3}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top name 3}
${voffset 0}${goto 20}${color}${font Ubuntu:size=6,weight:bold}Top RAM
${voffset -3}${goto 30}${color2}${top_mem mem 1}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top_mem name 1}
${voffset -3}${goto 30}${color1}${top_mem mem 2}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top_mem name 2}
${voffset -3}${goto 30}${color1}${top_mem mem 3}% ${goto 65}${font Ubuntu:size=6,weight:normal}${top_mem name 3}
### Network
${goto 20}${voffset 2}${font Ubuntu:size=7,weight:bold}${color}Network ${hr 1}
${font Ubuntu:size=7,weight:normal}
#${alignr}SSID : ${wireless_essid wlan0}  
${font Ubuntu:size=6,weight:bold}${goto 85}${voffset 3}${color7}${hr 22}
${color4}${voffset -15}${alignr}${wireless_bitrate wlan0}  
${color}${goto 78}${voffset 1}${font Ubuntu:size=6,weight:bold}U${alignr}${totalup wlan0}  
${goto 84}${voffset 5}${upspeedgraph wlan0 28,38 C0C6FF 167AAB}
${alignr}${voffset -8}${font Ubuntu:size=6,weight:bold}${upspeed wlan0}/s 
${alignr}${voffset 10}${font Ubuntu:size=6,weight:bold}${downspeed wlan0}/s 
${goto 84}${voffset -4}${downspeedgraph wlan0 28,38 C0C6FF 167AAB}
${goto 85}${voffset 6}${color7}${hr 24}
${goto 78}${voffset -15}${color}${font Ubuntu:size=6,weight:bold}D${alignr}${totaldown wlan0}  
${color4}${voffset 0}${font Ubuntu:size=6,weight:bold}${alignr}Signal   
${color}${font Ubuntu:size=7,weight:normal}${voffset 10}${goto 20}SSID : ${wireless_essid wlan0}
${color}${voffset 0}${font Ubuntu:size=6,weight:bold}${alignr}${addr wlan0} 
${alignr}${texeci 3600 wget -O - http://ip.tupeux.com | tail}
###HDD
###sda
${voffset 0}${goto 20}${font Ubuntu:size=7,weight:bold}${color}HDD ${hr 1}
${goto 30}${font Ubuntu:size=7,weight:bold}sda${color}${font Ubuntu:size=7,weight:bold}${goto 85}${voffset 6}${color4}${hr 10}
${voffset -8}${goto 85}${color7}${font Ubuntu:size=7,weight:bold}${font Ubuntu:size=8,weight:bold}${voffset -2}${execi 10 hddtemp /dev/sda | cut -c33-38}
${voffset -1}${goto 84}${diskiograph /dev/sda1 20,38 C0C6FF 167AAB}
${voffset -34}${goto 86}${color}${font Ubuntu:size=5,weight:bold}${diskio sda1}/s#${voffset 0}${goto 84}${diskiograph /dev/sdb1 18,38 B1ADA7 ED7F77}#${voffset -25}${goto 86}${color}${font Ubuntu:size=5,weight:bold}${diskio sdb1}/s
${voffset 25}${color}${goto 77}${font Ubuntu:size=8,weight:bold}${fs_free_perc /home}% Free${font Ubuntu:size=5,weight:bold}
${voffset 9}${goto 85}${color2}${hr 20}
${goto 86}${voffset -14}${color}${font Ubuntu:size=6,weight:bold}T  ${fs_size /home}
${goto 86}${voffset -0}${color}${font Ubuntu:size=6,weight:bold}U  ${fs_used /home}
${voffset 5}${goto 85}${color2}${hr 10}
${goto 86}${voffset -10}${color}${font Ubuntu:size=6,weight:bold}F  ${fs_free /home}
#####
#####sdb
#####
${goto 30}${font Ubuntu:size=7,weight:bold}sdb${color}${font Ubuntu:size=7,weight:bold}${goto 85}${voffset 9}${color4}${hr 10}
${voffset -8}${goto 85}${color7}${font Ubuntu:size=7,weight:bold}${font Ubuntu:size=8,weight:bold}${voffset -2}${execi 10 hddtemp /dev/sdb | cut -c33-38}
${voffset -1}${goto 84}${diskiograph /dev/sdb1 20,38 C0C6FF 167AAB}
${voffset -34}${goto 86}${color}${font Ubuntu:size=5,weight:bold}${diskio sdb1}/s#${voffset 0}${goto 84}${diskiograph /dev/sdb1 18,38 B1ADA7 ED7F77}#${voffset -25}${goto 86}${color}${font Ubuntu:size=5,weight:bold}${diskio sdb1}/s
${voffset 25}${color}${goto 77}${font Ubuntu:size=8,weight:bold}${fs_free_perc /media/Data}% Free${font Ubuntu:size=5,weight:bold}
${voffset 9}${goto 85}${color2}${hr 20}
${goto 86}${voffset -14}${color}${font Ubuntu:size=6,weight:bold}T  ${fs_size /media/Data}
${goto 86}${voffset -0}${color}${font Ubuntu:size=6,weight:bold}U  ${fs_used /media/Data}
${voffset 5}${goto 85}${color2}${hr 10}
${goto 86}${voffset -10}${color}${font Ubuntu:size=6,weight:bold}F  ${fs_free /media/Data}

arcs_blue.lua

--==============================================================================
--                                 arcs.lua
--
--  author  : SLK-adapted by shamen456
--  version : v2011-06-13
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'


--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {

{
    name='cpu',                arg='',                      max_value=100,
    x=85,                          y=100,
    graph_radius=48,
    graph_thickness=50,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.,
    graph_bg_colour=0x000000,      graph_bg_alpha=0.2,
    graph_fg_colour=0xC0C6FF,      graph_fg_alpha=0,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=0,
    txt_radius=68,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=56,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=85,                          y=100,
    graph_radius=26,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.2,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.3,
    txt_radius=14,
    txt_weight=0,                  txt_size=12.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=85,                          y=100,
    graph_radius=34,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.2,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.3,
    txt_radius=46,
    txt_weight=0,                  txt_size=12.0,
    txt_fg_colour=0xff0000,        txt_fg_alpha=0.0,
    graduation_radius=33,
    graduation_thickness=12,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=85,                          y=100,
    graph_radius=30,
    graph_thickness=18,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.,
    graph_fg_colour=0xff0000,      graph_fg_alpha=0.0,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=1.0,
    txt_radius=45,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.8,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=85,                          y=100,
    graph_radius=54,
    graph_thickness=10,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=1,
    txt_radius=68,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1,
    graduation_radius=56,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},

{
    name='cpu',                arg='',                      max_value=100,
    x=85,                          y=500,
    graph_radius=28,
    graph_thickness=30,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.,
    graph_bg_colour=0x000000,      graph_bg_alpha=0.2,
    graph_fg_colour=0xC0C6FF,      graph_fg_alpha=0,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=0,
    txt_radius=68,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=6,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',                    arg='/home',                  max_value=100,
    x=85,                          y=500,
    graph_radius=20,
    graph_thickness=20,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.4,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.8,
    txt_radius=20,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0,
    graduation_radius=27,
    graduation_thickness=12,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    --name='hddtemp',                    arg='-n /dev/sda',                  max_value=100,
name='execp ',                arg='hddtemp -n /dev/sda',                      max_value=100,
    x=85,                          y=500,
    graph_radius=40,
    graph_thickness=10,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.2,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.3,
    txt_radius=40,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0,
    graduation_radius=48,
    graduation_thickness=2,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                arg='',                      max_value=100,
    x=85,                          y=600,
    graph_radius=28,
    graph_thickness=30,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.,
    graph_bg_colour=0x000000,      graph_bg_alpha=0.2,
    graph_fg_colour=0xC0C6FF,      graph_fg_alpha=0,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=0,
    txt_radius=68,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=6,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',                    arg='/media/Data',                  max_value=100,
    x=85,                          y=600,
    graph_radius=20,
    graph_thickness=20,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.4,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.8,
    txt_radius=20,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0,
    graduation_radius=27,
    graduation_thickness=12,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    --name='hddtemp',                    arg='-n /dev/sda',                  max_value=100,
name='execp ',                arg='hddtemp -n /dev/sdb',                      max_value=100,
    x=85,                          y=600,
    graph_radius=40,
    graph_thickness=10,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.2,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.3,
    txt_radius=40,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0,
    graduation_radius=48,
    graduation_thickness=2,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='upspeedf',                    arg='',                  max_value=100,
    x=85,                          y=325,
    graph_radius=44,
    graph_thickness=56,
    graph_start_angle=180,
    graph_unit_angle=1.8 ,          graph_unit_thickness=.5,
    graph_bg_colour=0x000000,      graph_bg_alpha=.2,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=0,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.,
    txt_radius=46,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0x4F4B41,        txt_fg_alpha=0.,
    graduation_radius=30,
    graduation_thickness=10,        graduation_mark_thickness=1,
    graduation_unit_angle=22.5,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='wireless_link_qual_perc',                arg='wlan0',                      max_value=100,
    x=85,                          y=324,
    graph_radius=54,
    graph_thickness=10,
    graph_start_angle=180,
    graph_unit_angle=1.8,          graph_unit_thickness=1.2,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=.7,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=1,
    txt_radius=66,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1,
    graduation_radius=56,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
-- un graphe vide pour dessiner le background car je n'arrive pas a le dessiner avec les valeurs d'angle negatives
{
    name='downspeedf',                    arg='',                  max_value=100,
    x=85,                          y=326,
    graph_radius=28,
    graph_thickness=27,
    graph_start_angle=180,
    graph_unit_angle=.9,          graph_unit_thickness=.5,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=0.3,
    txt_radius=46,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0x4F4B41,        txt_fg_alpha=0.,
    graduation_radius=30,
    graduation_thickness=10,        graduation_mark_thickness=1,
    graduation_unit_angle=22.5,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='downspeedf',                    arg='wlan0',                  max_value=2100,
-- max_value que je voudrais remplacer par une formule
    x=85,                          y=325,
    graph_radius=28,
    graph_thickness=27,
    graph_start_angle=270,
    graph_unit_angle=-.05,          graph_unit_thickness=.5,
-- valeur negative derivee de 90/max_value pour avoir un ring counter clock
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0x4F4B41,      graph_fg_alpha=1,
    hand_fg_colour=0x167AAB,       hand_fg_alpha=1,
    txt_radius=44,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0x4F4B41,        txt_fg_alpha=0.,
    graduation_radius=33,
    graduation_thickness=12,        graduation_mark_thickness=1,
    graduation_unit_angle=18,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='upspeedf',                    arg='wlan0',                  max_value=256,
    x=85,                          y=325,
    graph_radius=28,
    graph_thickness=27,
    graph_start_angle=270,
    graph_unit_angle=.35,          graph_unit_thickness=.5,
    graph_bg_colour=0xC0C6FF,      graph_bg_alpha=1,
    graph_fg_colour=0x167AAB,      graph_fg_alpha=1,
    hand_fg_colour=0x4F4B41,       hand_fg_alpha=1,
    txt_radius=44,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xff0000,        txt_fg_alpha=0.
,
    graduation_radius=30,
    graduation_thickness=10,        graduation_mark_thickness=1,
    graduation_unit_angle=22.5,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.8,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
}

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

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

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

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

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

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

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

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
    cairo_set_font_size (display, txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)

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


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

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then 
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
    
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    
    if update_num > 5 then
        go_gauge_rings(display)
    end

end

Bon conky à tous

Hors ligne

#908 Le 22/08/2011, à 23:30

sunkart

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

Voici mon nouveau conky adapté au nouveau fond d'écran :
bureau

Bon, ce n'est pas dans la même veine que les derniers postés puisque je cherche à gagner en discrétion. Depuis mon premier conky, j'ai fait le ménage dans les infos à afficher.

Donc, 3 conkys le plus discret possible :
Conky du haut : surveillance de la machine (CPU, RAM, T°, espace disque,etc.) les couleurs changent en fonction du pourcentage
Conky haut

${goto 17}${color1}Up: ${color0}${uptime_short}${goto 100}${color1}CPU:${goto 135}${if_match ${cpu} >= 80}${color2}${else}${if_match ${cpu} >= 50}${color3}${else}${if_match ${cpu} >= 20}${color4}${else}${color0}${endif}${endif}${endif}${cpu}%${goto 175}[${freq_g}GHz]${goto 240}${cpugraph 12,30 949494 949494}${goto 275}${color0}${exec sensors | grep temp1 | awk '{ print $2}' | sed 's/\.0°C//g' | sed 's/+//g'}°${goto 300}${exec sensors | grep fan1 | awk '{ print $2}'}RPM${goto 370}${color1}GPU: ${color0}${exec nvidia-settings -q gpucoretemp | grep '):' | awk '{print $4}'| cut -c1-2}°${goto 425}${color1}M/B: ${color0}${exec sensors | grep temp2 | awk '{ print $2}' | sed 's/\.0°C//g' | sed 's/+//g'}°${goto 480}${color1}RAM:${goto 515}${if_match ${memperc} >= 80}${color2}${else}${if_match ${memperc} >= 50}${color3}${else}${if_match ${memperc} >= 20}${color4}${else}${color0}${endif}${endif}${endif}${memperc}%${goto 550}[${mem}]${goto 615}${color1}SWAP: ${if_match ${swapperc} >= 80}${color2}${else}${if_match ${swapperc} >= 50}${color3}${else}${if_match ${swapperc} >= 20}${color4}${else}${color0}${endif}${endif}${endif}${goto 660}${swapperc}%${goto 700}[${swap}]${if_match ${execi 360 aptitude search "~U" | wc -l | tail}==0}${image /home/wahibacyril/UbuntuOne/conky/icones/green_light.png -p 0,2 -s 12x12}${else}${image /home/wahibacyril/UbuntuOne/conky/icones/red_light.png -p 0,2 -s 12x12}${endif}
${color1}SDA:${goto 35}${color0}${execi 10 hddtemp -n /dev/sda}°${goto 60}${diskiograph_read /dev/sda 12,10 844796 844796}${diskiograph_write /dev/sda 12,10 2d7db3 2d7db3}${goto 85}${color1}Films:${goto 125}${if_match ${fs_used_perc /media/Films} >= 85}${color2}${else}${if_match ${fs_used_perc /media/Films} >= 65}${color3}${else}${if_match ${fs_used_perc /media/Films} >= 35}${color4}${else}${color0}${endif}${endif}${endif}${fs_used_perc /media/Films}%${goto 155}${color0}[${fs_used /media/Films}/${fs_size /media/Films}]${goto 270}${color1}Photos:${goto 320}${if_match ${fs_used_perc /media/Photos} >= 85}${color2}${else}${if_match ${fs_used_perc /media/Photos} >= 65}${color3}${else}${if_match ${fs_used_perc /media/Photos} >= 35}${color4}${else}${color0}${endif}${endif}${endif}${fs_used_perc /media/Photos}%${goto 350}${color0}[${fs_used /media/Photos}/${fs_size /media/Photos}]${goto 465}${color1}SDB:${goto 495}${color0}${execi 10 hddtemp -n /dev/sdb}°${goto 520}${diskiograph_read /dev/sdb 12,10 844796 844796}${diskiograph_write /dev/sdb 12,10 2d7db3 2d7db3}${goto 545}${color1}Ubuntu:${goto 595}${if_match ${fs_used_perc /} >= 85}${color2}${else}${if_match ${fs_used_perc /} >= 65}${color3}${else}${if_match ${fs_used_perc /} >= 35}${color4}${else}${color0}${endif}${endif}${endif}${fs_used_perc /}%${goto 625}${color0}[${fs_used /}/${fs_size /}]${goto 740}${color1}Data:${goto 775}${if_match ${fs_used_perc /media/Data} >= 85}${color2}${else}${if_match ${fs_used_perc /media/Data} >= 65}${color3}${else}${if_match ${fs_used_perc /media/Data} >= 35}${color4}${else}${color0}${endif}${endif}${endif}${fs_used_perc /media/Data}%${goto 805}${color0}[${fs_used /media/Data}/${fs_size /media/Data}]${goto 920}${color1}Musiques:${goto 985}${if_match ${fs_used_perc /media/Musiques} >= 85}${color2}${else}${if_match ${fs_used_perc /media/Musiques} >= 65}${color3}${else}${if_match ${fs_used_perc /media/Musiques} >= 35}${color4}${else}${color0}${endif}${endif}${endif}${fs_used_perc /media/Musiques}%${goto 1015}${color0}[${fs_used /media/Musiques}/${fs_size /media/Musiques}]

C'est pas super lisible vu que c'est sur une seule ligne neutral

Conky du bas : ce qui concerne le réseau (débit, statistiques, qui est connecté sur le réseau et le nombre de port ouvert)
Conky net

${color1}Internet:${goto 60}${color5}${downspeed eth0}${goto 120}${downspeedgraph eth0 12,25 1d9bf4 1d9bf4}${color1}${goto 145} | ${color6}${upspeed eth0}${goto 205}${upspeedgraph eth0 12,25 bf5bdc bf5bdc}${goto 235}${color1}Réseau:${goto 290}${execpi 180 /home/wahibacyril/Documents/ubuntu/script/script_ip.sh 192.168.0.11}Portable${color1} | ${execpi 180 /home/wahibacyril/Documents/ubuntu/script/script_ip.sh hd1.freebox.fr}Freebox${color1}${goto 410}Port(s): ${color0}${tcp_portmon 1 65535 count}
${color1}Auj:${goto 30}${color5}${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}${color1} | ${color6}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}${goto 175}${color1}Hier: ${color5}${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}${color1} | ${color6}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}${goto 350}${color1}Week: ${color5}${execi 300 vnstat -w | grep "current week" | awk '{print $3 $4}'}${color1} | ${color6}${execi 300 vnstat -w | grep "current week" | awk '{print $6 $7}'}${goto 540}${color1}Mois: ${color5}${execi 300 vnstat --oneline | cut -d\; -f9}${color1}/${color6}${execi 300 vnstat --oneline | cut -d\; -f10}${goto 710}${color1}Total: ${color5}${execi 300 vnstat --oneline | cut -d\; -f13}${color1} | ${color6}${execi 300 vnstat --oneline | cut -d\; -f14} ${color1}(16/08/2010) 

Le dernier conky affiche aléatoirement les photos.

Je vais voir si je mets la météo qui ne me sert pas plus que ça (comme ce n'est pas les données de Météo France il y a de temps en temps des écarts dans les prévisions)


Cyril

Hors ligne

#909 Le 23/08/2011, à 21:07

torpedolos

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

chepioq a écrit :
torpedolos a écrit :
clapico a écrit :

Plein de commandes conky ICI

Ah ouais, bon a savoir, moi j'utilisais celui-là: http://doc.ubuntu-fr-secours.org/astuce … ables.html

Tant qu'a indiquer le lien vers les variables, autant indiquer aussi le lien vers la configuration (la partie avant TEXT) ; http://conky.sourceforge.net/config_settings.html

Ah ouais, pas béte !

Levi59 a écrit :

Et je rappel pour ceux qui utilisent gedit (ou tout autre logiciel d’édition utilisant gtksourceview) qu'il existe un fichier pour activer la coloration synthaxique du code lors de l'edition ICI

Wouah ! excellent, ça facilite grandement la tache, que ce soit pour les modifs ou les relectures.
Merci !


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

Hors ligne

#910 Le 25/08/2011, à 01:43

Compte anonymisé

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

Bonsoir,

j'ai un léger problème. J'ai utilisé un conky standard dans lequel j'exécute une commande pour avoir les paroles du morceau courant.

# System stats bar

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont unDotum:size=8
xftalpha 0.8
text_buffer_size 2048
 
# Update interval in seconds
update_interval 3.0

# Minimum size of text area
minimum_size 250 5
maximum_width 255
 
# Draw shades?
draw_shades no
 
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
 
# Stippled borders?
stippled_borders 3
 
# border margins
border_margin 9
 
# border width
border_width 10
 
# Default colors 
default_color ffffff
  
# Text alignment, other possible values are commented
alignment top_left
 
# Gap between borders of screen
gap_x 5
gap_y 5


# stuff after 'TEXT' will be formatted on screen
TEXT
${font}${execi 10 lyricsdownloader | fold -sw60 }${font}

Néanmoins j'ai un léger problème. En effet, lorsqu'une chanson a beaucoup de paroles et bien ces dernières sortent de l'écran !

Comme ceci :
6c116ae35f4e3d8f53b25d1d0eb79t.jpg

Du coup j'aimerai savoir s'il est possible de faire deux colonnes pour les paroles et ainsi s'éviter ce genre de problème.

Merci beaucoup !

#911 Le 25/08/2011, à 07:16

shamen456

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

@titou345: je ne sais pas si c'est possible avec conky, mais c'est possible avec gmusicbrowser grâce a ses gadget de bureau. tu sais avoir les paroles sur fond transparent et qui défilent en même temps que la chanson... en plus si tu aimes créer ton propre lecteur, GMB le permet de manière assez simple (via un fichier de code, un peu comme pour conky). Perso j'ai essayé pas mal de lecteur et c'est le plus flexible de tous
va voir à cette adresse pour avoir une idée de ce que c'est : GMB

dans mon post précédent, tu peux voir GMB (une config perso) en bas à gauche (couverture et paroles) et en bas à droite sous forme de colonne avec fond transparent et qui reste en avant plan pour les contrôles.

la dernière version est très stable (1.1.7) et en cherchant sur le site tu trouvera les fichiers tar.gz sur la page "download" et dans le forum de GMB tu trouveras le ppa pour ubuntu

bon conky à tous

Dernière modification par shamen456 (Le 25/08/2011, à 07:25)

Hors ligne

#912 Le 25/08/2011, à 10:22

sunkart

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

Hello,

Au pro des conkys et autre script, à votre avis, est-ce qu'il est possible enregistrer dans un fichier certaines informations présentes dans le conky de façon périodique ?

A+


Cyril

Hors ligne

#913 Le 25/08/2011, à 10:33

Compte anonymisé

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

@shamen456 Tu penses que c'est possible de ne pas avoir de fond et d'avoir l'impression que les paroles sont incrustées au fond d'écran ?

#914 Le 26/08/2011, à 08:23

shamen456

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

@titou345 : oui bien sur, regarde la capture d’écran ci-dessous

GMG

les paroles se trouvent sur l’écran, avec un fond complètement transparent et défilent avec la chanson, la barre de contrôle à droite est configurée pour être toujours au premier plan et la boite d'infos à gauche dispose d'un fond partiellement transparent. tu sais dimensionner le widget et le placer ou tu veux sur l’écran

Dernière modification par shamen456 (Le 26/08/2011, à 09:18)

Hors ligne

#915 Le 26/08/2011, à 11:40

Compte anonymisé

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

Merci beaucoup shamen456. Néanmoins j'ai déjà eu l'occasion de tester gmuscibroswer et je ne l'ai pas vraiment aimé ( sauf pour la gestion des tags ). De plus j'ai réussi à faire ce que je voulais en créant un deuxième conky. Sur le premier je met les 60 premières lignes et sur le second le reste. smile

#916 Le 26/08/2011, à 15:53

Levi59

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

titou345 a écrit :

Du coup j'aimerai savoir s'il est possible de faire deux colonnes pour les paroles et ainsi s'éviter ce genre de problème.

Merci beaucoup !

Peux tu essayer ceci? je ne promets rien car je n'ai fait que quelques essais mais ça devrait marcher! wink
je l'ai nommé "cldformater" pour "conky lyricdownloader formater" mais à toi de voir si tu veux le renommer! wink

#!/bin/bash
# Permet d'afficher les paroles de lyricsdownloader sur 2 colonnes
# lorsque le texte dépasse un certain nombre de lignes.
# Copyright (C) 26 Aout 2011, Rombeaut Rodolphe
# http://scriptam.over-blog.com/
# Released into the public domain.


#nombre de ligne maximum pour une colonne
MAX=30

#1 colonne, présentation conky si moins de $MAX lignes
BEFORE1='${color1}${alignc}'
AFTER1='${color}'

#2 colonnes, présentation conky si plus de $MAX lignes
BEFORE2='${color1}'
CENTER2='' ##version adaptative du goto déja insérée plus bas
AFTER2='${color}'

#########################################
##      Ne pas toucher la suite        ##
#########################################

MAX=$(($MAX-1))

# Récupération des paroles dans une liste
PAROLES=()
i=0
while read
do
    PAROLES+=( "${REPLY}" )
    [ $i -lt $MAX ] && {
        [ ${LENGHT:=0} -lt ${#REPLY} ] && LENGHT=${#REPLY}
    }
    ((i++))
done < <(lyricsdownloader)   #pas testé!! Possibilité de rajouter " | fold -sw60" à la commande?

# Affichage dans conky
[ ${#PAROLES[@]} -lt 2 ] && {
    echo "${BEFORE1}Pas de paroles${AFTER1}"
    exit
}
[ $((${#PAROLES[@]}-1)) -lt $MAX ] && {
    for i in ${!PAROLES[@]}
    do 
        echo "${BEFORE1}${PAROLES[i]}${AFTER1}"
    done
} || {
    for i in $(seq $MAX $((${#PAROLES[@]}-1)))
    do
        [ -z "${PAROLES[i]}" ] && {
            j=$(($i+1))
            break
        }
    done
    
    for i in $(seq 0 $(($j-2)))
    do 
        echo "${BEFORE2}${PAROLES[i]}${CENTER2}\${goto $(( ($LENGHT*5) +10 ))}${PAROLES[i+j]}${AFTER2}"
    done
}

exit

Tu le lance ainsi (Pour le temps, j'avais des temps de téléchargement de plus de 30 secondes parfois donc j'ai laissé plus de temps que toi. @ toi de voir ce qui est le mieux):

${execpi 30 cldformater}

EDIT:
Mise à jour du code

@ noter que les chansons très chargée en paroles vont faire merder conky (Black Eyes Peace par exemple demande un text buffer à plus de 3500 mais fait planter conky! ><)...

Dernière modification par Levi59 (Le 26/08/2011, à 17:03)

Hors ligne

#917 Le 26/08/2011, à 17:40

Compte anonymisé

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

Je suis vraiment désolé mais je ne te suis pas. Tout ce que j'ai fait dans mon conky ce n'est que de la bidouille car mon niveau est très faible. Donc j'ai copié ton script que j'ai mis dans un fichier vierge auquel j'ai accordé la permission d'être exécuté comme un programme. Mais la commande

cldformater

ne fait rien. Je ne vois pas comment faire pour que ton script se lance avec cette commande.

#918 Le 26/08/2011, à 19:02

Levi59

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

Désolé, je l'ai mis dans mon fichier ~/bin qui chez moi est dans le $PATH et donc je peux le lancer sans mettre le chemin du script.

Pour toi ce sera:

${execpi 30 /chemin/vers/cldformater}

Hors ligne

#919 Le 27/08/2011, à 00:43

Compte anonymisé

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

675fe4d4e24bf025588c53f07f449.png

Je ne sais pas pourquoi toutes ces balises sont visibles...

#920 Le 27/08/2011, à 02:09

Levi59

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

bizarre... Chez moi le code est interprété...
UVfeys.jpg

Tu es sûr d'avoir mis le bon code dans conky? je pense à "execpi" (si tu enlèves le "p", le code ne sera pas interprété)

edit : Soit dis en passant, il est pas très efficace ce truc. Une fois sur deux, il me donne pas les bonnes paroles...

Dernière modification par Levi59 (Le 27/08/2011, à 02:28)

Hors ligne

#921 Le 27/08/2011, à 10:24

Compte anonymisé

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

Quel sot je suis. Je n'avais pas fais attention et avait laissé {execi}. Au temps pour moi, ça marche très bien ! Merci beaucoup, 'me reste plus qu'à faire afficher la pochette. smile

#922 Le 28/08/2011, à 11:30

carpediem

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

Salut à tous,
Mon nouveau Conky:

1314523193.png

Je cherche à faire un conky "mais j'y arrive pas hmm" un graphique sur la pression atmosphérique tel les barographes anéroïdes Fischer qui sont utilisés pour mesurer et enregistrer l'historique de la pression atmosphérique.
Je ne sais pas si cela existe déjas ?
Merci à tout ceux qui mon permis à réaliser mon conky.
Cordialement Carpediem


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

Hors ligne

#923 Le 28/08/2011, à 12:25

chepioq

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

carpediem a écrit :

Salut à tous,
Mon nouveau Conky:

http://pix.toile-libre.org/upload/thumb/1314523193.png

Je cherche à faire un conky "mais j'y arrive pas hmm" un graphique sur la pression atmosphérique tel les barographes anéroïdes Fischer qui sont utilisés pour mesurer et enregistrer l'historique de la pression atmosphérique.
Je ne sais pas si cela existe déjas ?
Merci à tout ceux qui mon permis à réaliser mon conky.
Cordialement Carpediem

Très beau conky, très classe... Félicitation...
Pour ta demande  « barographes anéroïdes Fischer » , je ne sais pas...


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

Hors ligne

#924 Le 28/08/2011, à 18:07

carpediem

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

Merci pour ta réponse chepoiq
Je continue à chercher
cordialement carpediem


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

Hors ligne

#925 Le 29/08/2011, à 10:50

sunkart

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

Pour tracer le graphique, rien n'existe directement.
Mais je pense que tu peux tenter avec un script qui enregistre toutes les x min, créer un graphique et l'appeler dans conky big_smile Bref, un sacré truc à développer


Cyril

Hors ligne