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.

#501 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

#502 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

Hors ligne

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

Didier-T

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

de rien

Hors ligne

#504 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

#505 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

#506 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

#507 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

#508 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

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

David74

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

Up ?...

Hors ligne

#510 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

#511 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

#512 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

#513 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

#514 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

#515 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

#516 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

#517 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

#518 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

#519 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

#520 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

#521 Le 05/05/2014, à 13:31

Sfroumptch

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

raptor2003 a écrit :

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.

http://pix.tdct.org/upload/thumb/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}

Bonjour. J'ai le même problème de rafraichissement d'images. On dirait que conky n'efface plus lors de la mise à jour des infos.
J'ai testé les autres own_window_type (desktop, dock, panel et normal) et override semble être le seul à présenter ce bug.
1399289096.png
La solution de Tixou ne me plait pas. Je n'ai pas envie de relancer mes conky à chaque fois que je clique sur le bureau.
Quelqu'un aurait une autre solution?


S'il n'y a pas de solution, c'est qu'il n'y a pas de problème!

Hors ligne

#522 Le 05/05/2014, à 18:49

Tixou

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

Merci Sfroumptch, puisque que ma solution de ce matin ne te plaît pas, j'ai tester 2 3 trucs, et oh miracle!!

Conky reste en place après avoir cliquer sur le bouton bureau...

Pour cela, j'ai:
own_window_type dock (avant j'étais en normal)

et comme mon conky c'était completement décaler à gauche de mon écran, j'ai corrigé le tire en changeant:

alignment tr
gap_x 35
gap_y 55

Par :

alignment tr
gap_x 1380
gap_y 55

Et là, ca fonctionne nikel, enfin chez moi...
Pour info, je suis sous 14.04 avec un écran 1600x900

Hors ligne

#523 Le 05/05/2014, à 19:45

Sfroumptch

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

Tixou a écrit :

Merci Sfroumptch, puisque que ma solution de ce matin ne te plaît pas, j'ai tester 2 3 trucs, et oh miracle!!

Conky reste en place après avoir cliquer sur le bouton bureau...

Pour cela, j'ai:
own_window_type dock (avant j'étais en normal)

et comme mon conky c'était completement décaler à gauche de mon écran, j'ai corrigé le tire en changeant:

alignment tr
gap_x 35
gap_y 55

Par :

alignment tr
gap_x 1380
gap_y 55

Et là, ca fonctionne nikel, enfin chez moi...
Pour info, je suis sous 14.04 avec un écran 1600x900

Merci pour ton retour. Effectivement own_window_type dock fonctionne parfaitement.
Apparemment, ce réglage désactive le réglage alignment en mettant le conky en top_left sans possibilité de modifier.


S'il n'y a pas de solution, c'est qu'il n'y a pas de problème!

Hors ligne

#524 Le 05/05/2014, à 20:03

raptor2003

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

Merci Tixou, ça fonctionne.

J'avais testé le dock aussi mais j'avais pas le bon paramètre pour les "hints", c'est pas "under, mais "below", ....

Hors ligne

#525 Le 06/05/2014, à 22:17

Yberamos

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

Salut à tous!

Alors tout d'abord je tiens a vous préciser que je viens en tant que parasite. Car je suis sous manjaro, mais la doc de ce forum est tellement bien fait que je passe souvent sur le wiki. Et puis... conky est universel, non? Donc voila, après avoir passé des heures sur ce sujet, je me suis dit qu'il fallait apporter ma pierre à l'édifice^^. Autre précision, la plus part des mes conkys sont des patchwork de différente disposition trouvé sur internet, donc bon c'est pas propre et il y a surement des ligne en trop ou mal écrite dans l'avant-TEXT. Enfin bon... Vous allez vite comprendre que j'aime quand il y a beaucoup d'info: mon conky est un "peu" charger^^. Voila une image de ce que ça donne:

http://pix.toile-libre.org/?img=1399404831.png


Et maintenant les conky en eux-mêmes:

conkystat:

# Conky settings #
background yes
update_interval 0.5
cpu_avg_samples 2
use_spacer yes 

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

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

alignment middle_right
gap_x 40
gap_y -60

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no

default_color FFFFFF
color1 DD4814

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000

TEXT
${alignr}${kernel}
${alignr}$color1 Uptime $color $uptime
${alignr} $color1 Home  $color ${fs_used /home/} /$color1 ${fs_size /home/} $color
${alignr}$color1 Libre $color${fs_free_perc /home/}% ${fs_bar_free 3,200 /home/}
${alignr}$color1 Accès aux SSD: $color${diskio}
${alignr}$color1 ${diskiograph 20,250 ED0000 34C924 0.5}
${alignr}$color1 Adaptateur $color${acpiacadapter AC0}


${alignr}$color1-------------------------------------------------------------------------------------$color
${alignr}$color1-------------------------------------------------------------------------------------$color
${alignr}$color1 Temperature CPU $color ${acpitemp}° C 
${alignr}$color1 CPU 1 $color${freq_g 1}GHz ${cpu cpu1}% ${cpubar cpu1 3,200}
${alignr}$color1 CPU 2 $color${freq_g 2}GHz ${cpu cpu2}% ${cpubar cpu2 3,200}
${alignr}$color1 CPU 3 $color${freq_g 3}GHz ${cpu cpu3}% ${cpubar cpu3 3,200}
${alignr}$color1 CPU 4 $color${freq_g 4}GHz ${cpu cpu4}% ${cpubar cpu4 3,200}
${alignr}${cpugraph 20,250 34C924 ED0000 -t 0.5}
${alignr}${top name 1}${top cpu 1}%
${alignr}${top name 2}${top cpu 2}%
${alignr}${top name 3}${top cpu 3}%
${alignr}${top name 4}${top cpu 4}%
${alignr}${top name 5}${top cpu 5}%
${alignr}$color1--------------------------------------$color
${alignr}$color1 Total CPU $color                ${cpu cpu0}%

Ce conky affiche différentes donnée sur mon ordi, je le considère un peu comme mon conky de base^^


conkybatterie

# Conky settings #
background yes
update_interval 1

minimum_size 10 1000 

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0


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

border_inner_margin 0
border_outer_margin 0


alignment top_right
gap_x 40
gap_y 280

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no


default_color FFFFFF
color1 DD4814
color2 ED0000
color3 FF4901
color4 34C924

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000

times_in_seconds true
TEXT





${if_match ${battery_percent} <= 20}${blink ${alignr}$color1 Time Remaining $color ${format_time $battery_time "\hh\mm"} ${battery}}${endif}\
${if_match ${battery_percent} > 20}${alignr}$color1 Battery $color ${format_time $battery_time "\hh\mm"} ${battery}${endif}
${if_match ${battery_percent} <= 20}${blink ${alignr}$color2 ${battery_bar 3,265}$color}${endif}\
${if_match ${battery_percent} <= 33}${if_match ${battery_percent} >20}${alignr}$color2 ${battery_bar 3,265}$color ${endif}${endif}\
${if_match ${battery_percent} <= 66}${if_match ${battery_percent} >33}${alignr}$color3 ${battery_bar 3,265}$color ${endif}${endif}\
${if_match ${battery_percent} > 66}${alignr}$color4 ${battery_bar 3,265}$color ${endif}

Ce conky affiche les infos concernant ma batterie. J'ai fait un conky séparé de mes stat (même si il s'imbrique dedans) car, si ma batterie tombe en-dessous de 20%, le $blink ce met en place et il foutait en l'aire tout ma mise en page donc bon, j'ai trouver plus simple de faire un fichier séparé.


conkyRAM

# Conky settings #
background yes
update_interval 0.5

use_spacer yes
short_units yes

maximum_width 165 

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

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

border_inner_margin 0
border_outer_margin 0


alignment bottom_right
gap_x 220
gap_y 83

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no

default_color FFFFFF
color1 DD4814

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000

TEXT
${alignr}${top_mem name 1}${top_mem mem 1}%
${alignr}${top_mem name 2}${top_mem mem 2}%
${alignr}${top_mem name 3}${top_mem mem 3}%
${alignr}${top_mem name 4}${top_mem mem 4}%
${alignr}${top_mem name 5}${top_mem mem 5}%
$color1--------------------------------------$color
${alignr}$color1 Total RAM $color                ${memperc}%

Celui-ci c'est pour ma RAM. De nouveau, un fichier séparé pour raison d'affichage, je voulais ces stats a coté de celle de mon cpu et comme les données de celui change en permanence, je n'avais pas envie de chercher si il y aurait des problème donc, hop fichier séparé^^.


conkyhorloge

# Conky settings #
background yes
update_interval 1

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

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

border_inner_margin 0
border_outer_margin 0

minimum_size 250 250

alignment top_left
gap_y 0

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=12
xftalpha 0.8
uppercase no

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

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

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000
TEXT
${voffset 130}${offset 92}${time %T}

Simple horloge en Lua, complètement pomper de je ne sais plus qui, sorry...


clock_rings2.lua

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

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

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

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

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

}

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

clock_r=100

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

clock_x=125
clock_y=125

show_seconds=true

require 'cairo'

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

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

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

    -- Draw background ring

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

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

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

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

    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    
    local cr=cairo_create(cs)    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    
    draw_clock_hands(cr,clock_x,clock_y)
end

Le lua de l'horloge.


conkyclementine

# Conky settings #
background yes
update_interval 0.5

double_buffer yes
no_buffers yes
minimum_size 300

text_buffer_size 2048
#imlib_cache_size 0

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

border_inner_margin 0
border_outer_margin 0


alignment middle_left
gap_x 40
gap_y 40

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no

temperature_unit celsius

default_color FFFFFF
color1 DD4814
color2 444444


own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000

TEXT
${if_running clementine}
$color1${execi 1 conkyClementine --datatype=ST}$color
${execi 0.1 conkyClementine --datatype=PT} / $color1${execi 5 conkyClementine --datatype=LE}$color
${scroll 20 1${execi 1 conkyClementine --nounknownoutput -m 27 -d TI}}
${execi 1 conkyClementine --nounknownoutput -m 27 -d AR}
${execi 1 conkyClementine --nounknownoutput -m 26 -d AL}
${execi 1 conkyClementine -d CA > /dev/null}  
${image /tmp/cover -p 180,10 -s 100x100 -f 1 }   
${endif}

Celui-la c'est pour mon lecteur de musique, Clémentine. Si celui-ci tourne, il affiche le temps écouler, le temps total et d'autre info, en plus de la pochette. Si il ne tourne pas, il n'affiche absolument rien.


conkyfortune

# Conky settings #
background yes
update_interval 1

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0


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

border_inner_margin 0
border_outer_margin 0

minimum_size 1400 230
maximum_width 490

alignment middle_left
gap_x 40
gap_y -110

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no

default_color FFFFFF

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000

TEXT
${execi 300 fortune}

Simple conky appelant fortune pour m'afficher des citations.


conkyreseau

# Conky settings #
background yes
update_interval 1

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

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

maximum_width 400

alignment bottom_left
gap_x 35
gap_y 50 

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

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Ubuntu:size=11
xftalpha 0.8
uppercase no

default_color FFFFFF
color1 DD4814

own_window_argb_visual yes
own_window_argb_value 0
own_window_colour 000000


TEXT
$color1 IP Locale $color${addr wlp3s0} $color1  IP distante: $color${color white}${execi 60 wget -O - http://ip.tupeux.com | tail}
$color1 Bitrate: $color${wireless_bitrate wlp3s0}$color1   Nom du réseau: $color${wireless_essid wlp3s0}
$color1 Qualité:$color ${wireless_link_qual_perc wlp3s0}% ${wireless_link_bar 3,200 wlp3s0}
$color1 Vitesse de download: $color${downspeed wlp3s0}$color1 Total: $color${totaldown wlp3s0}
${downspeedgraph wlp3s0 20,250 34C924 ED0000 -l 0.5}
$color1 Vitesse de upload: $color${upspeed wlp3s0}$color1 Total: $color${totalup wlp3s0}
${upspeedgraph wlp3s0 20,250 34C924 ED0000 -l 0.5}

Et enfin un dernier conky pour m'afficher tout les info concernant ma connexion réseau.

Voila,voila... J'espère de pas vous avoir fait fuir par la longueur de mon post.
Si quelqu'un a des conseil pour une chose ou l'autre, je suis preneur^^. Sinon, j'aurais bien une demande, je cherche un moyen originale d'afficher la date ainsi qu'un calendrier. J'ai déjà chercher sur le net, mais j'ai rien trouver qui m'ai vraiment plus.
Enfin bon, en espérant que vous m’acceptiez malgré que je ne soit pas sous Ubuntu.

P.S.:C'est mon premier poste sur ce forum, donc si j'ai oublié quelque chose patapé sivouplé tongue.

EDIT: il y avait une erreur dans le conkyclementine, l'affichage de la pochette ce faisait mal.

Dernière modification par Yberamos (Le 07/05/2014, à 00:19)

Hors ligne