Contenu | Rechercher | Menus

Annonce

Si vous rencontrez des soucis à rester connecté sur le forum (ou si vous avez perdu votre mot de passe) déconnectez-vous et reconnectez-vous depuis cette page, en cochant la case "Me connecter automatiquement lors de mes prochaines visites".
Test de l'ISO d'Ubuntu francophone : nous avons besoin de testeurs pour la version francophone d'Ubuntu 14.04. Liens et informations ici.

#551 Le 24/03/2014, à 22:03

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

houps,

${lua gif ~/temp * 0 15 135 135}

le point était en trop.
et pour répondre a ta question, en générale l’extension est après le point, et pas avant, donc je dirais que oui, tes fichiers sont mal nommés, mais sa n'est pas bien grave, ça devrait tout de même fonctionner wink

Hors ligne

#552 Le 24/03/2014, à 22:17

jlfh0816

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Didier-T a écrit :

houps,

${lua gif ~/temp * 0 15 135 135}

le point était en trop.
et pour répondre a ta question, en générale l’extension est après le point, et pas avant, donc je dirais que oui, tes fichiers sont mal nommés, mais sa n'est pas bien grave, ça devrait tout de même fonctionner wink

O  U  I ... enfin, ça marche      !  !  !   big_smile  big_smile  big_smile

Didier-T, je te remercie +++ de tous tes efforts et de ta disponibilité. Sans toi, jamais je n'y serai parvenu. Suis vraiment content et heureux !

Hors ligne

#553 Le 25/03/2014, à 21:33

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

bonsoir loutch,
j'ai modifié l'horloge pour que tu aies tes cercles sur tous les cadrans

--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
 21 Jun 2012 - Chronograph modifications by Sector11
 22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
 23 Jun 2012 - crono.lua by mrprachy - modified by Sector11 23/24 Jun 2012
 24 Jun 2012 - crono_mix - combination of Cronograph.lua and modified crono.lua

use in conkyrc

lua_load /path/crono_mix.lua
lua_draw_hook_pre main
TEXT

-- INDEX (use find with):

-- ###### 12 OR 24 CLOCK FACE
-- SET BORDER OPTIONS ######  ALL CLOCKS

-- ### START CLOCK A ######################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
-- CLOCK A ###### 24 HR TIME

-- ### START DIAL B ### Top - Week Day Names Dial #########
-- ### START DIAL C ### Right - Month Names Dial ##########
-- ### START DIAL D ### Left - Day Numbers Dial ###########

-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
-- CLOCK E HOUR HAND
-- CLOCK E MINUTE HAND SETUP
-- CLOCK E SECOND HAND SETUP
-- CLOCK E ###### 12 HR TIME

TO GET MONTH NAME WHERE THE HOUR # IS FOR THAT MONTH
 mrpeachy wrote:

    the numbers are drawn using a for loop somewhere, like this

    for i=1,12 do
    calculate position of number
    move_to(x,y)
    show_text(i)
    end

    change it to something like this

    for i=1,12 do
    calculate position of number
      if i==month_number then
      move_to(x,y)
      show_text(month_number)
      else
      move_to(x,y)
      show_text(i)
      end
    end ]]


require 'cairo'

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)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ### SETTINGS AREA ######################################
-- ###### 12 OR 24 CLOCK FACE #############################
local clock_type_A=24 -- Large Main 24 HR Clock
local clock_type_E=12 -- Bottom - 12 HR Clock

-- ###### CLOCK SETTINGS ##################################
-- SET BORDER OPTIONS FOR "CLOCKS" ########################
local clock_border_width=2
-- set color and alpha for clock border
local cbr,cbg,cbb,cba=0,0,0,1  -- full opaque white
-- gap from clock border to minute marks
local b_to_m=1

-- ########################################################
-- ### START CLOCK A ######################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=24
-- set mark length
local m_length_A=0
-- set mark width
local m_width_A=0
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,1-- opaque white
-- SETUP HOUR HANDS
-- CLOCK A HOUR HAND
-- longueur aiguille verte
hh_length_A=130
-- épaisseur aiguille verte
hh_width_A=5
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- couleur aiguille verte
hhr,hhg,hhb,hha=0,1,0,1-- fully opaque white
-- SETUP MINUTE HANDS
-- CLOCK A MINUTE HAND SETUP
-- longueur aiguille bleue
mh_length_A=150
-- largeur aiguille bleue +point
mh_width_A=3.2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=0,0,1,1-- fully opaque white
-- SETUP SECOND HANDS
-- CLOCK A SECOND HAND SETUP
-- set length of seconds hand
sh_length_A=160
-- set hour hand width
sh_width_A=1
-- set hour hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
shr,shg,shb,sha=1,0,0,1-- fully opaque red
-- CLOCK A ###### 24 HR TIME
-- position grand cercle noir
clock_radius=172
clock_centerx=175
clock_centery=175
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A
-- set line cap type
cairo_set_line_cap  (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end-- of for loop
-- HOUR MARKS
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A))-- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
--[[ DRAW SECOND HAND
-- calculate degrees for each second
sec_degs=seconds*6
-- set radius to calculate hand points
radius=sh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of seconds hand
point=(math.pi/180)*sec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes
cairo_set_line_width (cr,sh_width_A)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap  (cr, sh_cap)
cairo_stroke (cr) ]]
-- POSITION FOR TEXT HOUR NUMBERS
local center_x=175
local center_y=175
local radius=160
-- FONT
cairo_select_font_face (cr, "URW Chancery L", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 16)
cairo_set_source_rgba (cr,0,0,0,1)
-- TABLE OF TEXT -- in order
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=-1+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- position points grand horloge
local radius=149
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ### END CLOCK A ########################################

-- ########################################################
-- ### START DIAL B ### Top - Week Day Names Dial #########
-- days of week
-- positioning
local center_x=175
local center_y=87
local radius=45
cairo_select_font_face (cr, "URW Chancery L", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 10)
cairo_set_source_rgba (cr,1,1,1,1)
-- table holds text you want to see in order
text_days={"DIM","LUN","JEU","MER","JEU","VEN","SAM",}
-- draw days
local tx_deg=35
for i=1,7 do
start=((360/7)*(i-1))-(tx_deg/2)
circlewriting (text_days[i], "URW Chancery L", 12, radius, center_x, center_y, {0x000000,1}, start, start+tx_deg)
end
-- SET BORDER OPTIONS ########################
local border_width=2
radius=radius+12
-- set color and alpha for border
local cbr,cbg,cbb,cba=0,0,0,1  -- full opaque white
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,border_width)
cairo_arc (cr,center_x,center_y,radius,0,2*math.pi)
cairo_stroke (cr)

--draw points, radius smaller than text circle

local radius=40
for i=1,7 do
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
--draw hand pointing to current day
local hand_length=40--radius for this calculation
local day_number=tonumber(os.date("%w"))
local point=(math.pi/180)*((360/7)*(day_number))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
-- ### END CLOCK B ########################################

-- ########################################################
-- ### START DIAL C ### Right - Month Names Dial ##########
-- DIAL POSITION FOR TEXT
local center_x=261
local center_y=175
local radius=45
cairo_select_font_face (cr, "", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 10)
cairo_set_source_rgba (cr,1,1,1,1)
-- table holds text you want to see in order
text_days={"DEC","JAN","FEV","MAR","AVR","MAI","JUN","JUL","AOU","SEP","OCT","NOV",}
-- draw days
local tx_deg=20
for i=1,12 do
start=((360/12)*(i-1))-(tx_deg/2)
circlewriting (text_days[i], "URW Chancery L", 12, radius, center_x, center_y, {0x000000,1}, start, start+tx_deg)
end
-- SET BORDER OPTIONS ########################
local border_width=2
radius=radius+12
-- set color and alpha for border
local cbr,cbg,cbb,cba=0,0,0,1  -- full opaque white
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,border_width)
cairo_arc (cr,center_x,center_y,radius,0,2*math.pi)
cairo_stroke (cr)

--draw points, radius smaller than text circle

local radius=40
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
--draw hand pointing to current day
local hand_length=35 --radius for this calculation
local day_number=tonumber(os.date("%m"))
local point=(math.pi/180)*((360/12)*(day_number))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
-- ### END CLOCK C ########################################

-- ### START DIAL D ### Left - Day Numbers Dial ###########
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
-- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning
local center_x=87
local center_y=175
local radius=50
cairo_select_font_face (cr, "URW Chancery L", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 8)
cairo_set_source_rgba (cr,0,0,0,1)
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=i
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- SET BORDER OPTIONS ########################
local border_width=2
radius=radius+8
-- set color and alpha for border
local cbr,cbg,cbb,cba=0,0,0,1  -- full opaque white
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,border_width)
cairo_arc (cr,center_x,center_y,radius,0,2*math.pi)
cairo_stroke (cr)

-- INNER POINTS POSITION, radius smaller than text circle
local radius=40
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- DRAW HAND -- snaps to current DAY
local this_day=tonumber(os.date("%d"))
local hand_length=35--radius for this calculation
local point=(math.pi/180)*((360/number_days)*(this_day-1))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
-- ### END CLOCK D ########################################

-- ########################################################
-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
local number_marks_E=12
-- set mark length
local m_length_E=0
-- set mark width
local m_width_E=0
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,0,0,1-- opaque white
-- SETUP HOUR HAND
-- CLOCK E HOUR HAND
-- set length of hour hand
hh_length_E=30
-- set hour hand width
hh_width_E=3
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
hhr,hhg,hhb,hha=0.3,  0.6,  0.9  ,1 -- fully opaque lightblue
-- SETUP MINUTE HAND
-- CLOCK E MINUTE HAND SETUP
-- set length of minute hand
mh_length_E=45
-- set minute hand width
mh_width_E=3
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=0.0,  0.6,  0.9  ,1 -- fully opaque lightblue
-- SETUP SECOND HAND
-- CLOCK E SECOND HAND SETUP
-- longueur troteuse petite montre
sh_length_E=50
-- grosseur points petite montre + trotteuse
sh_width_E=2
-- set hour hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
-- couleur trotteuse petite montre
shr,shg,shb,sha=1,0,0,1 -- fully opaque red
-- CLOCK E ###### 12 HR TIME
-- CLOCK SETTINGS
clock_radius=53
clock_centerx=176
clock_centery=261
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_E
-- set line cap type
cairo_set_line_cap  (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_E)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR SECOND MARKS
for i=1,number_marks_E do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_E))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_E))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end-- of for loop
-- TIME CALCULATIONS CLOCK E
if clock_type_E==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_E==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND
-- get hours minutes seconds as just seconds and draw it
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_E))-- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_E
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_E)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_E
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_E)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
-- DRAW SECOND HAND
-- calculate degrees for each second
sec_degs=seconds*6
-- set radius to calculate hand points
radius=sh_length_E
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of seconds hand
point=(math.pi/180)*sec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes
cairo_set_line_width (cr,sh_width_E)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap  (cr, sh_cap)
cairo_stroke (cr)
-- POSITION texte petite montre
local center_x=175
local center_y=260
local radius=45
-- FONT
cairo_select_font_face (cr, "URW Chancery L", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 12)
cairo_set_source_rgba (cr,0,0,0,1)
-- TABLE OF TEXT -- in order
--text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
-- FOR A 12 HOUR CLOCK WITH THE NUMBERS 13-00
text_days={"00","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- position point petite montre
local radius=36
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ### END CLOCK E ########################################

-- ########################################################
end-- end main function

function circlewriting(text, font, fsize, radi, horiz, verti, text_color, start, finish)
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255, ((col_a[1] / 0x100) % 0x100) / 255, (col_a[1] % 0x100) / 255, col_a[2]
end
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,rgb_to_r_g_b(text_color));
local inum=string.len(text)
local deg=(finish-start)/(inum)
local r2d=(math.pi/180)
        for i=1,inum do
        local cha=string.sub(text,i,i)
        local interval=(r2d*(start+(deg*(i-1))))
        local txs=0+radi*(math.sin(interval))
        local tys=0-radi*(math.cos(interval))
        cairo_move_to (cr, txs+horiz, tys+verti);
        cairo_rotate (cr, interval)
        cairo_show_text (cr, cha)
        cairo_stroke (cr)
        cairo_rotate (cr, -interval)
        end
end--of function

Hors ligne

#554 Le 25/03/2014, à 22:58

loutch

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonsoir

Didier-T

tu es le "king of the lua"  .Encore merci voici ce que cela donne (c'est 2 conky superposés avec 2 lua  )
1395781302.png

@+

Dernière modification par loutch (Le 26/03/2014, à 17:49)

Hors ligne

#555 Le 06/04/2014, à 20:50

TwistedSister

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonsoir, je viens de me mettre au .lua apres une petite absence mais rien ne se lance

root@rhum1:/home/pi# conky -c /home/pi/.conkyrc
Conky: desktop window (a000d4) is subwindow of root window (43)
Conky: window type - override
Conky: drawing to created window (0x1600001)
Conky: drawing to double buffer

Ca reste comme ca indéfiniement....


On Raspbian :D

Hors ligne

#556 Le 06/04/2014, à 21:10

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

bonsoir TwistedSister,
il n'y a pas de message d'erreur, c'est plutot bon signe tongue
essaye donc en passant le window type à normal.

Hors ligne

#557 Le 06/04/2014, à 21:13

TwistedSister

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

RAAAH t'es un dieu ca marche niquel !! merci big_smile


On Raspbian :D

Hors ligne

#558 Le 06/04/2014, à 21:21

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

de rien

Hors ligne

#559 Le 16/04/2014, à 12:41

Skorpion

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour à tous!

J'ai une question: j'aimerais afficher dans mon conky un compteur journalier tout bête (c'est le truc "bateau": j'ai arrêté de fumer, etc... vous voyez le genre).

Est-ce que c'est possible ? J'ai beau chercher partout, rien ne correspond à ce que je recherche. Cela m'étonne d'autant plus que le principe me parait assez simple, mais pas moyen de dénicher ça...

Bref, merci d'avance pour votre aide! wink

(je continue de chercher, en attendant. tongue)


Athlon64 Dual Core 5000+, 2Go de RAM Corsair DDR2, GeForce 8800 GTS, et Ubuntu 12.04. ^^

Hors ligne

#560 Le 16/04/2014, à 16:05

ragamatrix

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Salut Skorpion;
J'ai trouvé ça; peut-être que ça pourra t'aider mais ça fait l'inverse de ce que tu demande ... c'est un countdown....  hmm
ici:http://crunchbang.org/forums/viewtopic. … 03#p279503
et ici en script le chrono et le compte à rebours... : http://crunchbanglinux-fr.org/forum/vie … 973#p39973

Hors ligne

#561 Le 16/04/2014, à 17:56

Skorpion

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Hey, merci beaucoup! big_smile

Je suis déjà passé sur crunchbang.org, mais il y a trèèèèès longtemps, et j'avoue avoir oublié son existence... tongue

Y a certainement quelque chose à faire avec ce que tu m'a trouvé. Je vais étudier tout ça. Merci encore Ragamatrix. wink


Athlon64 Dual Core 5000+, 2Go de RAM Corsair DDR2, GeForce 8800 GTS, et Ubuntu 12.04. ^^

Hors ligne

#562 Le 16/04/2014, à 18:45

ragamatrix

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Skorpion a écrit :

Hey, merci beaucoup! big_smile

Je suis déjà passé sur crunchbang.org, mais il y a trèèèèès longtemps, et j'avoue avoir oublié son existence... tongue

Y a certainement quelque chose à faire avec ce que tu m'a trouvé. Je vais étudier tout ça. Merci encore Ragamatrix. wink

Euh...oui y'a pas mal de ressources au niveau de conky; ainsi qu'une communauté active et réactive comme Didier-T wink
LOOK:conky archives

Hors ligne

#563 Le 23/04/2014, à 14:41

David74

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour,
d'avance je m'excuse si je ne poste pas au bon endroit. C'est que je ne sais pas trop où c'est le plus adéquate, n'hésitez pas à me dire, au besoin, je déplacerai.
Voilà mon problème : j'ai fait une clean instal pour passer de xub 12.04 32 bits à xub 14.04 64 bits. Sous Precise, j'avais un conky qui me notifiait mes mails par conkyemail, provenant du dépot conky-companions. Or, ce dépot n'existe plus après Quantal (je crois, de mémoire). Les commandes pop3_unseen et imap_unseen ne fonctionnent pas chez moi, j'ignore pourquoi. Donc, ma question est : comment notifier les mails dans conky en avril 2014 ?
D'avance merci beaucoup.

Hors ligne

#564 Le 26/04/2014, à 10:08

David74

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Up ?...

Hors ligne

#565 Le 26/04/2014, à 10:22

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour David74,
dit moi tu utilise qui pour tes mails ?

Hors ligne

#566 Le 27/04/2014, à 09:32

loutch

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

smilies%20(204).gif

J'utilise actuellement ce chronographe (que je me suis permis de modifié ,pas tapé) et je voudrais savoir comment faire pour que la petite horloge que j'ai rajouté en bas me donne l'heure d'une autre ville dans le monde .

Voici le lua de Didier-T:

--[[ multiple analogue clocks by Didier-T (forum Ubuntu.fr) - 25 Nov 2012
 Basé sur le travail de mrpeachy et Sector11
26 Nov 2012 - ajout hand_gap et hand_larg Didier-T
01 Dec 2012 - correction bug nb_jour Décembre Didier-T
02 Dec 2012 - ajout mode 24 heures Didier-T


use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

]]

require 'cairo'
--Position et taille horloge
local init={
  {text={"Dim","Lun","Mar","Mer","Jeu","Ven","Sam"},
  nb=7*24,
  formule='jour',
  police="URW Chancery L",
  taille=11,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=105,
  text_radius=30,
  point_radius=20,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=18,
  point_ray=0.5
  },
  {text={""},
  nb="",
  formule='jour_num',
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=110,
  center_y=175,
  text_radius=35,
  point_radius=28,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=27,
  point_ray=0.5
  },
  {text={"Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aôu","Sep","Oct","Nov","Déc"},
  nb="",
  formule='mois',
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=235,
  center_y=175,
  text_radius=35,
  point_radius=26,
  point_ray=1,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=25
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"},
  hour_24=true,
  nb=12*3600, --12 or 24 *3600
  formule='heure',
  police="URW Chancery L",
  taille=22,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0x1540fc,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0x1540fc,
  point_alpha_current=1,
  hand_color=0x1540fc,
  hand_alpha=1,
  center_x=173,
  center_y=175,
  text_radius=145,
  point_radius=148,
  hand_gap=0,
  hand_length=75,
  hand_larg=3.5,
  point_ray=0
  },
  {text={"","1","2","3","4","","6","7","8","9","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59"},
  nb=3600,
  formule='minute',
  police="URW Chancery L",
  taille=12,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xff0000,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xff0000,
  point_alpha_current=1,
  hand_color=0xff0000,
  hand_alpha=1,
  center_x=174,
  center_y=175,
  text_radius=140,
  point_radius=130,
  point_ray=0.5,
  hand_gap=0,
  hand_larg=3.5,
  hand_length=100
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=60,
  formule='secondes',
  police="URW Chancery L",
  taille=9,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=175,
  text_radius=121,
  point_radius=112,
  point_ray=0.4,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=110,
  progressif=true
  },
  -- petite montre du bas
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"},
  hour_24=false,
  nb=12*3600, --12 or 24 *3600
  formule='heure',
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=0.4,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=0.4,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=35,
  point_radius=28,
  hand_gap=0,
  hand_length=20,
  hand_larg=1.5,
  point_ray=0
  },
  {text={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=3600,
  formule='minute',
  police="URW Chancery L",
  taille=9,
  text_color=0xa8a8a8,
  text_alpha=0,
  text_color_current=0xffffff,
  text_alpha_current=0,
  point_color=0xffffff,
  point_alpha=0,
  point_color_current=0xffffff,
  point_alpha_current=0,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=25,
  point_radius=20,
  point_ray=0,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=28
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=60,
  formule='secondes',
  police="URW Chancery L",
  taille=9,
  text_color=0xffffff,
  text_alpha=0,
  text_color_current=0xffffff,
  text_alpha_current=0,
  point_color=0xffffff,
  point_alpha=0,
  point_color_current=0xffffff,
  point_alpha_current=0,
  hand_color=0xffffff,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=30,
  point_radius=20,
  point_ray=0.5,
  hand_gap=0,
  hand_larg=0,
  hand_length=30,
  progressif=true
  },
  
}

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 cr = cairo_create(cs)
  local extents=cairo_text_extents_t:create()
  tolua.takeownership(extents)
  local h, min, sec=time()
  local jour, jour_num, mois, nb_jour=date()

  if tonumber(conky_parse('${updates}'))>3 then
    for i in pairs(init) do
      draw(cr, extents, init[i], h, min, sec, jour, jour_num, mois, nb_jour)
    end
  end

  cairo_destroy(cr)
  cairo_surface_destroy(cs)
  cr=nil
  collectgarbage()
end

function draw(cr, extents, value, h, min, sec, jour, jour_num, mois, nb_jour)
  local function affichage(cr, extents, j, valeur, value, text, nb)
    if value.progressif == nil then
      value.progressif=false
    end
    if value.progressif==true and j<=valeur then
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, j, cr, value.point_ray)
    elseif value.progressif==false and j==valeur then
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, j, cr, value.point_ray)
    else
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color, value.text_alpha, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color, value.point_alpha, j, cr, value.point_ray)
    end
  end
  local pos
  local nb=tonumber(table.getn(value.text))
  cairo_select_font_face (cr, value.police, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
  cairo_set_font_size (cr, value.taille)
-- Section Horloge
  if value.formule=="heure" then
    local text
    nb=value.nb/3600
    if nb==24 then h=tonumber(os.date("%H")) end
    pos=heure(h, min, sec)
    for i=1, nb do
      local j=i-1
      if value.hour_24==true then
        if tonumber(os.date("%H"))<nb then
          text=value.text[i]
        else
          text=value.text[i+12]
        end
      else
        text=value.text[i]
      end
      affichage(cr, extents, j, h, value, text, nb)
    end
  elseif value.formule=="minute" then
    pos=minute(min, sec)
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, min, value, text, nb)
    end
  elseif value.formule=="secondes" then
    pos=sec
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, sec, value, text, nb)
    end
-- Section date
  elseif value.formule=="mois" then
    value.nb, pos=month()
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, mois-1, value, text, nb)
    end
  elseif value.formule=="jour_num" then
    value.nb=nb_jour*24
    nb=nb_jour
    pos=day(jour-1)
    for i=1, nb_jour do
      if math.mod(i, 2) == 0 then
        text=string.format("%02d",i)
      else
        text=""
      end
      local j=i-1
      affichage(cr, extents, j, jour-1, value, text, nb)
    end
  elseif value.formule=="jour" then
    pos=(jour_num*24)+tonumber(os.date("%H"))
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, jour_num, value, text, nb)
    end

-- Horloge avec personnalisée (non utilisé pour le moment)
  else
    pos=tonumber(conky_parse(value.formule))
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      if tonumber(text)==pos then
         texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, i, extents, cr)
        point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, i, cr, value.point_ray)
      else
        texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color, value.text_alpha, i, extents, cr)
        point(nb, value.point_radius, value.center_x, value.center_y, value.point_color, value.point_alpha, i, cr, value.point_ray)
      end
    end
  end

  hand(pos, value.nb, value.text_radius, value.hand_length, value.hand_gap, value.hand_larg, value.center_x, value.center_y, value.hand_color, value.hand_alpha, cr)
end

function date()
  local nb_jour
  local jour=tonumber(os.date("%d"))
  local jour_num=tonumber(os.date("%w"))
  local mois=tonumber(os.date("%m"))
  if mois==12 then
    nb_jour=31
  else
    nb_jour=tonumber(conky_parse("${exec date --date '1 month' +%j}"))-tonumber(conky_parse("${exec date +%j}"))
  end
  return jour, jour_num, mois, nb_jour
end

function day(jour)
  local hjour=(jour*24)+tonumber(os.date("%H"))
  return hjour
end

function month()
  local nb_jours_annee=tonumber(conky_parse("${exec echo $(date --date '31 Dec' +%j)}"))
  local jour_annee=tonumber(conky_parse("${exec echo $(date +%j)}"))
  return nb_jours_annee, jour_annee
end

function time()
  local h=tonumber(os.date("%I"))
  local min=tonumber(os.date("%M"))
  local sec=tonumber(os.date("%S"))
  return h, min, sec
end

function heure(h, min, sec)
  local hs=(h*3600)+(min*60)+sec
  return hs
end

function minute(min, sec)
  local m=(min*60)+sec
  return m
end

function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function texte(police, taille, text, nb, radius, center_x, center_y, color, alpha, i, extents, cr)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(i))
  local x=0+radius*(math.sin(point))
  local y=0-radius*(math.cos(point))
  cairo_text_extents(cr,text,extents)
  local width=extents.width
  local height=extents.height
  cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
  cairo_show_text (cr, text)
  cairo_stroke (cr)
end

function point(nb, radius, center_x, center_y, color, alpha, i, cr, ray)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(i))
  local x=0+radius*(math.sin(point))
  local y=0-radius*(math.cos(point))
  cairo_arc (cr,center_x+x,center_y+y,ray,0,2*math.pi)
  cairo_stroke (cr)
end

function hand(pos, nb, radius, hand_length, hand_gap, largeur, center_x, center_y, color, alpha, cr)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(pos))
  local x_gap=0+hand_gap*(math.sin(point))
  local y_gap=0-hand_gap*(math.cos(point))
  local x=0+hand_length*(math.sin(point))
  local y=0-hand_length*(math.cos(point))
  cairo_move_to (cr,center_x+x_gap,center_y+y_gap)
  cairo_line_to (cr,center_x+x,center_y+y)
  cairo_set_line_width (cr,largeur)
  cairo_set_line_cap  (cr, CAIRO_LINE_CAP_ROUND)
  cairo_stroke (cr)
end

Et l'image:
1398887439.png

21h50 ajout du nom de la ville .

smilies%20(242).gif d'avance et



smilies%20(1).gif

Dernière modification par loutch (Le 30/04/2014, à 21:52)

Hors ligne

#567 Le 30/04/2014, à 09:01

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

@ loutch,
Voici le code modifié, avec ajout d'une variable decalage, actuellement j'ai réglé ce décalage horaire a -1 (pour moins 1 heure).

clock.lua

--[[ multiple analogue clocks by Didier-T (forum Ubuntu.fr) - 25 Nov 2012
 Basé sur le travail de mrpeachy et Sector11
26 Nov 2012 - ajout hand_gap et hand_larg Didier-T
01 Dec 2012 - correction bug nb_jour Décembre Didier-T
02 Dec 2012 - ajout mode 24 heures Didier-T
09 Mar 2014 - ajout alumage progréssif des points de l'horloge
30 Avr 2014 - ajout fonction décalage horaire, pour ajout cadrant ville


use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

]]

require 'cairo'
--Position et taille horloge
local init={
  {text={"Dim","Lun","Mar","Mer","Jeu","Ven","Sam"},
  nb=7*24,
  formule='jour',
  police="URW Chancery L",
  taille=11,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=105,
  text_radius=30,
  point_radius=20,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=18,
  point_ray=0.5
  },
  {text={""},
  nb="",
  formule='jour_num',
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=110,
  center_y=175,
  text_radius=35,
  point_radius=28,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=27,
  point_ray=0.5
  },
  {text={"Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aôu","Sep","Oct","Nov","Déc"},
  nb="",
  formule='mois',
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=235,
  center_y=175,
  text_radius=35,
  point_radius=26,
  point_ray=1,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=25
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"},
  hour_24=true,
  nb=12*3600, --12 or 24 *3600
  formule='heure',
  police="URW Chancery L",
  taille=22,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0x1540fc,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0x1540fc,
  point_alpha_current=1,
  hand_color=0x1540fc,
  hand_alpha=1,
  center_x=173,
  center_y=175,
  text_radius=145,
  point_radius=148,
  hand_gap=0,
  hand_length=75,
  hand_larg=3.5,
  point_ray=0
  },
  {text={"","1","2","3","4","","6","7","8","9","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59"},
  nb=3600,
  formule='minute',
  police="URW Chancery L",
  taille=12,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xff0000,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xff0000,
  point_alpha_current=1,
  hand_color=0xff0000,
  hand_alpha=1,
  center_x=174,
  center_y=175,
  text_radius=140,
  point_radius=130,
  point_ray=0.5,
  hand_gap=0,
  hand_larg=3.5,
  hand_length=100
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=60,
  formule='secondes',
  police="URW Chancery L",
  taille=9,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=1,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=1,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=175,
  text_radius=121,
  point_radius=112,
  point_ray=0.4,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=110,
  progressif=true
  },
  -- petite montre du bas
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"},
  hour_24=false,
  nb=12*3600, --12 or 24 *3600
  formule='heure',
  decalage=-1,
  police="URW Chancery L",
  taille=10,
  text_color=0xffffff,
  text_alpha=0.4,
  text_color_current=0xffffff,
  text_alpha_current=0.4,
  point_color=0xffffff,
  point_alpha=0.4,
  point_color_current=0xffffff,
  point_alpha_current=0.4,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=35,
  point_radius=28,
  hand_gap=0,
  hand_length=20,
  hand_larg=1.5,
  point_ray=0
  },
  {text={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=3600,
  formule='minute',
  police="URW Chancery L",
  taille=9,
  text_color=0xa8a8a8,
  text_alpha=0,
  text_color_current=0xffffff,
  text_alpha_current=0,
  point_color=0xffffff,
  point_alpha=0,
  point_color_current=0xffffff,
  point_alpha_current=0,
  hand_color=0xffff00,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=25,
  point_radius=20,
  point_ray=0,
  hand_gap=0,
  hand_larg=1.5,
  hand_length=28
  },
  {text={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"},
  nb=60,
  formule='secondes',
  police="URW Chancery L",
  taille=9,
  text_color=0xffffff,
  text_alpha=0,
  text_color_current=0xffffff,
  text_alpha_current=0,
  point_color=0xffffff,
  point_alpha=0,
  point_color_current=0xffffff,
  point_alpha_current=0,
  hand_color=0xffffff,
  hand_alpha=1,
  center_x=175,
  center_y=245,
  text_radius=30,
  point_radius=20,
  point_ray=0.5,
  hand_gap=0,
  hand_larg=0,
  hand_length=30,
  progressif=true
  },

}

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 cr = cairo_create(cs)
  local extents=cairo_text_extents_t:create()
  tolua.takeownership(extents)
  local h, min, sec=time()
  local jour, jour_num, mois, nb_jour=date()

  if tonumber(conky_parse('${updates}'))>3 then
    for i in pairs(init) do
      draw(cr, extents, init[i], h, min, sec, jour, jour_num, mois, nb_jour)
    end
  end

  cairo_destroy(cr)
  cairo_surface_destroy(cs)
  cr=nil
  collectgarbage()
end

function draw(cr, extents, value, h, min, sec, jour, jour_num, mois, nb_jour)
  local function affichage(cr, extents, j, valeur, value, text, nb)
    if value.progressif == nil then
      value.progressif=false
    end
    if value.progressif==true and j<=valeur then
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, j, cr, value.point_ray)
    elseif value.progressif==false and j==valeur then
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, j, cr, value.point_ray)
    else
      texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color, value.text_alpha, j, extents, cr)
      point(nb, value.point_radius, value.center_x, value.center_y, value.point_color, value.point_alpha, j, cr, value.point_ray)
    end
  end
  local pos
  local nb=tonumber(table.getn(value.text))
  cairo_select_font_face (cr, value.police, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
  cairo_set_font_size (cr, value.taille)
-- Section Horloge
  if value.formule=="heure" then
    if value.decalage~=nil then
        h=h+tonumber(value.decalage)
    end
    local text
    nb=value.nb/3600
    if nb==24 then h=tonumber(os.date("%H")) end
    pos=heure(h, min, sec)
    for i=1, nb do
      local j=i-1
      if value.hour_24==true then
        if tonumber(os.date("%H"))<nb then
          text=value.text[i]
        else
          text=value.text[i+12]
        end
      else
        text=value.text[i]
      end
      affichage(cr, extents, j, h, value, text, nb)
    end
  elseif value.formule=="minute" then
    pos=minute(min, sec)
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, min, value, text, nb)
    end
  elseif value.formule=="secondes" then
    pos=sec
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, sec, value, text, nb)
    end
-- Section date
  elseif value.formule=="mois" then
    value.nb, pos=month()
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, mois-1, value, text, nb)
    end
  elseif value.formule=="jour_num" then
    value.nb=nb_jour*24
    nb=nb_jour
    pos=day(jour-1)
    for i=1, nb_jour do
      if math.mod(i, 2) == 0 then
        text=string.format("%02d",i)
      else
        text=""
      end
      local j=i-1
      affichage(cr, extents, j, jour-1, value, text, nb)
    end
  elseif value.formule=="jour" then
    pos=(jour_num*24)+tonumber(os.date("%H"))
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      affichage(cr, extents, j, jour_num, value, text, nb)
    end

-- Horloge avec personnalisée (non utilisé pour le moment)
  else
    pos=tonumber(conky_parse(value.formule))
    for i=1, nb do
      local j=i-1
      local text=value.text[i]
      if tonumber(text)==pos then
         texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color_current, value.text_alpha_current, i, extents, cr)
        point(nb, value.point_radius, value.center_x, value.center_y, value.point_color_current, value.point_alpha_current, i, cr, value.point_ray)
      else
        texte(value.police, value.taille, text, nb, value.text_radius, value.center_x, value.center_y, value.text_color, value.text_alpha, i, extents, cr)
        point(nb, value.point_radius, value.center_x, value.center_y, value.point_color, value.point_alpha, i, cr, value.point_ray)
      end
    end
  end

  hand(pos, value.nb, value.text_radius, value.hand_length, value.hand_gap, value.hand_larg, value.center_x, value.center_y, value.hand_color, value.hand_alpha, cr)
end

function date()
  local nb_jour
  local jour=tonumber(os.date("%d"))
  local jour_num=tonumber(os.date("%w"))
  local mois=tonumber(os.date("%m"))
  if mois==12 then
    nb_jour=31
  else
    nb_jour=tonumber(conky_parse("${exec date --date '1 month' +%j}"))-tonumber(conky_parse("${exec date +%j}"))
  end
  return jour, jour_num, mois, nb_jour
end

function day(jour)
  local hjour=(jour*24)+tonumber(os.date("%H"))
  return hjour
end

function month()
  local nb_jours_annee=tonumber(conky_parse("${exec echo $(date --date '31 Dec' +%j)}"))
  local jour_annee=tonumber(conky_parse("${exec echo $(date +%j)}"))
  return nb_jours_annee, jour_annee
end

function time()
  local h=tonumber(os.date("%I"))
  local min=tonumber(os.date("%M"))
  local sec=tonumber(os.date("%S"))
  return h, min, sec
end

function heure(h, min, sec)
  local hs=(h*3600)+(min*60)+sec
  return hs
end

function minute(min, sec)
  local m=(min*60)+sec
  return m
end

function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function texte(police, taille, text, nb, radius, center_x, center_y, color, alpha, i, extents, cr)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(i))
  local x=0+radius*(math.sin(point))
  local y=0-radius*(math.cos(point))
  cairo_text_extents(cr,text,extents)
  local width=extents.width
  local height=extents.height
  cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
  cairo_show_text (cr, text)
  cairo_stroke (cr)
end

function point(nb, radius, center_x, center_y, color, alpha, i, cr, ray)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(i))
  local x=0+radius*(math.sin(point))
  local y=0-radius*(math.cos(point))
  cairo_arc (cr,center_x+x,center_y+y,ray,0,2*math.pi)
  cairo_stroke (cr)
end

function hand(pos, nb, radius, hand_length, hand_gap, largeur, center_x, center_y, color, alpha, cr)
  cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
  local point=(math.pi/180)*((360/nb)*(pos))
  local x_gap=0+hand_gap*(math.sin(point))
  local y_gap=0-hand_gap*(math.cos(point))
  local x=0+hand_length*(math.sin(point))
  local y=0-hand_length*(math.cos(point))
  cairo_move_to (cr,center_x+x_gap,center_y+y_gap)
  cairo_line_to (cr,center_x+x,center_y+y)
  cairo_set_line_width (cr,largeur)
  cairo_set_line_cap  (cr, CAIRO_LINE_CAP_ROUND)
  cairo_stroke (cr)
end

A+,
Didier

P.S. : ne t'excuse pas de modifier ce qui existe, c'est fait pour wink
          et n'hésite pas a partager le résultat de tes "modifications", ça me plais plus que l'original smile

Hors ligne

#568 Le 30/04/2014, à 10:03

loutch

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

smilies%20(204).gif


Merci pour la modif  changer le décalage par -6 pour  Miami .

1398887439.png


smilies%20(1).gif

Dernière modification par loutch (Le 30/04/2014, à 21:54)

Hors ligne

#569 Le 01/05/2014, à 10:10

David74

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Didier-T a écrit :

Bonjour David74,
dit moi tu utilise qui pour tes mails ?

Salut,
j'ai des comptes sur laposte.net, et d'autres sur teria.fr. Jusqu'à présent, sur Precise, ça fonctionnait avec conkyEmail, mais qui n'est plus installable sur Trusty. C'est bien là le hic...

Hors ligne

#570 Le 02/05/2014, à 11:35

Tixou

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour à tous,

Voici mon conky, qui n'est autre que le conky-lua de Hy-lua by S3B adapter pour processeurs 8 coeurs.

Lien de l'image correspondante :  http://imagik.fr/view-rl/94432  (désolé j'ai pas réussi à la faire s'afficher...)

Pour avoir de quoi l'installer sur votre machine, tout est là:

Conky_8_coeurs

Enjoy!

Dernière modification par Tixou (Le 02/05/2014, à 11:38)

Hors ligne

#571 Le 04/05/2014, à 13:47

raptor2003

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Salut les conkier !

Je viens de repasser sous Ubuntu 14.04 (Fresh install) et j'ai un petit soucis avec mon conky que j'avais créé il y a quelques années. (J'était obligé d'être sous Windows depuis 2 ans et donc je n'y ait pas touché depuis un moment.
Il fonctionne correctement, pas de soucis mais dès que je clic sur une fenêtre il bug. Si je le lance depuis le terminal, il bug quand je clic sur le bureau, si je le lance depuis un raccourci bureau, il bug quand je clic sur une fenêtre smile
Je suppose que cela vient du "own_window_type" qui est était à "override" depuis toujours sans me poser de soucis. J'ai biensûr testé "deskop" et autres joyeusetés mais c'est pas ce que je recherche.

Si vous pouvez m'apporter vos lumières, merci.

1399203531.png

background no
update_interval        1
double_buffer yes
use_xft yes
#xftfont Sans:size=8
xftfont Terminus:size=8

xftalpha 1
minimum_size 300 0
maximum_width 300
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
stippled_borders 8
#border_margin 4
border_width 1
default_color white
default_shade_color black
default_outline_color black
own_window		yes
own_window_transparent	yes
own_window_type		override
own_window_hints	undecorated,over,sticky,skip_taskbar,skip_pager
alignment top_right
gap_x 10
gap_y 35
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer right

# colours
color1 white
# light blue
color2 6892C6
# orange
#E77320
color3 FC8820
# green
color4 78BF39
# red
color5 CC0000
color6 00FF00 

text_buffer_size 2048


TEXT
${color #e49c16}Heure actuelle:$color $time ${color #FFFFFF}
${color #e49c16}Uptime:$color $uptime ${color #FFFFFF}    ${color #e49c16}Load AVG:$color ${loadavg 1 2 3} ${color #FFFFFF}  
${pre_exec lsb_release -si} ${color #e49c16}${pre_exec lsb_release -sr} ${pre_exec lsb_release -sc} ${color #FFFFFF}$kernel
${color #c63030}$stippled_hr
${color #e49c16}Fréquence CPU:${color #FFFFFF} $freq_g Ghz
${color #e49c16}CPU Utilisé :${color #FFFFFF} $cpu% ${color #ffc11f}${cpubar}
${color #e49c16}Core1 : ${color #FFFFFF} ${cpu cpu1}% ${color #ffc11f}${cpubar cpu1}
${color #e49c16}Core2 : ${color #FFFFFF} ${cpu cpu2}% ${color #ffc11f}${cpubar cpu2}
${color #e49c16}Core3 : ${color #FFFFFF} ${cpu cpu3}% ${color #ffc11f}${cpubar cpu3}
${color #e49c16}Core4 : ${color #FFFFFF} ${cpu cpu4}% ${color #ffc11f}${cpubar cpu4}
${color #e49c16}Core5 : ${color #FFFFFF} ${cpu cpu5}% ${color #ffc11f}${cpubar cpu5}
${color #e49c16}Core6 : ${color #FFFFFF} ${cpu cpu6}% ${color #ffc11f}${cpubar cpu6}
${color #e49c16}Core7 : ${color #FFFFFF} ${cpu cpu7}% ${color #ffc11f}${cpubar cpu7}
${color #e49c16}Core8 : ${color #FFFFFF} ${cpu cpu8}% ${color #ffc11f}${cpubar cpu8}
${color white}${cpugraph 32, 270 c63030 00ff18}
${color white}${cpugraph cpu1 32, 135 c63030 00ff18}  ${color white}${cpugraph cpu2 32, 135 c63030 00ff18}
${color white}${cpugraph cpu3 32, 135 c63030 00ff18}  ${color white}${cpugraph cpu4 32, 135 c63030 00ff18}
${color white}${cpugraph cpu5 32, 135 c63030 00ff18}  ${color white}${cpugraph cpu6 32, 135 c63030 00ff18}
${color white}${cpugraph cpu7 32, 135 c63030 00ff18}  ${color white}${cpugraph cpu8 32, 135 c63030 00ff18}
${color #e49c16}Temp CPU :${color #FFFFFF} ${hwmon 0 temp 1}°C ${color #e49c16}     HDD1 :${color #FFFFFF}${hddtemp /dev/sda}°C    ${color #e49c16}HDD2:${color #FFFFFF}${hddtemp /dev/sdb}°C
${color #e49c16}Core 1:${color #FFFFFF} ${platform coretemp.0 temp 2}°C ${color #e49c16}Core 2:${color #FFFFFF} ${platform coretemp.0 temp 3}°C ${color #e49c16}Core 3:${color #FFFFFF} ${platform coretemp.0 temp 4}°C ${color #e49c16}Core 4:${color #FFFFFF} ${platform coretemp.0 temp 5}°C
${color #c63030}$stippled_hr
${color #e49c16}Mémoire RAM :
${color #FFFFFF} $mem/$memmax - $memperc% ${color #ffc11f}${membar}
${color #e49c16}Processus : $color $processes   ${color #e49c16}En cours : $color $running_processes
${color #c63030}$stippled_hr
${color #e49c16}Disque:
${color #FFFFFF}Root (${fs_used /})/(${fs_size /}) :${color #FFFFFF}${alignc}${fs_free_perc /}${alignc}% ${color #ffc11f}${fs_bar /}
${if_mounted /media/phil/Dl}${color #FFFFFF}Download (${fs_used /media/phil/Dl})/(${fs_size /media/phil/Dl}) :${color #FFFFFF}${alignc}${fs_used_perc /media/phil/Dl}% ${color #ffc11f}${fs_bar /media/phil/Dl}${endif}

${color #e49c16}IO Read :${color white} ${diskio_read /dev/sda}${color white} ${offset 40}${color #e49c16}IO Write:${color white} ${diskio_write /dev/sda}

${if_up wlan0}
${color2}${font Ubunu:pixelsize=15}Wifi  ${color #e49c16}${hr}${font}
${color #e49c16}SSID :${color white} ${wireless_essid wlan0}

${color #FFFFFF}IP Locale : ${addr wlan0}    ${color #FFFFFF}IP Publique : ${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${color #e49c16}Download :${color white} ${downspeed wlan0}/s${color white} ${offset 30}${color #e49c16}Upload:${color white} ${upspeed wlan0}/s
${color #FFFFFF}${downspeedgraph wlan0 32,135 c63030 00ff18}  ${color #FFFFFF}${upspeedgraph wlan0 32,135 c63030 00ff18}
${color #e49c16}Total Down:${color #FFFFFF} ${totaldown wlan0}           ${color #e49c16}Total Up:${color #FFFFFF} ${totalup wlan0} 
${color #e49c16}Qualité du signal: ${color white}${wireless_link_qual_perc wlan0}% ${color #e49c16}Speed :${color white} ${wireless_bitrate wlan0}${endif}

${if_existing /proc/net/route eth0}
${color2}${font Ubunu:pixelsize=15}Ethernet  ${color #e49c16}${hr}${font}
${color #FFFFFF}IP Locale : ${addr eth0}    ${color #FFFFFF}IP Publique : ${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${color #e49c16}Download :${color white} ${downspeed eth0}/s${color white} ${offset 50}${color #e49c16}Upload:${color 
white} ${upspeed eth0}/s
${color #FFFFFF}${downspeedgraph eth0 32,135 c63030 00ff18}  ${color #FFFFFF}${upspeedgraph eth0 32,135 c63030 00ff18}
${color #e49c16}Total Down:${color #FFFFFF} ${totaldown eth0}           ${color #e49c16}Total Up:${color #FFFFFF} ${totalup eth0}${color2}${endif}

${color2}${font Ubunu:pixelsize=15}Processus  ${color #e49c16}${hr}${font}
Name                             ${alignr 30}CPU      ${alignr}RAM
${color #e09495} ${top name 1}   ${alignr 20}${top cpu 1}  ${alignr}${top mem_res 1}
${color #e0d094} ${top name 2}   ${alignr 20}${top cpu 2}  ${alignr}${top mem_res 2}
${color1} ${top name 3}    ${alignr 20}${top cpu 3}  ${alignr}${top mem_res 3}
${color1} ${top name 4}    ${alignr 20}${top cpu 4}  ${alignr}${top mem_res 4}
${color1} ${top name 5}    ${alignr 20}${top cpu 5}  ${alignr}${top mem_res 5}

${color #e09495} ${top_mem name 1}   ${alignr 20}${top_mem cpu 1}  ${alignr}${top_mem mem_res 1}
${color #e0d094} ${top_mem name 2}   ${alignr 20}${top_mem cpu 2}  ${alignr}${top_mem mem_res 2}
${color1} ${top_mem name 3}    ${alignr 20}${top_mem cpu 3}  ${alignr}${top_mem mem_res 3}
${color1} ${top_mem name 4}    ${alignr 20}${top_mem cpu 4}  ${alignr}${top_mem mem_res 4}
${color1} ${top_mem name 5}    ${alignr 20}${top_mem cpu 5}  ${alignr}${top_mem mem_res 5}

Dernière modification par raptor2003 (Le 04/05/2014, à 13:49)

Hors ligne

#572 Le 04/05/2014, à 14:42

Didier-T

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour raptor2003,
il me semble que ton soucis vient bien de own_window_type, tu devrais le passer a normal.

actuellement, quand tu clic sur ton bureau ton conky ne bug pas, c'est ton bureau qui passe par dessus wink , tu peut le vérifier en regardant tes processus actif, et en y cherchant ton conky après l'avoir fait disparaître.

Hors ligne

#573 Le 04/05/2014, à 20:01

raptor2003

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Didier-T a écrit :

Bonjour raptor2003,
il me semble que ton soucis vient bien de own_window_type, tu devrais le passer a normal.

actuellement, quand tu clic sur ton bureau ton conky ne bug pas, c'est ton bureau qui passe par dessus wink , tu peut le vérifier en regardant tes processus actif, et en y cherchant ton conky après l'avoir fait disparaître.

Merci, ça résous le problème mais si je fais un retour bureau, le conky disparaît. Enfin bon c'est pas la mort mais faut réduire toutes les fenêtre une à une .... smile

Hors ligne

#574 Le 05/05/2014, à 08:52

Tixou

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonjour Raptor2003,
Moi aussi je trouve dommage que le bureau passe par dessus conky quand on clic son raccourcis.
C'est pourquoi je me suis fait un fichier exécutable avec pour contenu:

#!/bin/sh
killall conky
sleep 2
conky -d -c ~/.conkyrc
exit

Ainsi, avec ce fichier sur ton bureau ou dans ton dossier perso, il y a juste à double cliquer dessus pour que conky réapparaisse...
C'est pas miraculeux mais ça évite d'ouvrir  une commande...

Hors ligne

#575 Le 05/05/2014, à 12:04

raptor2003

Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes

Salut Tixou,

j'ai aussi quelque chose de similaire mais avec un .desktop. Simple et efficace smile

Hors ligne

Haut de page ↑