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.

#776 Le 05/07/2011, à 19:05

usm77

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

Par Exemple mes fichiers shell/bash se situe dans un dossier principal conky et un sous dossier/répertoire scripts
/home/christian/conky/scripts/mes_fichiers.sh
mes conky sont la : /home/christian/conky/mes_conkyrc
mes images sont la /home/christian/conky/pix/mes_images.png

Les conkyrc sont désignés ainsi en principe = .conkyrc .conkyrc1 .conkyrc2 ou autrement, mais cela n'a pas d'importance, c'est juste des fichiers textes mais en général il sont cachés donc nommés avec un point devant le nom du fichier
La variable $HOME remplace pour toi /home/kevin/ donc ta commande doit être  ${execpi 600 $HOME/wordclock.sh} si ton script se situe dans le dossier /home/kevin/
Tiens moi au courant
@ pluche

Dernière modification par usm77 (Le 05/07/2011, à 19:10)

Hors ligne

#777 Le 05/07/2011, à 19:10

weezixx

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

Ça fonctionne (à part qu'il me dit qu'il est pas très à l'heure), j'ai plus qu'a l'insérer dans un autre conky, et je vais aussi essayer de trouver un site pour m'apprendre à scripter en bash et en lua (apparemment largement utiliser).

Je te remercie

Hors ligne

#778 Le 10/07/2011, à 15:53

usm77

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

Bonjour
J'ai rajouté un fond à mes conky, cela a été fait avec Gimp.

MeteoAvecFond
Avec un fond

Les autres conky sont avec le même fond

MeteoSansFond
Sans le fond


Je ne sais pas vraiment si je dois le garder ou utiliser la transparence pur mes conky.
Un avis sur cela m'aiderait a faire le choix ?

Hors ligne

#779 Le 13/07/2011, à 15:11

usm77

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

Pas beaucoup de monde pour l'instant, les wacances cool sans doute.

J'ai rajouté un conky "fortune" avec une particularité c'est d'avoir 2 fortunes cote à cote
fortune

Le script à été trouvé ici sur le Blog scriptam.over-blog qui contient un ensemble de  scripts bien utiles pour linux et entre autre pour conky

# conky configuration

# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes
xftfont HandelGotDLig:size=9
xftalpha 0.8

# Print everything to console?
out_to_console no

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
draw_graph_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_inner_margin 0

# border width
border_width 0

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Minimum size of text area
       # minimum_size width (height)
       #     Minimum size of window
       # maximum_width pixels
       #     Maximum width of window
minimum_size 1040 250
maximum_width 1040

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 250
gap_y 10

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 1

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer no

color1 CCCCCC #Gris
color3 FFFFFF #Blanc
color2 ED9549

text_buffer_size 2048
max_specials 1024

##################################################### 
####################################################
    TEXT
${image $HOME/conky/pix/separateurH.png -p 0,30 -s 1080x25}
${voffset 18}${goto 180}${color black}${font URW Chancery L:style=Medium Italic:pixelsize=18}Cinéma${offset 550}${color black}Humour${color}${font}
${voffset 15}${execpi 300 bash $HOME/conky/scripts/fortune_conky.sh && cat /tmp/fort_conky}

Le script

#!/bin/bash
# Permet l'affichage cote a cote de 2 fortunes sans decallage
# Copyright (C) 08 dec. 2010, Rombeaut Rodolphe
# http://scriptam.over-blog.com/
# Released into the public domain.

#le code conkyrc avant la premiere fortune ATTENTION, ne pas oublier
# de preceder les caracteres speciaux comme "$" d'un antislash "\"
    before=""
#le code au milieu
    middle="\${alignr}\${color1}"
#le code a la fin apres la deuxieme fortune
    after=""
 
    fortune cinema | fold -s -w 80 > /tmp/fort_cine
    fortune humour perlbac | fold -s -w 80 > /tmp/fort_humour
     
#on rassemble les fortunes et on ajoute le code conkyrc
    paste --delimiters="|" /tmp/fort_cine /tmp/fort_humour > /tmp/fort_conky
    sed -i 's/|/'"$middle"'/g' /tmp/fort_conky
    sed -i 's/.*/'"$before"'&'"$after"'/' /tmp/fort_conky 

Dans ce script, j'ai rajouté sur cette ligne "fortune humour perlbac | fold -s -w 80 > /tmp/fort_humour" un autre fichier fortune comme cela est spécifié sur la  manpage de fortune permettant d'alterner les fortunes.

Hors ligne

#780 Le 13/07/2011, à 19:53

Levi59

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

Heureux qu'il t'ai été utile! wink

Hors ligne

#781 Le 13/07/2011, à 20:21

usm77

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

Levi59 a écrit :

Heureux qu'il t'ai été utile! wink

Je présume que tu es l'auteur de ce blog et donc de ce script. J'ai fortement apprécié celui-ci (ainsi que l'ensemble de ce blog) pour la qualité et la multitude des scripts.
J'espère que ce/ton blog servira à beaucoup d'autre Linuxien qui n'ont pas le savoir ou la capacité d'en écrire lol

Hors ligne

#782 Le 15/07/2011, à 10:43

Fenouille84

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

Hello smile

Voici un petit hommage au jeu Portal !

Screen
cbaperture.png

conkyrc0 (gauche)

#Fonctionnement de conky 
  total_run_times 0               #Temps en secondes ; 0 = toujours actif
  background yes                  #Pour que conky tourne en arrière plan ; no = pour les tests

#Réglages système
  cpu_avg_samples 1               #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
  net_avg_samples 2               #Nb d'échantillons pour calculer la moyenne d'utilisation CPU

#Mémoire
  double_buffer yes               #Éviter le clignotement
  no_buffers yes                  #Soustraire les mémoires tampons de la mémoire utilisée
  text_buffer_size 1024           #Taille du cache pour le texte

#Affichage
  out_to_console no               #Affiche le texte sur la sortie standard
  update_interval 1               #Taux de rafraîchissement de la fenêtre (s)

#Fenêtre conky
  alignment top_left              #Alignement
 #---
  minimum_size 75 10              #Taille minimum (px) ; largeur / hauteur
  maximum_width 75                #Largeur maximum (px)
 #---
  gap_x 10                        #Écart avec le bord gauche / droit
  gap_y 50                        #Écart avec le bord haut / bas
 #---
  draw_shades no                  #Afficher les ombres
  draw_outline no                 #Afficher les contours de fenêtre
  draw_borders no                 #Afficher des contours autour des blocs de texte
  border_width 1                  #Largeur du contour
  border_inner_margin 1           #Largeur des marges
 #---
  own_window yes                  #Utiliser sa propre fenêtre
  own_window_type override        #Type de fenêtre ; normal / override / desktop
  own_window_transparent yes      #Pseudo transparence
  own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

#Mise en forme
  use_xft yes                     #Utiliser Xft (polices lissées etc)
  xftalpha 1                      #Utiliser Xft
  override_utf8_locale yes        #Force l'UTF8
  uppercase no                    #Tout le texte en majuscule
  use_spacer left                 #Ajoute des espaces après certains objets (qu'avec des polices fixes)
 #---
  #xftfont sans:size=9            #Police par défaut
  xftfont saxMono:size=9          #Police par défaut
 #---
  default_bar_size 35 3           #Barre par défaut (longeur hauteur)
  stippled_borders 3              #Taille des pointillés

#Couleurs
  default_color FFFFFF            #Couleur par défaut
  default_shade_color 333333      #Couleur des ombres
  default_outline_color black     #Couleur des contours
 #---
  color1 2864D5                   #Bleu
  color2 242424                   #Gris 1 (foncé)
  color3 334E73                   #Gris 2 (bleuté)

 #---
  short_units yes                 #Unités courtes
  pad_percents 2                  #Unité à 2 décimales
  top_name_width 6                #Largeur des processus

#LUA : Clock
  #lua_load $HOME/conky/Script/clock.lua
  #lua_draw_hook_pre clock_rings

#LUA : Calendar
  #lua_load $HOME/conky/Script/calendrier.lua
  #lua_draw_hook_pre widgets

#LUA : Background
  #lua_load $HOME/conky/Script/bg.lua
  #lua_draw_hook_pre draw_bg

#LUA : Box Widget
  lua_load $HOME/conky/box/box.lua
  lua_draw_hook_pre main_box

TEXT
${color1}${voffset 15}${font angelicwar:size=20}${alignc}${offset -3}${cpu cpu1}%${font}
${color3}${offset 24}${voffset 6}${platform coretemp.0 temp 1}°C
${color2}${offset 63}${voffset -36}${font Vertigo 2 BRK:size=8}1
${offset 63}\#
${offset 63}C${font}



${color1}${voffset 15}${font angelicwar:size=20}${alignc}${offset -3}${cpu cpu2}%${font}
${color3}${offset 24}${voffset 6}${platform coretemp.1 temp 1}°C
${color2}${offset 63}${voffset -36}${font Vertigo 2 BRK:size=8}2
${offset 63}\#
${offset 63}C${font}



${color1}${voffset 15}${font angelicwar:size=20}${alignc}${offset -3}${memperc}%${font}
${color3}${offset 37}${voffset 6}${swapperc}%
${color2}${offset 63}${voffset -36}${font Vertigo 2 BRK:size=8}M
${offset 63}E
${offset 63}M${font}



${color1}${voffset 15}${font angelicwar:size=20}${alignc}${offset -3}${fs_used_perc /home}%${font}
${color3}${offset 24}${voffset 6}${fs_free /home}
${color2}${offset 63}${voffset -36}${font Vertigo 2 BRK:size=8}M
${offset 63}H
${offset 63}/${font}



${color1}${voffset 15}${font angelicwar:size=20}${alignc}${offset -3}${fs_used_perc /}%${font}
${color3}${offset 24}${voffset 6}${fs_free /}
${color2}${offset 63}${voffset -36}${font Vertigo 2 BRK:size=8}T
${offset 63}R
${offset 63}/${font}${voffset -115}

box.lua

--[[BOX WIDGET v1.1 by Wlourf 27/01/2011
This widget can drawn some boxes, even circles in your conky window
http://u-scripts.blogspot.com/2011/01/box-widget.html)

Inspired by Background by londonali1010 (2009), thanks ;-) 

The parameters (all optionals) are :
x           - x coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
y           - y coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
w           - width of the box, default = width of the conky window
h           - height of the box, default = height of the conky window
corners     - corners is a table for the four corners in this order : top-left, top-right,bottom-right, bottom-left
              each corner is defined in a table with a shape and a radius, available shapes are : "curve","circle","line"
              example for the same shapes for all corners:
              { {"circle",10} }
              example for first corner different from the three others
              { {"circle",10}, {"circle",5}  }              
              example for top corners differents from bottom corners
              { {"circle",10}, {"circle",10}, {"line",0}  }   
              default = { {"line",0} } i.e=no corner
operator    - set the compositing operator (needs in the conkyrc : own_window_argb_visual yes)                          
              see http://cairographics.org/operators/
              available operators are :
              "clear","source","over","in","out","atop","dest","dest_over","dest_in","dest_out","dest_atop","xor","add","saturate"
              default = "over"
border      - if border>0, the script draws only the border, like a frame, default=0
dash        - if border>0 and dash>0, the border is draw with dashes, default=0
skew_x      - skew box around x axis, default = 0
skew_y      - skew box around y axis, default = 0
scale_x     - rescale the x axis, default=1, useful for drawing elipses ...
scale_y     - rescale the x axis, default=1
angle        - angle of rotation of the box in degrees, default = 0
              i.e. a horizontal graph
rot_x       - x point of rotation's axis, default = 0,
              relative to top-left corner of the box, (not the conky window)
rot_y       - y point of rotation's axis, default = 0              
              relative to top-left corner of the box, (not the conky window)
draw_me     - if set to false, box is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the box is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",              
              
linear_gradient - table with the coordinates of two points to define a linear gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,x2,y2}
radial_gradient - table with the coordinates of two circle to define a radial gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,r1,x2,y2,r2} (r=radius)
colour      - table of colours, default = plain white {{1,0xFFFFFF,0.5}}
              this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = start of the gradient, 1= end of the gradient)
              C=hexadecimal colour 
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}        {x=80,y=150,w=100,h=20,
        radial_gradient={20,20,0,20,20,20},
        colour={{0.5,0xFFFFFF,1},{1,0x000000,0}},
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              and so on ...



To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
    lua_load ~/scripts/box.lua
    lua_draw_hook_pre main_box
    
And leave one line blank or not after TEXT

Changelog:
+ v1.0 -- Original release (19.12.2010)
+ v1.1 -- Adding parameters: operator, dash, angle, skew_x, skew_y, draw_me
          corners are described in a table

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--     
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--     
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.        


]]

  
require 'cairo'
    
function conky_main_box()

    if conky_window==nil then return end
    
    ---------------------- PARAMETERS BEGIN HERE
    local boxes_settings={
    --CPU #1
    {x=5, y=5,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",0}, {"circle",30}},
    colour={{0,0x242424,0.8}},
    },
    
    --CPU #2
    {x=5, y=108,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",0}, {"circle",30}},
    colour={{0,0x242424,0.8}},
    },
    
    --RAM
    {x=5, y=211,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",0}, {"circle",30}},
    colour={{0,0x242424,0.8}},
    },
    
    --Home
    {x=5, y=314,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",0}, {"circle",30}},
    colour={{0,0x242424,0.8}},
    },

    --Root
    {x=5, y=417,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",0}, {"circle",30}},
    colour={{0,0x242424,0.8}},
    },
    
    --[[
    FIRST COLUMN
        --default colour and corner
        {x=10, y=25,w=100,h=60},

        --corners
        {x=10, y=110,w=100,h=60,

        --the missing corners are repeated
        corners={ {"",0}, {"circle",30},}
        },
        --border
        {x=10, y=210,w=100,h=60,
        --the missing corners are repeated
        corners={ {"",0}, {"circle",30}, {"",0}, {"circle",30}},
        border= 3
        },

        --dashed border
        {x=10, y=310,w=100,h=60,
        --the missing corners are repeated
        corners={ {"",0}, {"circle",30}, {"",0}, {"circle",30}},
        border= 5, dash = 10
        },    
        
        --plain colour
        {x=10, y=410,w=100,h=60,
        colour={ {0,0xF48F35,0.5} },
        },

        --linear gradient
        {x=10, y=510,w=100,h=60,
        colour={ {0,0xF48F35,0.2}, {1,0xF48F35,1}},
        linear_gradient={0,0,200,0},
        corners={ {"circle",30},}, 
        },
        
        --radial gradient
        {x=10, y=610,w=100,h=60,
        colour={ {1,0xF48F35,0.2}, {0,0xF48F35,1}},
        radial_gradient={100,30,0, 100,30,100},
        corners={ {"circle",30},}, 
        },

        --rainbow box
        {x=10, y=710,w=100,h=60,
        colour={ {0.0,0x454F8A,1}, 
                 {0.1,0xD9668F,1},
                 {0.2,0xFC433E,1},
                 {0.3,0xFA8A38,1},                 
                 {0.4,0xFFD21B,1},
                 {0.5,0xFFFF5F,1},                 
                 {0.6,0x80BD70,1},               
                 {0.7,0x30724C,1},                 
                 {0.8,0x9CEDDE,1},                  
                 },
        linear_gradient={0,0,200,100},
        corners={ {"circle",30}, {"circle",30}, {"line",0}}, 
        },

    --SECOND COLUMN
        --default colour and corner
        {x=230, y=25,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=55,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="over"},

        {x=230, y=110,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=140,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="source"},

        {x=230, y=210,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=240,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="clear"},

        {x=230, y=310,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=340,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="atop"},                

        {x=230, y=410,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=440,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="dest_out"},   
        
        {x=230, y=510,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=540,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="saturate"},   
        
        {x=230, y=610,w=100,h=60, colour={ {1,0xFF0000,1} }, },
        {x=250, y=620,w=160,h=40, colour={ {0,0xFF0000,0.0} , {0.5,0x000000,1} , {1,0xFF0000,0.0} }, linear_gradient={0,0,160,0} },   
    
        {x=230, y=710,w=100,h=60, colour={ {0,0xFF0000,0.3} , {0.5,0xFF0000,1} , {1,0xFF0000,0.3} }, linear_gradient={0,0,200,0} },
        {x=310, y=720,w=40,h=40, colour={ {0,0x000000,1.0} }, corners={ {"circle",20}},  },
    
    --THIRD COLUMN
        {x=460,y=25,w=100,h=60, colour= { {1,0xAAAAFF,1}},
        corners={ {"circle",10} }, },
        {x=465,y=30,w=190,h=40, corners={ {"circle",8} },
        colour= { {0,0xFFFFFF,0.8}, {1,0xFFFFFF,0} },
        linear_gradient = {0,0,0,40} },
        
        {x=460,y=110,w=100,h=60, colour= { {1,0x585858,1}}, },
        {x=470,y=120,w=180,h=40, colour= { {0,0x555555,1}, {1,0x464646,1}}, linear_gradient= {0,0,0,40}, 
        corners={ {"circle",5}} },
        {x=470,y=120,w=180,h=40, colour= { {0,0x313131,1}, }, 
        corners={ {"circle",5}}, border=1 },
        {x=471,y=121,w=178,h=38, colour= { {0,0x848484,1}, {1,0x525252,1}, }, linear_gradient= {0,0,0,38}, 
        corners={ {"circle",5}}, border=1 },
        
        {x=460,y=210,w=100,h=200, colour= { {0,0xFFFFFF,1}, {1,0x3D3D3D,1} }, radial_gradient= {100,0,50,100,0,200},
        corners = { {"circle",100} },},
        {x=470,y=220,w=180,h=180, colour= { {0,0xFFFFFF,1}, {1,0x3D3D3D,1} }, radial_gradient= {90,200,25,90,180,180},
        corners = { {"circle",90} },}, 
        {x=473,y=223,w=174,h=174, colour= { {0,0xFFFFFF,1}, {0.2,0x4FEFFF,1}, {1,0x206FD4,1} }, radial_gradient= {87,200,25,87,180,180},
        corners = { {"circle",87} },},
        {x=473,y=223,w=174,h=174, colour= { {0,0x000000,1}, {1,0x000000,0} }, radial_gradient= {87,87,87,87,87,83},
        corners = { {"circle",87} },},
        {x=503,y=227,w=114,h=114, colour= { {0,0xFFFFFF,0.75}, {1,0xFFFFFF,0} }, linear_gradient= {57,0,57,114},
        corners = { {"circle",57} },scale_y=0.5},
     
          {x=460, y=430, w=100, h=200,
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {0,0,0,200} },
          {x=470, y=440, w=180, h=180, 
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {180,180,10,10} ,
          corners={ {"circle",90} }, },
          {x=480, y=450, w=160, h=160,
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {20,20,160,160}  ,
          corners={ {"circle",80} }, },

    --FORTH COLUMN
        {x=680,y=25,w=100,h=60, colour= { {1,0xAAAAFF,1}},
        corners={ {"line",0},{"circle",10}, {"circle",10}, {"line",0} }, },
        {x=685,y=30,w=190*conky_parse("${time %S}")/60,h=40,
        colour= { {0,0xFF0000,0.8}, {1,0xFF0000,0} },
        linear_gradient = {0,0,0,40} },
        {x=685,y=30,w=190,h=40, corners={ {"line",0},{"circle",8}, {"circle",8}, {"line",0} },
        colour= { {0,0xFFFFFF,0.8}, {1,0xFFFFFF,0} },
        linear_gradient = {0,0,0,40} },
        
        {x=680,y=110,w=100,h=60, colour= { {1,0xAAAAFF,1}} },
        {x=690,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear" } ,
        {x=720,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>10  } ,
        {x=750,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>20  } ,
        {x=780,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>30  } ,
        {x=810,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(os.date("%S"))>40  } ,
        {x=840,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(os.date("%S"))>50  } ,
        
        {x=680,y=210,w=100,h=60, colour= { {1,0xAAAAFF,conky_parse("${time %S}")/60}} },
        
        {x=680,y=310, w=100*conky_parse("${time %S}")/60, h=60*conky_parse("${time %S}")/60, colour = { {1,0xAAAAFF,1}}  },
         
        {x=680, y=410, w=100, h=60, colour = { {1,0xAAAAFF,1}} },
        {x=680+190*conky_parse("${time %S}")/60, y=407, w=10, h=66, colour = { {1,0xFF00AA,1}} , border=6},
        
        {x=680, y=510, w=100, h=200, colour = { {0.99,0xAAAAFF,1}, {1,0xAAAAFF,0} }, radial_gradient={0,200,0,0,200,200} },
        {x=680, y=700, w=100, h=10, colour = { {1,0xFF00AA,1}} ,  corners={ {"circle",5}} , 
        angle=-90*conky_parse("${time %S}")/60, rot_x=5, rot_y=5},
        ]]
    }


    ---------------------------- PARAMETERS END HERE
    
    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)
    
    if tonumber(conky_parse("$updates"))<5 then return end
    for i in pairs(boxes_settings) do
        draw_box (cr,boxes_settings[i])
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)    
end

    
function draw_box(cr,t)

    if t.draw_me == true then t.draw_me = nil end
    if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end    

    local table_corners={"circle","curve","line"}

    local t_operators={
        clear   = CAIRO_OPERATOR_CLEAR,
        source  = CAIRO_OPERATOR_SOURCE,
        over    = CAIRO_OPERATOR_OVER,
        ["in"]      = CAIRO_OPERATOR_IN,
        out     = CAIRO_OPERATOR_OUT,
        atop    = CAIRO_OPERATOR_ATOP,
        dest    = CAIRO_OPERATOR_DEST,
        dest_over   = CAIRO_OPERATOR_DEST_OVER,
        dest_in = CAIRO_OPERATOR_DEST_IN,
        dest_out = CAIRO_OPERATOR_DEST_OUT,
        dest_atop = CAIRO_OPERATOR_DEST_ATOP,
        xor = CAIRO_OPERATOR_XOR,
        add = CAIRO_OPERATOR_ADD,
        saturate =  CAIRO_OPERATOR_SATURATE,
    }
        
    function rgba_to_r_g_b_a(tc)
        --tc={position,colour,alpha}
        local colour = tc[2]
        local alpha = tc[3]
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end

    function table.copy(t)
      local t2 = {}
      for k,v in pairs(t) do
       t2[k] = {v[1],v[2]}
      end
      return t2
    end

    function draw_corner(num,t)
        local shape=t[1]
        local radius=t[2]
        local x,y = t[3],t[4]
        if shape=="line" then
            if num == 1 then cairo_line_to(cr,radius,0) 
                elseif num == 2 then cairo_line_to(cr,x,radius) 
                elseif num == 3 then cairo_line_to(cr,x-radius,y)
                elseif num == 4 then cairo_line_to(cr,0,y-radius)
            end
        end
        if shape=="circle" then
            local PI = math.pi
           if num == 1 then cairo_arc(cr,radius,radius,radius,-PI,-PI/2)
                elseif num == 2 then cairo_arc(cr,x-radius,y+radius,radius,-PI/2,0)
                elseif num == 3 then cairo_arc(cr,x-radius,y-radius,radius,0,PI/2) 
                elseif num == 4 then cairo_arc(cr,radius,y-radius,radius,PI/2,-PI)
            end
        end
        if shape=="curve" then
            if num == 1 then cairo_curve_to(cr,0,radius ,0,0 ,radius,0) 
                elseif num == 2 then cairo_curve_to(cr,x-radius,0, x,y, x,radius)
                elseif num == 3 then cairo_curve_to(cr,x,y-radius, x,y, x-radius,y)
                elseif num == 4 then cairo_curve_to(cr,radius,y, x,y, 0,y-radius)
            end
        end        
    end   

    --check values and set default values
    if t.x == nil then t.x = 0 end
    if t.y == nil then t.y = 0 end
    if t.w == nil then t.w = conky_window.width end
    if t.h == nil then t.h = conky_window.height end
    if t.radius == nil then t.radius = 0 end
    if t.border == nil then t.border = 0 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,0.5}} end
    if t.linear_gradient ~= nil then 
        if #t.linear_gradient ~= 4 then
            t.linear_gradient = {t.x,t.y,t.width,t.height}
        end
    end 
    if t.angle==nil then t.angle = 0 end

    if t.skew_x == nil then t.skew_x=0  end
    if t.skew_y == nil then  t.skew_y=0 end
    if t.scale_x==nil then t.scale_x=1 end
    if t.scale_y==nil then t.scale_y=1 end    
    if t.rot_x == nil then t.rot_x=0  end
    if t.rot_y == nil then  t.rot_y=0 end
    
    if t.operator == nil then t.operator = "over" end
    if (t_operators[t.operator]) == nil then
        print ("wrong operator :",t.operator)
        t.operator = "over"
    end
    
    if t.radial_gradient ~= nil then 
        if #t.radial_gradient ~= 6 then
            t.radial_gradient = {t.x,t.y,0, t.x,t.y, t.width}
        end
    end 
    
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    if t.corners == nil then t.corners={ {"line",0} } end
    local t_corners = {}
    local t_corners = table.copy(t.corners)
    --don't use t_corners=t.corners otherwise t.corners is altered

    --complete the t_corners table if needed
    for i=#t_corners+1,4 do    
        t_corners[i]=t_corners[#t_corners]
        local flag=false
        for j,v in pairs(table_corners) do flag=flag or (t_corners[i][1]==v) end 
        if not flag then print ("error in corners table :",t_corners[i][1]);t_corners[i][1]="curve"  end
    end

    --this way :    
    --    t_corners[1][4]=x    
    --    t_corners[2][3]=y
    --doesn't work
    t_corners[1]={t_corners[1][1],t_corners[1][2],0,0}
    t_corners[2]={t_corners[2][1],t_corners[2][2],t.w,0}
    t_corners[3]={t_corners[3][1],t_corners[3][2],t.w,t.h}    
    t_corners[4]={t_corners[4][1],t_corners[4][2],0,t.h}        

    t.no_gradient = (t.linear_gradient == nil ) and (t.radial_gradient == nil )

    cairo_save(cr)
    cairo_translate(cr, t.x, t.y)
    if t.rot_x~=0 or t.rot_y~=0 or t.angle~=0 then
        cairo_translate(cr,t.rot_x,t.rot_y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_translate(cr,-t.rot_x,-t.rot_y)
    end
    if t.scale_x~=1 or t.scale_y~=1 or t.skew_x~=0 or t.skew_y~=0 then
        local matrix0 = cairo_matrix_t:create()
        tolua.takeownership(matrix0)
        cairo_matrix_init (matrix0, t.scale_x,math.pi*t.skew_y/180    , math.pi*t.skew_x/180    ,t.scale_y,0,0)
        cairo_transform(cr,matrix0)    
    end
    
    local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,t.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,t.w,t.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],t.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])
    
    if t.no_gradient then
        cairo_set_source_rgba(cr,rgba_to_r_g_b_a(t.colour[1]))
    else
        if t.linear_gradient ~= nil then
            pat = cairo_pattern_create_linear (t.linear_gradient[1],t.linear_gradient[2],t.linear_gradient[3],t.linear_gradient[4])
        elseif t.radial_gradient ~= nil then
            pat = cairo_pattern_create_radial (t.radial_gradient[1],t.radial_gradient[2],t.radial_gradient[3],
                t.radial_gradient[4],t.radial_gradient[5],t.radial_gradient[6])
        end
        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgba_to_r_g_b_a(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end 
     
    cairo_set_operator(cr,t_operators[t.operator]) 

    if t.border>0 then
        cairo_close_path(cr)
        if t.dash ~= nil then cairo_set_dash(cr, t.dash, 1, 0.0) end
        cairo_set_line_width(cr,t.border)
        cairo_stroke(cr)
    else
        cairo_fill(cr)
    end

    cairo_restore(cr)
end

conkyrc1 (droite)

#Fonctionnement de conky 
  total_run_times 0               #Temps en secondes ; 0 = toujours actif
  background yes                  #Pour que conky tourne en arrière plan ; no = pour les tests

#Réglages système
  cpu_avg_samples 1               #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
  net_avg_samples 2               #Nb d'échantillons pour calculer la moyenne d'utilisation CPU

#Mémoire
  double_buffer yes               #Éviter le clignotement
  no_buffers yes                  #Soustraire les mémoires tampons de la mémoire utilisée
  text_buffer_size 1024           #Taille du cache pour le texte

#Affichage
  out_to_console no               #Affiche le texte sur la sortie standard
  update_interval 1               #Taux de rafraîchissement de la fenêtre (s)

#Fenêtre conky
  alignment top_right             #Alignement
 #---
  minimum_size 75 10              #Taille minimum (px) ; largeur / hauteur
  maximum_width 75                #Largeur maximum (px)
 #---
  gap_x 10                        #Écart avec le bord gauche / droit
  gap_y 50                        #Écart avec le bord haut / bas
 #---
  draw_shades no                  #Afficher les ombres
  draw_outline no                 #Afficher les contours de fenêtre
  draw_borders no                 #Afficher des contours autour des blocs de texte
  border_width 1                  #Largeur du contour
  border_inner_margin 1           #Largeur des marges
 #---
  own_window yes                  #Utiliser sa propre fenêtre
  own_window_type override        #Type de fenêtre ; normal / override / desktop
  own_window_transparent yes      #Pseudo transparence
  own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

#Mise en forme
  use_xft yes                     #Utiliser Xft (polices lissées etc)
  xftalpha 1                      #Utiliser Xft
  override_utf8_locale yes        #Force l'UTF8
  uppercase no                    #Tout le texte en majuscule
  use_spacer left                 #Ajoute des espaces après certains objets (qu'avec des polices fixes)
 #---
  #xftfont sans:size=9            #Police par défaut
  xftfont saxMono:size=9          #Police par défaut
 #---
  default_bar_size 35 3           #Barre par défaut (longeur hauteur)
  stippled_borders 3              #Taille des pointillés

#Couleurs
  default_color FFFFFF            #Couleur par défaut
  default_shade_color 333333      #Couleur des ombres
  default_outline_color black     #Couleur des contours
 #---
  color1 2864D5                   #Bleu
  color2 242424                   #Gris 1 (foncé)
  color3 334E73                   #Gris 2 (bleuté)

 #---
  short_units yes                 #Unités courtes
  pad_percents 2                  #Unité à 2 décimales
  top_name_width 6                #Largeur des processus

#LUA : Clock
  #lua_load $HOME/conky/Script/clock.lua
  #lua_draw_hook_pre clock_rings

#LUA : Calendar
  #lua_load $HOME/conky/Script/calendrier.lua
  #lua_draw_hook_pre widgets

#LUA : Background
  #lua_load $HOME/conky/Script/bg.lua
  #lua_draw_hook_pre draw_bg

#LUA : Box Widget
  lua_load $HOME/conky/box/box2.lua
  lua_draw_hook_pre main_box

TEXT
${color1}${voffset 16}${font angelicwar:size=20}${alignc}${offset 5}${time %H}${font}
${color2}${voffset -18}${font Vertigo 2 BRK:size=8}U
O
H${font}

${color1}${voffset 16}${font angelicwar:size=20}${alignc}${offset 5}${time %M}${font}
${color2}${voffset -18}${font Vertigo 2 BRK:size=8}N
I
M${font}

${color1}${voffset 16}${font angelicwar:size=20}${alignc}${offset 5}${time %S}${font}
${color2}${voffset -18}${font Vertigo 2 BRK:size=8}C
E
S${font}

box2.lua

--[[BOX WIDGET v1.1 by Wlourf 27/01/2011
This widget can drawn some boxes, even circles in your conky window
http://u-scripts.blogspot.com/2011/01/box-widget.html)

Inspired by Background by londonali1010 (2009), thanks ;-) 

The parameters (all optionals) are :
x           - x coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
y           - y coordinate of top-left corner of the box, default = 0 = (top-left corner of conky window)
w           - width of the box, default = width of the conky window
h           - height of the box, default = height of the conky window
corners     - corners is a table for the four corners in this order : top-left, top-right,bottom-right, bottom-left
              each corner is defined in a table with a shape and a radius, available shapes are : "curve","circle","line"
              example for the same shapes for all corners:
              { {"circle",10} }
              example for first corner different from the three others
              { {"circle",10}, {"circle",5}  }              
              example for top corners differents from bottom corners
              { {"circle",10}, {"circle",10}, {"line",0}  }   
              default = { {"line",0} } i.e=no corner
operator    - set the compositing operator (needs in the conkyrc : own_window_argb_visual yes)                          
              see http://cairographics.org/operators/
              available operators are :
              "clear","source","over","in","out","atop","dest","dest_over","dest_in","dest_out","dest_atop","xor","add","saturate"
              default = "over"
border      - if border>0, the script draws only the border, like a frame, default=0
dash        - if border>0 and dash>0, the border is draw with dashes, default=0
skew_x      - skew box around x axis, default = 0
skew_y      - skew box around y axis, default = 0
scale_x     - rescale the x axis, default=1, useful for drawing elipses ...
scale_y     - rescale the x axis, default=1
angle        - angle of rotation of the box in degrees, default = 0
              i.e. a horizontal graph
rot_x       - x point of rotation's axis, default = 0,
              relative to top-left corner of the box, (not the conky window)
rot_y       - y point of rotation's axis, default = 0              
              relative to top-left corner of the box, (not the conky window)
draw_me     - if set to false, box is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the box is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",              
              
linear_gradient - table with the coordinates of two points to define a linear gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,x2,y2}
radial_gradient - table with the coordinates of two circle to define a radial gradient,
                  points are relative to top-left corner of the box, (not the conky window)
                  {x1,y1,r1,x2,y2,r2} (r=radius)
colour      - table of colours, default = plain white {{1,0xFFFFFF,0.5}}
              this table contains one or more tables with format {P,C,A}
              P=position of gradient (0 = start of the gradient, 1= end of the gradient)
              C=hexadecimal colour 
              A=alpha (opacity) of color (0=invisible,1=opacity 100%)
              Examples :
              for a plain color {{1,0x00FF00,0.5}}
              for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}        {x=80,y=150,w=100,h=20,
        radial_gradient={20,20,0,20,20,20},
        colour={{0.5,0xFFFFFF,1},{1,0x000000,0}},
              or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle
              for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              and so on ...



To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
    lua_load ~/scripts/box.lua
    lua_draw_hook_pre main_box
    
And leave one line blank or not after TEXT

Changelog:
+ v1.0 -- Original release (19.12.2010)
+ v1.1 -- Adding parameters: operator, dash, angle, skew_x, skew_y, draw_me
          corners are described in a table

--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation version 3 (GPLv3)
--     
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--     
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
--      MA 02110-1301, USA.        


]]

  
require 'cairo'
    
function conky_main_box()

    if conky_window==nil then return end
    
    ---------------------- PARAMETERS BEGIN HERE
    local boxes_settings={
    --Heure
    {x=15, y=5,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",30}, {"",0}},
    colour={{0,0x242424,0.8}},
    },
    
    --Minute
    {x=15, y=82,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",30}, {"",0}},
    colour={{0,0x242424,0.8}},
    },
    
    --Seconde
    {x=15, y=159,w=60,h=60,
    corners={ {"circle",30}, {"circle",30}, {"circle",30}, {"",0}},
    colour={{0,0x242424,0.8}},
    },
    
    --[[
    FIRST COLUMN
        --default colour and corner
        {x=10, y=25,w=100,h=60},

        --corners
        {x=10, y=110,w=100,h=60,

        --the missing corners are repeated
        corners={ {"",0}, {"circle",30},}
        },
        --border
        {x=10, y=210,w=100,h=60,
        --the missing corners are repeated
        corners={ {"",0}, {"circle",30}, {"",0}, {"circle",30}},
        border= 3
        },

        --dashed border
        {x=10, y=310,w=100,h=60,
        --the missing corners are repeated
        corners={ {"",0}, {"circle",30}, {"",0}, {"circle",30}},
        border= 5, dash = 10
        },    
        
        --plain colour
        {x=10, y=410,w=100,h=60,
        colour={ {0,0xF48F35,0.5} },
        },

        --linear gradient
        {x=10, y=510,w=100,h=60,
        colour={ {0,0xF48F35,0.2}, {1,0xF48F35,1}},
        linear_gradient={0,0,200,0},
        corners={ {"circle",30},}, 
        },
        
        --radial gradient
        {x=10, y=610,w=100,h=60,
        colour={ {1,0xF48F35,0.2}, {0,0xF48F35,1}},
        radial_gradient={100,30,0, 100,30,100},
        corners={ {"circle",30},}, 
        },

        --rainbow box
        {x=10, y=710,w=100,h=60,
        colour={ {0.0,0x454F8A,1}, 
                 {0.1,0xD9668F,1},
                 {0.2,0xFC433E,1},
                 {0.3,0xFA8A38,1},                 
                 {0.4,0xFFD21B,1},
                 {0.5,0xFFFF5F,1},                 
                 {0.6,0x80BD70,1},               
                 {0.7,0x30724C,1},                 
                 {0.8,0x9CEDDE,1},                  
                 },
        linear_gradient={0,0,200,100},
        corners={ {"circle",30}, {"circle",30}, {"line",0}}, 
        },

    --SECOND COLUMN
        --default colour and corner
        {x=230, y=25,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=55,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="over"},

        {x=230, y=110,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=140,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="source"},

        {x=230, y=210,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=240,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="clear"},

        {x=230, y=310,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=340,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="atop"},                

        {x=230, y=410,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=440,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="dest_out"},   
        
        {x=230, y=510,w=100,h=60, colour={ {0,0xFF0000,0.5} }},
        {x=300, y=540,w=150,h=40, colour={ {0,0x0000FF,0.5} }, 
                operator="saturate"},   
        
        {x=230, y=610,w=100,h=60, colour={ {1,0xFF0000,1} }, },
        {x=250, y=620,w=160,h=40, colour={ {0,0xFF0000,0.0} , {0.5,0x000000,1} , {1,0xFF0000,0.0} }, linear_gradient={0,0,160,0} },   
    
        {x=230, y=710,w=100,h=60, colour={ {0,0xFF0000,0.3} , {0.5,0xFF0000,1} , {1,0xFF0000,0.3} }, linear_gradient={0,0,200,0} },
        {x=310, y=720,w=40,h=40, colour={ {0,0x000000,1.0} }, corners={ {"circle",20}},  },
    
    --THIRD COLUMN
        {x=460,y=25,w=100,h=60, colour= { {1,0xAAAAFF,1}},
        corners={ {"circle",10} }, },
        {x=465,y=30,w=190,h=40, corners={ {"circle",8} },
        colour= { {0,0xFFFFFF,0.8}, {1,0xFFFFFF,0} },
        linear_gradient = {0,0,0,40} },
        
        {x=460,y=110,w=100,h=60, colour= { {1,0x585858,1}}, },
        {x=470,y=120,w=180,h=40, colour= { {0,0x555555,1}, {1,0x464646,1}}, linear_gradient= {0,0,0,40}, 
        corners={ {"circle",5}} },
        {x=470,y=120,w=180,h=40, colour= { {0,0x313131,1}, }, 
        corners={ {"circle",5}}, border=1 },
        {x=471,y=121,w=178,h=38, colour= { {0,0x848484,1}, {1,0x525252,1}, }, linear_gradient= {0,0,0,38}, 
        corners={ {"circle",5}}, border=1 },
        
        {x=460,y=210,w=100,h=200, colour= { {0,0xFFFFFF,1}, {1,0x3D3D3D,1} }, radial_gradient= {100,0,50,100,0,200},
        corners = { {"circle",100} },},
        {x=470,y=220,w=180,h=180, colour= { {0,0xFFFFFF,1}, {1,0x3D3D3D,1} }, radial_gradient= {90,200,25,90,180,180},
        corners = { {"circle",90} },}, 
        {x=473,y=223,w=174,h=174, colour= { {0,0xFFFFFF,1}, {0.2,0x4FEFFF,1}, {1,0x206FD4,1} }, radial_gradient= {87,200,25,87,180,180},
        corners = { {"circle",87} },},
        {x=473,y=223,w=174,h=174, colour= { {0,0x000000,1}, {1,0x000000,0} }, radial_gradient= {87,87,87,87,87,83},
        corners = { {"circle",87} },},
        {x=503,y=227,w=114,h=114, colour= { {0,0xFFFFFF,0.75}, {1,0xFFFFFF,0} }, linear_gradient= {57,0,57,114},
        corners = { {"circle",57} },scale_y=0.5},
     
          {x=460, y=430, w=100, h=200,
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {0,0,0,200} },
          {x=470, y=440, w=180, h=180, 
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {180,180,10,10} ,
          corners={ {"circle",90} }, },
          {x=480, y=450, w=160, h=160,
          colour={{0,0x858585,1}, {1,0x000000,1}}, linear_gradient= {20,20,160,160}  ,
          corners={ {"circle",80} }, },

    --FORTH COLUMN
        {x=680,y=25,w=100,h=60, colour= { {1,0xAAAAFF,1}},
        corners={ {"line",0},{"circle",10}, {"circle",10}, {"line",0} }, },
        {x=685,y=30,w=190*conky_parse("${time %S}")/60,h=40,
        colour= { {0,0xFF0000,0.8}, {1,0xFF0000,0} },
        linear_gradient = {0,0,0,40} },
        {x=685,y=30,w=190,h=40, corners={ {"line",0},{"circle",8}, {"circle",8}, {"line",0} },
        colour= { {0,0xFFFFFF,0.8}, {1,0xFFFFFF,0} },
        linear_gradient = {0,0,0,40} },
        
        {x=680,y=110,w=100,h=60, colour= { {1,0xAAAAFF,1}} },
        {x=690,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear" } ,
        {x=720,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>10  } ,
        {x=750,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>20  } ,
        {x=780,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(conky_parse("${time %S}"))>30  } ,
        {x=810,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(os.date("%S"))>40  } ,
        {x=840,y=125,w=30,h=30, corners={ {"circle",15} },operator="clear", draw_me=tonumber(os.date("%S"))>50  } ,
        
        {x=680,y=210,w=100,h=60, colour= { {1,0xAAAAFF,conky_parse("${time %S}")/60}} },
        
        {x=680,y=310, w=100*conky_parse("${time %S}")/60, h=60*conky_parse("${time %S}")/60, colour = { {1,0xAAAAFF,1}}  },
         
        {x=680, y=410, w=100, h=60, colour = { {1,0xAAAAFF,1}} },
        {x=680+190*conky_parse("${time %S}")/60, y=407, w=10, h=66, colour = { {1,0xFF00AA,1}} , border=6},
        
        {x=680, y=510, w=100, h=200, colour = { {0.99,0xAAAAFF,1}, {1,0xAAAAFF,0} }, radial_gradient={0,200,0,0,200,200} },
        {x=680, y=700, w=100, h=10, colour = { {1,0xFF00AA,1}} ,  corners={ {"circle",5}} , 
        angle=-90*conky_parse("${time %S}")/60, rot_x=5, rot_y=5},
        ]]
    }


    ---------------------------- PARAMETERS END HERE
    
    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)
    
    if tonumber(conky_parse("$updates"))<5 then return end
    for i in pairs(boxes_settings) do
        draw_box (cr,boxes_settings[i])
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)    
end

    
function draw_box(cr,t)

    if t.draw_me == true then t.draw_me = nil end
    if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end    

    local table_corners={"circle","curve","line"}

    local t_operators={
        clear   = CAIRO_OPERATOR_CLEAR,
        source  = CAIRO_OPERATOR_SOURCE,
        over    = CAIRO_OPERATOR_OVER,
        ["in"]      = CAIRO_OPERATOR_IN,
        out     = CAIRO_OPERATOR_OUT,
        atop    = CAIRO_OPERATOR_ATOP,
        dest    = CAIRO_OPERATOR_DEST,
        dest_over   = CAIRO_OPERATOR_DEST_OVER,
        dest_in = CAIRO_OPERATOR_DEST_IN,
        dest_out = CAIRO_OPERATOR_DEST_OUT,
        dest_atop = CAIRO_OPERATOR_DEST_ATOP,
        xor = CAIRO_OPERATOR_XOR,
        add = CAIRO_OPERATOR_ADD,
        saturate =  CAIRO_OPERATOR_SATURATE,
    }
        
    function rgba_to_r_g_b_a(tc)
        --tc={position,colour,alpha}
        local colour = tc[2]
        local alpha = tc[3]
        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end

    function table.copy(t)
      local t2 = {}
      for k,v in pairs(t) do
       t2[k] = {v[1],v[2]}
      end
      return t2
    end

    function draw_corner(num,t)
        local shape=t[1]
        local radius=t[2]
        local x,y = t[3],t[4]
        if shape=="line" then
            if num == 1 then cairo_line_to(cr,radius,0) 
                elseif num == 2 then cairo_line_to(cr,x,radius) 
                elseif num == 3 then cairo_line_to(cr,x-radius,y)
                elseif num == 4 then cairo_line_to(cr,0,y-radius)
            end
        end
        if shape=="circle" then
            local PI = math.pi
           if num == 1 then cairo_arc(cr,radius,radius,radius,-PI,-PI/2)
                elseif num == 2 then cairo_arc(cr,x-radius,y+radius,radius,-PI/2,0)
                elseif num == 3 then cairo_arc(cr,x-radius,y-radius,radius,0,PI/2) 
                elseif num == 4 then cairo_arc(cr,radius,y-radius,radius,PI/2,-PI)
            end
        end
        if shape=="curve" then
            if num == 1 then cairo_curve_to(cr,0,radius ,0,0 ,radius,0) 
                elseif num == 2 then cairo_curve_to(cr,x-radius,0, x,y, x,radius)
                elseif num == 3 then cairo_curve_to(cr,x,y-radius, x,y, x-radius,y)
                elseif num == 4 then cairo_curve_to(cr,radius,y, x,y, 0,y-radius)
            end
        end        
    end   

    --check values and set default values
    if t.x == nil then t.x = 0 end
    if t.y == nil then t.y = 0 end
    if t.w == nil then t.w = conky_window.width end
    if t.h == nil then t.h = conky_window.height end
    if t.radius == nil then t.radius = 0 end
    if t.border == nil then t.border = 0 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,0.5}} end
    if t.linear_gradient ~= nil then 
        if #t.linear_gradient ~= 4 then
            t.linear_gradient = {t.x,t.y,t.width,t.height}
        end
    end 
    if t.angle==nil then t.angle = 0 end

    if t.skew_x == nil then t.skew_x=0  end
    if t.skew_y == nil then  t.skew_y=0 end
    if t.scale_x==nil then t.scale_x=1 end
    if t.scale_y==nil then t.scale_y=1 end    
    if t.rot_x == nil then t.rot_x=0  end
    if t.rot_y == nil then  t.rot_y=0 end
    
    if t.operator == nil then t.operator = "over" end
    if (t_operators[t.operator]) == nil then
        print ("wrong operator :",t.operator)
        t.operator = "over"
    end
    
    if t.radial_gradient ~= nil then 
        if #t.radial_gradient ~= 6 then
            t.radial_gradient = {t.x,t.y,0, t.x,t.y, t.width}
        end
    end 
    
    for i=1, #t.colour do    
        if #t.colour[i]~=3 then 
            print ("error in color table")
            t.colour[i]={1,0xFFFFFF,1} 
        end
    end

    if t.corners == nil then t.corners={ {"line",0} } end
    local t_corners = {}
    local t_corners = table.copy(t.corners)
    --don't use t_corners=t.corners otherwise t.corners is altered

    --complete the t_corners table if needed
    for i=#t_corners+1,4 do    
        t_corners[i]=t_corners[#t_corners]
        local flag=false
        for j,v in pairs(table_corners) do flag=flag or (t_corners[i][1]==v) end 
        if not flag then print ("error in corners table :",t_corners[i][1]);t_corners[i][1]="curve"  end
    end

    --this way :    
    --    t_corners[1][4]=x    
    --    t_corners[2][3]=y
    --doesn't work
    t_corners[1]={t_corners[1][1],t_corners[1][2],0,0}
    t_corners[2]={t_corners[2][1],t_corners[2][2],t.w,0}
    t_corners[3]={t_corners[3][1],t_corners[3][2],t.w,t.h}    
    t_corners[4]={t_corners[4][1],t_corners[4][2],0,t.h}        

    t.no_gradient = (t.linear_gradient == nil ) and (t.radial_gradient == nil )

    cairo_save(cr)
    cairo_translate(cr, t.x, t.y)
    if t.rot_x~=0 or t.rot_y~=0 or t.angle~=0 then
        cairo_translate(cr,t.rot_x,t.rot_y)
        cairo_rotate(cr,t.angle*math.pi/180)
        cairo_translate(cr,-t.rot_x,-t.rot_y)
    end
    if t.scale_x~=1 or t.scale_y~=1 or t.skew_x~=0 or t.skew_y~=0 then
        local matrix0 = cairo_matrix_t:create()
        tolua.takeownership(matrix0)
        cairo_matrix_init (matrix0, t.scale_x,math.pi*t.skew_y/180    , math.pi*t.skew_x/180    ,t.scale_y,0,0)
        cairo_transform(cr,matrix0)    
    end
    
    local tc=t_corners
    cairo_move_to(cr,tc[1][2],0)
    cairo_line_to(cr,t.w-tc[2][2],0)
    draw_corner(2,tc[2])
    cairo_line_to(cr,t.w,t.h-tc[3][2])
    draw_corner(3,tc[3])
    cairo_line_to(cr,tc[4][2],t.h)
    draw_corner(4,tc[4])
    cairo_line_to(cr,0,tc[1][2])
    draw_corner(1,tc[1])
    
    if t.no_gradient then
        cairo_set_source_rgba(cr,rgba_to_r_g_b_a(t.colour[1]))
    else
        if t.linear_gradient ~= nil then
            pat = cairo_pattern_create_linear (t.linear_gradient[1],t.linear_gradient[2],t.linear_gradient[3],t.linear_gradient[4])
        elseif t.radial_gradient ~= nil then
            pat = cairo_pattern_create_radial (t.radial_gradient[1],t.radial_gradient[2],t.radial_gradient[3],
                t.radial_gradient[4],t.radial_gradient[5],t.radial_gradient[6])
        end
        for i=1, #t.colour do
            cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgba_to_r_g_b_a(t.colour[i]))
        end
        cairo_set_source (cr, pat)
        cairo_pattern_destroy(pat)
    end 
     
    cairo_set_operator(cr,t_operators[t.operator]) 

    if t.border>0 then
        cairo_close_path(cr)
        if t.dash ~= nil then cairo_set_dash(cr, t.dash, 1, 0.0) end
        cairo_set_line_width(cr,t.border)
        cairo_stroke(cr)
    else
        cairo_fill(cr)
    end

    cairo_restore(cr)
end

Et voilà smile N'hésitez pas pour les questions.

Merci à wlourf pour son magnifique script Lua !


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

Hors ligne

#783 Le 19/07/2011, à 14:25

areuh

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

Salut,

Voici qques jours que j'ai decouvert le topic.
Je tripatouille des conkyrc trouves ici et la. j'arrive a en lancer plusieurs grace au lanceur .sh, pas de probleme.

Là, je souhaiterai tester les scripts .lua mais je n'y arrive point.

je fais un simple copie colle mais j'ai toujours la meme erreur.
Je cherche a faire des anneaux.

Je vous mets les codes
le .conkyrc

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0

# affiche le texte sur la sortie standard
out_to_console no

# réglage de la mémoire, pour éviter le clignotement
double_buffer yes
# Soustraire les mémoires tampons de la mémoire utilisée
no_buffers yes
text_buffer_size 2048

# taux de rafraichissement de la fenêtre (en secondes)
update_interval 1

# nombre d'échantillons à utiliser pour calculer la moyenne d'utilisation
cpu_avg_samples 4
net_avg_samples 2

# taille et positon
alignment tr


# écart avec le bord x=gauche ou droit y= haut ou bas
gap_x 460
gap_y 300

#  afficher les ombres
draw_shades yes
# afficher des contours
draw_outline no
# contours autour des blocs de texte
draw_borders no
# largeur du contour
border_width 1

#pour que conky tourne en arrière plan background no pour les tests
background yes

own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager
# Utiliser Xft (polices lissées etc)
use_xft yes

override_utf8_locale yes # force UTF8

#police a utiliser : use_xft doit être a "yes"
xftfont Fixed:size=10#OCR A Std:size=6
# Tout le texte en majuscule
uppercase no

# Ajoute des espaces après certains objets pour éviter de les faire bouger.
# Fonctionne uniquement avec les polices Fixes
use_spacer right
default_color fffffffff
#lua_load  /home/fred/.conky/audio_spectrum.lua
lua_load /home/fred/.conky/rond.lua
lua_draw_hook_pre ring_stats
TEXT



${voffset -5}${goto 137}cpu : ${cpu cpu0}%



${voffset 2}${goto 136}ram : $memperc%




${voffset -5}${goto 25}cpu1 : ${goto 150}wlan1 : ${goto 275}${goto 275}cpu2 :
${voffset -4}${goto 25}${cpu cpu1}%${goto 150}${wireless_link_qual_perc wlan1}%${goto 279}${cpu cpu2}%       



${voffset 8}${goto 134}swap : $swapperc%

rond.lua

-[[
Ring Meters by londonali1010 (2009)

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

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

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

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

settings_table = {
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=0.95,
        x=171, y=214,
        radius=159,
        thickness=15,
        start_angle=15,
        end_angle=345
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=0.85,
        x=171, y=214,
        radius=123,
        thickness=40,
        start_angle=-82.5,
        end_angle=82.5
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=0.85,
        x=171, y=214,
        radius=123,
        thickness=40,
        start_angle=97.5,
        end_angle=262.5
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=0.65,
        x=171, y=214,
        radius=90,
        thickness=15,
        start_angle=25,
        end_angle=155
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xffffff,
        fg_alpha=0.65,
        x=171, y=214,
        radius=90,
        thickness=15,
        start_angle=205,
        end_angle=335
    },
    {
        name='wireless_link_qual_perc',
        arg='wlan1',
        max=100,
        bg_colour=0x000000,
        bg_alpha=1,
        fg_colour=0xfffffff,
        fg_alpha=0.4,
        x=171, y=214,
        radius=50,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
}

require 'cairo'

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

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

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

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

    -- Draw background ring

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

    -- Draw indicator ring

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

function conky_ring_stats()
    local function setup_rings(cr,pt)
        local str=''
        local value=0

        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)

        value=tonumber(str)
        pct=value/pt['max']

        draw_ring(cr,pct,pt)
    end

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

    local cr=cairo_create(cs)    

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

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

voici l'erreur retournee:

Conky: desktop window (1c000a9) is subwindow of root window (15d)
Conky: window type - desktop
Conky: drawing to created window (0x4600001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_ring_stats execution failed: attempt to call a nil value

la derniere se repete a l'infini.

j'ai essaye avec plusieurs scripts et j'ai toujours cette erreur.
je cherche a reproduire l'eclipse d'informaticous
http://forum.ubuntu-fr.org/viewtopic.ph … 6972&p=105

j'ai le texte, les valeurs qui se mettent a jour mais c'est tout.

si vous pouviez me filer un coup de main svp.
Merci
areuh


longue vie aux forums,
merci,
a+,
areuh.

Hors ligne

#784 Le 19/07/2011, à 15:57

Fenouille84

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

areuh a écrit :

Salut,
...
Là, je souhaiterai tester les scripts .lua mais je n'y arrive point.
...
voici l'erreur retournee:

...
Conky: llua_do_call: function conky_ring_stats execution failed: attempt to call a nil value

je cherche a reproduire l'eclipse d'informaticous
http://forum.ubuntu-fr.org/viewtopic.ph … 6972&p=105

Salut areuh !

J'ai jeté un coup d'oeil au script d'informaticous. Je pense que le soucis vient de la variable pour internet.
Essaye de remplacer, dans le fichier Lua, le wlan1 par wlan0

Si ça ne fonctionne toujours pas, lance dans un terminal :

iwconfig

Et colle le résultat ici wink


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

Hors ligne

#785 Le 19/07/2011, à 17:17

areuh

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

hop,

Fenouille84

bon probleme reglé mais... sans avoir la soluce.
j'ai fait 3 manips:
- changer le chemin d'appel du fichier lua car fred, c'est pas moi, c'est... fred
- j'ai modifié en wlan0 (j'aurai pu lire un minimum qd meme)
De memoire j'avais encore l'erreur ds la console apres ces 2 manips
et apres relecture de la console j'avais aussi celui-ci

Conky: llua_load: /home/areuhtest/Bureau/test/rond.lua:16: unexpected symbol near '[[Ring Meters by londonali1010 (2009)

j'ai dc viré le commentaire au debut du fichier et... miracle

je croyais que l'eclipse etait une image comprise ds les scripts d'informaticous mais non.
va falloir que relise qques 4000 posts pour savoir comment on integre une image ronde ds un anneau

j'essaierai avt de revenir.
Merci bien pour ton aide
a+
areuh


longue vie aux forums,
merci,
a+,
areuh.

Hors ligne

#786 Le 21/07/2011, à 07:46

shamen456

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

Bonjour a tous...

@usm77 : Est-ce que tu sais poster ton conky météo ? j'aimerais remplacer mes icônes météo standard (monochrome) par des images...

@Fenouille84 : ton conky "portal" me donne des idées... je crois que je vais adapter qqch pour mes disques fixes avec le script lua de wlourf

@tous : Est-ce que quelqu'un sait comment récupérer une donnée météo pour l'inclure dans un ring lua ? (j'aimerais faire un thermometre/barometre style "marine")

Bon travail à tous...

Hors ligne

#787 Le 22/07/2011, à 19:24

Fenouille84

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

shamen456 a écrit :

@Fenouille84 : ton conky "portal" me donne des idées... je crois que je vais adapter qqch pour mes disques fixes avec le script lua de wlourf

Libre à toi ! J'ai hâte de voir le résultat wink


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

Hors ligne

#788 Le 22/07/2011, à 20:35

usm77

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

shamen456 a écrit :

@usm77 : Est-ce que tu sais poster ton conky météo ? j'aimerais remplacer mes icônes météo standard (monochrome) par des images...

J'ai déjà posté le conkyForecast.template sur la page précédente, tu dois ajouter la variable $image avec comme paramètre le datatype concerné,
par exemple :
${image [--datatype=WI] -p 10,30 -s 70x70} ou  -p est égale à la position et -s est égale à la taille de l'image
@+

Dernière modification par usm77 (Le 22/07/2011, à 20:37)

Hors ligne

#789 Le 25/07/2011, à 20:16

djipey

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

Bonsoir. Je ne sais pas si c'est pareil chez vous, mais chez moi la version 1.8.3 de conky me provoque certains bugs d'affichage pour ce passage du conkyrc:

${execpi 15 grep \/media\/ /etc/mtab | cut -d ' ' -f 2 | cut -d '/' -f 3 | while read line ; do
echo '$color '$line':${color2}${alignc} ${fs_bar 8,75 '/media/$line'} ${alignr}${fs_free '/media/$line'}  /  ${fs_size '/media/$line'} (${fs_free_perc '/media/$line'})%'
done }

Qui a pour but d'afficher automatiquement les disques montés. Voyez plutôt le bug:

bug.png

Hors ligne

#790 Le 25/07/2011, à 23:26

Levi59

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

Tu as essayé d'augmenter la valeur de text-buffer?

Hors ligne

#791 Le 26/07/2011, à 06:24

djipey

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

Je l'ai passé à 4096, mais ça n'a rien changé.

Dernière modification par djipey (Le 26/07/2011, à 06:24)

Hors ligne

#792 Le 26/07/2011, à 10:16

Levi59

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

Donne le résultat de la commande en console :

grep \/media\/ /etc/mtab | cut -d ' ' -f 2 | cut -d '/' -f 3

Hors ligne

#793 Le 26/07/2011, à 17:26

djipey

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

Voilà:

djipey@djipey-desktop:18:25:15:~$ grep \/media\/ /etc/mtab | cut -d ' ' -f 2 | cut -d '/' -f 3
Restore
BASE-1

Restore et BASE-1 sont les noms de mes disques externes.

Hors ligne

#794 Le 26/07/2011, à 21:18

Levi59

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

Ce doit être un problème de présentation...
Essaye ce code ci (c'est celui de mon PC) :

${if_match ${exec ls /media | wc -l} >0}${color0}${execpi 10 grep ^\/dev\/ /etc/mtab | grep -v [\,\ ]ro[\,\ ] | awk -F " " {'print $2'} | while read line ; do name=$(echo $line | awk -F "/" {'print $NF'}|sed 's/^$/Root/') ;
echo $name '${goto 140}${fs_used_perc '$line'}%${goto 180}${color2}${if_match ${fs_used_perc '$line'} > 4}${fs_bar '$line'}${else}${execbar echo 4}${endif}${offset -100}${color black}${execbar echo 0}${color}'
done }${else}${alignc}- No device -${endif}

Hors ligne

#795 Le 27/07/2011, à 18:40

djipey

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

regarde ce que cela donne, avec mon code et ton code (le tien est en dessous):

screen.png

Hors ligne

#796 Le 27/07/2011, à 20:05

Fenouille84

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

djipey a écrit :
${execpi 15 grep \/media\/ /etc/mtab | cut -d ' ' -f 2 | cut -d '/' -f 3 | while read line ; do
echo '$color '$line':${color2}${alignc} ${fs_bar 8,75 '/media/$line'} ${alignr}${fs_free '/media/$line'}  /  ${fs_size '/media/$line'} (${fs_free_perc '/media/$line'})%'
done }

Quelques petit soucis dans ta ligne de commande (signe manquant, retour à la ligne inutile, etc.)
Essaye plutôt ça :

${execpi 15 grep \/media\/ /etc/mtab | cut -d ' ' -f 2 | cut -d '/' -f 3 | while read line ; do echo '$color '$line':${color2}${alignc} ${fs_bar 8,75 /media/'$line'} ${alignr}${fs_free /media/'$line'}  /  ${fs_size /media/'$line'} (${fs_free_perc /media/'$line'})%' ; done }

Chez moi ça fonctionne nickel wink

Dernière modification par Fenouille84 (Le 27/07/2011, à 20:18)


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

Hors ligne

#797 Le 28/07/2011, à 21:20

alain_111

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

usm77 a écrit :

J'ai déjà posté le conkyForecast.template sur la page précédente, tu dois ajouter la variable $image avec comme paramètre le datatype concerné,
par exemple :
${image [--datatype=WI] -p 10,30 -s 70x70} ou  -p est égale à la position et -s est égale à la taille de l'image
@+

@usm77

Bonjour,
Je voudrais essayer moi aussi de modifier les icônes par défaut de ConkyForecast pour y placer des icônes plus "agréables", comme celles que tu nous présente sur ton Conky.
J'ai bien compris le principe expliqué ci-dessus mais j'ai trois questions :
- où peut-on trouver toutes les icônes nécessaires ? Il y en a un bon nombre, si je me base sur toutes les possibilités offertes par la police ConkyWeather... Il me semble bien qu'il y a une icône pour chaque lettre de l'alphabet. ça fait donc 26 icônes différentes à trouver... ??  :+(
- quand on a les images, où faut-il les placer, dans quel répertoire ? (ou comment désigner le chemin de l'image dans le conkyForecast ?)
- Faut-il les nommer selon une nomenclature particulière ou peu importe ?

Merci pour vos réponses...

Hors ligne

#798 Le 29/07/2011, à 06:12

usm77

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

Bonjour

Ce n'est pas toi qui choisi l'icône (l'image), tu auras un affichage selon ce que te renvoi le datatype (datatype=WI dans mon exemple).
Ce qui signifie que normalement tu n'a pas besoin d'un dossier particulier pour ceux-ci, par contre si tu prends mon conky, il y a l'icône de la température qui n'appartient pas à conkyForecast et qui a été trouvé sur le net je présume (elle n'est pas de moi) et je l'ai placé dans dossier que j'ai nommé "pix" dans l'arborescence de mon conky (/home/christian/conky/pix) et donc l'affichage se fait de cette manière :

${image $HOME/conky/pix/thermo1.png -p 10,110 -s 40x40}

@+

Hors ligne

#799 Le 29/07/2011, à 08:14

areuh

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

re tlmd,

question concernant cette image (postee ds ce topic)
http://forum.ubuntu-fr.org/viewtopic.php?id=326972&p=95

qqu'un (adama88 en personne) saurait il reproduire le meme effet mais avec differentes formes (rondes, rectangulaires, etc, etc), ou un tutorial?
l'image avec la planete terre.

Merci
areuh


longue vie aux forums,
merci,
a+,
areuh.

Hors ligne

#800 Le 29/07/2011, à 17:35

djipey

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

@Fenouille84: C'est toujours la même chose, l'affichage n'est pas correct. J'ai pourtant inséré ton code sans le modifier. Incompréhensible, surtout que ça ne me le faisait pas avec la version précédente de conky !

Hors ligne