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.

#2476 Le 18/07/2010, à 10:39

Fenouille84

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

Youhou !!
Le cap des 100 pages est atteint big_smile

Pour fêter sa, voici mon nouveau conky (vertical, classique).
Il utilise un script de wlourf pour les barres en LUA.

Screen :
obnegativeblue.th.png

conkyrc1 (sur la 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 NET

#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 275 10			#Taille minimum (px) ; largeur / hauteur
  maximum_width 275			#Largeur maximum (px)
 #---
  gap_x 2				#Écart avec le bord gauche / droit
  gap_y 2				#É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

#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 right			#Ajoute des espaces après certains objets (qu'avec des polices fixes)
 #---
  xftfont saxMono:size=9 		#Police par défaut
 #---
  stippled_borders 5			#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 6D8BB0				#Bleu clair
  color2 C46428				#Orange
 #---
  short_units yes			#Unités courtes
  pad_percents 2			#Unité à 2 décimales

lua_load ~/conky/Script/bargraph.lua
lua_draw_hook_pre main_bars


TEXT
${color1}${font Carolingia:size=20}${alignr}Cal${font}
${voffset -5}${cpubar cpu6 0,247}
${color1}${font saxMono:size=25}${time %H}${font}
${font saxMono:size=10}${goto 43}${voffset -28}${time :%M:%S}
${color2}${goto 43}Heures${font}${voffset 23}
 ${color1}${font saxMono:size=25}${time %d}${font}
${font saxMono:size=10}${goto 51}${voffset -28}${exec date +%b | sed -e "s/^.\| [a-z]/\U&/g ; s/\.//g"}
${color2}${goto 51}${time %Y}${font}${voffset -78}
${color1}${execp cal | sed 's/^/ /g' | sed 's/'" $(date +%e)"'/\${color2}'" $(date +%e)"'\${color1}/1' | sed -e "1d ; s/^/\${goto 103}/g"}
${color1}${font Carolingia:size=20}${alignr}Sys${font}
${voffset -5}${cpubar cpu6 0,249}
 Uptme : ${color2}${uptime}${color1}
 Kernl : ${kernel}

${color1}${font Carolingia:size=20}${alignr}Tmp${font}
${voffset -5}${cpubar cpu6 0,239}
${execp $HOME/Script/température}

${color1}${font Carolingia:size=20}${alignr}Cpu${font}
${voffset -5}${cpubar cpu6 0,245}
 Core1 : ${color2}${cpu cpu1}%${color1} used
 Freq. : ${freq_g cpu1} GHz
${voffset -29}${goto 130}${cpugraph cpu1 20,117 000000 6D8BB0}
 Core2 : ${color2}${cpu cpu2}%${color1} used
 Freq. : ${freq_g cpu2} GHz
${voffset -29}${goto 130}${cpugraph cpu2 20,117 000000 6D8BB0}

${color1}${font Carolingia:size=20}${alignr}Mem${font}
${voffset -5}${cpubar cpu6 0,241}
 RAM   : ${mem}${goto 222}${memperc}%
 Swap  : ${swap}${goto 222}${swapperc}%

${color1}${font Carolingia:size=20}${alignr}Net${font}
${voffset -5}${cpubar cpu6 0,250}
${alignc}${if_existing /proc/net/route wlan0}Connexion WiFi - ${color2}${wireless_link_qual_perc wlan0}${offset -21}%${color1}${else}${if_existing /proc/net/route eth0}Connexion Filaire${else}Déconnecté${endif}${endif}

 Up    : ${color2}${upspeed wlan0}${color1}
 Total : ${totalup wlan0}
${voffset -29}${goto 110}${upspeedgraph wlan0 21,140 000000 6D8BB0}
 Down  : ${color2}${downspeed wlan0}${color1}
 Total : ${totaldown wlan0}
${voffset -29}${goto 110}${downspeedgraph wlan0 21,140 000000 6D8BB0}

${color1}${font Carolingia:size=20}${alignr}Sda${font}
${voffset -5}${cpubar cpu6 0,245}
 /root : ${fs_used_perc /}%${goto 213}${color2}${fs_free /}${color1}
 /home : ${fs_used_perc /home}%${goto 213}${color2}${fs_free /home}${color1}

${color1}${font Carolingia:size=20}${alignr}Sdx${font}
${voffset -5}${cpubar cpu6 0,246}
 Lexar : ${if_mounted /media/LEXAR}${fs_used_perc /media/LEXAR}%${goto 213}${color2}${fs_free /media/LEXAR}${color1}${else}off${goto 213}unmnt${endif}
 Linux : ${if_mounted /media/Linux}${fs_used_perc /media/Linux}%${goto 213}${color2}${fs_free /media/Linux}${color1}${else}off${goto 213}unmnt${endif}
 LaCie : ${if_mounted /media/LaCie_PC}${fs_used_perc /media/LaCie_PC}%${goto 213}${color2}${fs_free /media/LaCie_PC}${color1}${else}off${goto 213}unmnt${endif}

${color1}${font Carolingia:size=20}${alignr}Tdl${font}
${voffset -5}${cpubar cpu6 0,249}
${exec sed -e "s/^/ /g ; /#/d" $HOME/Ubuntu/ToDo/All}

bargraph.lua (script LUA de wlourf pour afficher les barres)

--[[ BARGRAPH WIDGET
    v2.0 by wlourf (12.07.2010)
    ce widget affiche un "bargraph" avec différents effets
    http://u-scripts.blogspot.com/2010/07/bargraph-widget.html


Les paramètres sont :

3 paramètres obligatoires
  name	- la variable conky à afficher, par ex. pour {$cpu cpu0}, inscrire name="cpu"
  arg	- l'argument pour la variable ci-dessus, par ex. pour {$cpu cpu0}, inscrire arg="cpu0"
          arg peut être une valeur numérique si name =""
  max 	- la valeur maxi pour la variable name ci-dessus, par ex. pour {$cpu cpu0}, inscrire max=100
    
Paramètres facultatifs :
  x,y		- position du point de départ de la barre, défaut = milieu de la fenêtre
  cap		- forme de la fin des ligne, valuers possibles r,b,s pour round, butt, square, défaut="b"
			http://www.cairographics.org/samples/set_line_cap/
  angle		- angle de rotation de la barre en degrés, défaut = 0 pour une barre verticale
			mettre 90 pour une barre horizontale
  skew_x	- déformation autour de l'axe x, défaut = 0
  skew_y	- déformation autour de l'axe y, défaut = 0
  blocks	- nombre de blocs a afficher dans la barre (valeurs >0), défaut = 10
  height	- hauteur d'un bloc, défaut=10 pixels
  width		- largeur d'un bloc, défaut=20 pixels
  space		- espace entre deux blocs, défaut=2 pixels
  angle_bar	- angle pour avoir la barre sous forme de cercle, bon ok ce n'est plus une barre, défaut=0
  radius	- rayon initial en pixel, uniquement pour les barres circulaires, défaut=0
			avec radius, "width" devient inopérent

Les couleurs ci-dessous sont définies entre accolades {couleur hexa, alpha}
  fg_colour	- couleur d'un bloc "allumé", défaut = {0x00FF00,1}
  bg_colour	- couleur d'un bloc "éteint", défaut = {0x00FF00,0.5}
  alarm		- valeur au dessus de laquelle le bloc changera de couleur, défaut=max
  alarm_colour	- couleur d'un bloc au dessus de alarm, défaut=fg_colour
  smooth	- (true ou false), faire un  gradient de fg_colour a bg_colour, défaut=false 
  mid_colour	- couleurs à ajouter au gradient de la forme {position dans le gradient 0 à 1, couleur, alpha}
			par exemple cette table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} ajoutera 
			3 couleurs au gradient créer par fg_colour et alarm_colour, défaut=pas de mid_colour
  led_effect	- permet d'ajouter des effets de "LED" à chaque bloc, défaut=pas d'effet "led"
			si smooth est présent, led_effect n'a pas d'effet
			valuers possibles "r","a","e", pour radial, parrallèle, perdendiculaire à la barre

led_effect doit être couplé avec des couleurs ci-dessous
  fg_led	- couleur centrale d'un bloc "allumé", défaut = fg_colour
  bg_led	- couleur centrale d'un bloc "allumé", défaut = bg_colour
  alarm_led	- couleur centrale d'un bloc > alarm,  défaut = alarm_colour

paramètres de reflexion (la reflexion ne fonctionne pas pour les barres "circulaires")
  reflection_alpha	- ajoute un effet de réflexion, valeurs de 0 à 1, défaut=0=pas de reflexion
  reflection_scale	- hauteur de la réflexion (défaut=1=hauteur du texte)
  reflection_length	- longueur de la réflexion, définit à quelle hauteur de la réflexion l'opacité sera nulle
				valeur de 0 à 1, défaut=1
  reflection		- position de la reflexion, relative à la bare verticale, défaut="b"
				valeurs possibles "b","t","l","r" pour bottom, top, left, right


v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value    
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 March 2010) added parameters radius & angle_bar to draw the bar in a circular way
v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
]]

require 'cairo'

----------------START OF PARAMETERS ----------
function conky_main_bars()
    bars_settings={

--[[ Version verticale
        {
            name="exec",
            arg="hddtemp /dev/sda | cut -c 24-25",
            max=50,
            alarm=42,
            bg_colour={0x000000,1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=200,y=271,
            blocks=1,
            height=35,width=8,
            smooth=true,
        },
        {
            name="platform",
            arg="coretemp.0 temp 1",
            max=70,
            alarm=62,
            bg_colour={0x000000,1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=215,y=271,
            blocks=1,
            height=35,width=8,
            smooth=true,
        },
        {
            name="platform",
            arg="coretemp.1 temp 1",
            max=70,
            alarm=62,
            bg_colour={0x000000,1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=230,y=271,
            blocks=1,
            height=35,width=8,
            smooth=true,
        },
    }
]]

--[[ Version horizontale ]]
        {
            name="exec",
            arg="hddtemp /dev/sda | cut -c 24-25",
            max=50,
            alarm=42,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=66,y=238,
            blocks=1,
            height=110,width=7,
            smooth=true,
        },
        {
            name="platform",
            arg="coretemp.0 temp 1",
            max=75,
            alarm=65,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=66,y=251,
            blocks=1,
            height=110,width=7,
            smooth=true,
        },
        {
            name="platform",
            arg="coretemp.1 temp 1",
            max=75,
            alarm=65,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=66,y=264,
            blocks=1,
            height=110,width=7,
            smooth=true,
        },
        {
            name="memperc",
            arg="",
            max=100,
            alarm=50,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=108,y=431,
            blocks=1,
            height=108,width=7,
            smooth=true,
        },
        {
            name="swapperc",
            arg="",
            max=100,
            alarm=50,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=108,y=444,
            blocks=1,
            height=108,width=7,
            smooth=true,
        },
        {
            name="fs_used_perc",
            arg="/",
            max=100,
            alarm=70,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=94,y=639,
            blocks=1,
            height=113,width=7,
            smooth=true,
        },
        {
            name="fs_used_perc",
            arg="/home",
            max=100,
            alarm=70,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=94,y=652,
            blocks=1,
            height=113,width=7,
            smooth=true,
        },
        {
            name="fs_used_perc",
            arg="/media/LEXAR",
            max=100,
            alarm=70,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=94,y=712,
            blocks=1,
            height=113,width=7,
            smooth=true,
        },
        {
            name="fs_used_perc",
            arg="/media/Linux",
            max=100,
            alarm=70,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=94,y=725,
            blocks=1,
            height=113,width=7,
            smooth=true,
        },
        {
            name="fs_used_perc",
            arg="/media/LaCie_PC",
            max=100,
            alarm=70,
            angle=90,
            bg_colour={0xffffff,0.1},
            fg_colour={0x6666dd,1},
            alarm_colour={0xff5500,1},
            x=94,y=738,
            blocks=1,
            height=113,width=7,
            smooth=true,
        },
    }
    
-----------END OF PARAMETERS--------------


    
    if conky_window == nil then return end
    
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    
    cr = cairo_create(cs)    
    --prevent segmentation error when reading cpu state
    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(bars_settings) do
            
            draw_multi_bar_graph(bars_settings[i])
            
        end
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)

end



function draw_multi_bar_graph(t)
    cairo_save(cr)
    --check values
    if t.name==nil and t.arg==nil then 
        print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
        return
    end
    if t.max==nil then
        print ("No maximum value defined, use 'max'")
        return
    end
    if t.name==nil then t.name="" end
    if t.arg==nil then t.arg="" end

    --set default values    
    if t.x == nil        then t.x = conky_window.width/2 end
    if t.y == nil        then t.y = conky_window.height/2 end
    if t.blocks == nil    then t.blocks=10 end
    if t.height == nil    then t.height=10 end
    if t.angle == nil     then t.angle=0 end
    t.angle = t.angle*math.pi/180
    --line cap style
    if t.cap==nil        then t.cap = "b" end
    local cap="b"
    for i,v in ipairs({"s","r","b"}) do 
        if v==t.cap then cap=v end
    end
    delta=0
    if t.cap=="r" or t.cap=="s" then delta = t.height end
    if cap=="s" then     cap = CAIRO_LINE_CAP_SQUARE
    elseif cap=="r" then
        cap = CAIRO_LINE_CAP_ROUND
    elseif cap=="b" then
        cap = CAIRO_LINE_CAP_BUTT
    end
    --end line cap style
    --if t.led_effect == nil    then t.led_effect="r" end
    if t.width == nil    then t.width=20 end
    if t.space == nil    then t.space=2 end
    if t.radius == nil    then t.radius=0 end
    if t.angle_bar == nil    then t.angle_bar=0 end
    t.angle_bar = t.angle_bar*math.pi/360 --halt angle
    
    --colours
    if t.bg_colour == nil     then t.bg_colour = {0x00FF00,0.5} end
    if #t.bg_colour~=2         then t.bg_colour = {0x00FF00,0.5} end
    if t.fg_colour == nil     then t.fg_colour = {0x00FF00,1} end
    if #t.fg_colour~=2         then t.fg_colour = {0x00FF00,1} end
    if t.alarm_colour == nil     then t.alarm_colour = t.fg_colour end
    if #t.alarm_colour~=2         then t.alarm_colour = t.fg_colour end

    if t.mid_colour ~= nil then    
        for i=1, #t.mid_colour do    
            if #t.mid_colour[i]~=3 then 
                print ("error in mid_color table")
                t.mid_colour[i]={1,0xFFFFFF,1} 
            end
        end
    end
    
    if t.bg_led ~= nil and #t.bg_led~=2    then t.bg_led = t.bg_colour end
    if t.fg_led ~= nil and #t.fg_led~=2    then t.fg_led = t.fg_colour end
    if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
    
    if t.led_effect~=nil then
        if t.bg_led == nil then t.bg_led = t.bg_colour end
        if t.fg_led == nil     then t.fg_led = t.fg_colour end
        if t.alarm_led == nil  then t.alarm_led = t.fg_led end
    end
    

    if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
    if t.smooth == nil then t.smooth = false end

    if t.skew_x == nil then 
        t.skew_x=0 
    else
        t.skew_x = math.pi*t.skew_x/180    
    end
    if t.skew_y == nil then 
        t.skew_y=0
    else
        t.skew_y = math.pi*t.skew_y/180    
    end
    
    if t.reflection_alpha==nil then t.reflection_alpha=0 end
    if t.reflection_length==nil then t.reflection_length=1 end
    if t.reflection_scale==nil then t.reflection_scale=1 end
    
    --end of default values
    

     local function rgb_to_r_g_b(col_a)
        return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
    end
    
    
    --functions used to create patterns

    local function create_smooth_linear_gradient(x0,y0,x1,y1)
        local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
        cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
        cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
        if t.mid_colour ~=nil then
            for i=1, #t.mid_colour do
                cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
            end
        end
        return pat
    end

    local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
        local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
        cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
        cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
        if t.mid_colour ~=nil then
            for i=1, #t.mid_colour do
                cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
            end
        end
        return pat
    end
    
    local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
        local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
        cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
        cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
        cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
        return pat
    end

    local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
        local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
        if mode==3 then
            cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))                
            cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
            cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))                
        else
            cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
            cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))                
        end
        return pat
    end






    local function draw_single_bar()
        --this fucntion is used for bars with a single block (blocks=1) but 
        --the drawing is cut in 3 blocks : value/alarm/background
        --not zvzimzblr for circular bar
        local function create_pattern(col_alp,col_led,bg)
            local pat
            
            if not t.smooth then
                if t.led_effect=="e" then
                    pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
                elseif t.led_effect=="a" then
                    pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
                elseif  t.led_effect=="r" then
                    pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
                else
                    pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
                end
            else
                if bg then
                    pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
                else
                    pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
                end
            end
            return pat
        end
        
        local y1=-t.height*pct/100
        local y2=nil
        if pct>(100*t.alarm/t.max) then 
            y1 = -t.height*t.alarm/100
            y2 = -t.height*pct/100
            if t.smooth then y1=y2 end
        end
        
        if t.angle_bar==0 then
        
            --block for fg value
            pat = create_pattern(t.fg_colour,t.fg_led,false)
            cairo_set_source(cr,pat)
            cairo_rectangle(cr,0,0,t.width,y1)
            cairo_fill(cr)
        
            -- block for alarm value            
            if not t.smooth and y2 ~=nil then 
                pat = create_pattern(t.alarm_colour,t.alarm_led,false)
                cairo_set_source(cr,pat)
                cairo_rectangle(cr,0,y1,t.width,y2-y1)
                cairo_fill(cr)
                y3=y2
            else
                y2,y3=y1,y1
            end
            -- block for bg value
            cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
            pat = create_pattern(t.bg_colour,t.bg_led,true)
            cairo_set_source(cr,pat)
            cairo_pattern_destroy(pat)
            cairo_fill(cr)
        end        
    end  --end single bar
    





    local function draw_multi_bar()
        --function used for bars with 2 or more blocks
        for pt = 1,t.blocks do 
            --set block y
            local y1 = -(pt-1)*(t.height+t.space)
            local light_on=false
            
            --set colors
            local col_alp = t.bg_colour
            local col_led = t.bg_led
            if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
                if pct>=(pcb*(pt-1))  then 
                    light_on = true
                    col_alp = t.fg_colour
                    col_led = t.fg_led
                    if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
                        col_alp = t.alarm_colour 
                        col_led = t.alarm_led 
                    end
                end
            end

            --set colors
            --have to try to create gradients outside the loop ?
            local pat 
            
            if not t.smooth then
                if t.angle_bar==0 then
                    if t.led_effect=="e" then
                        pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
                    elseif t.led_effect=="a" then
                        pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)                    
                    elseif  t.led_effect=="r" then
                        pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)    
                    else
                        pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
                    end
                else
                     if t.led_effect=="a"  then
                         pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
                                                         0, 0, t.radius+(t.height+t.space)*(pt),                         
                                             col_alp,col_led,3)    
                    else
                        pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))                    
                    end
                    
                end
            else
                
                if light_on then
                    if t.angle_bar==0 then
                        pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
                    else
                        pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
                    end
                else        
                    pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
                end
            end
            cairo_set_source (cr, pat)
            cairo_pattern_destroy(pat)

            --draw a block
            if t.angle_bar==0 then
                cairo_move_to(cr,0,y1)
                cairo_line_to(cr,t.width,y1)
            else        
                cairo_arc( cr,0,0,
                    t.radius+(t.height+t.space)*(pt)-t.height/2,
                     -t.angle_bar -math.pi/2 ,
                     t.angle_bar -math.pi/2)
            end
            cairo_stroke(cr)
        end    
    end
    
    
    
    
    local function setup_bar_graph()
        --function used to retrieve the value to display and to set the cairo structure
        if t.blocks ~=1 then t.y=t.y-t.height/2 end
        
        local value = 0
        if t.name ~="" then
            value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
        else
            value = tonumber(t.arg)
        end

        if value==nil then value =0 end
        
        pct = 100*value/t.max
        pcb = 100/t.blocks
        
        cairo_set_line_width (cr, t.height)
        cairo_set_line_cap  (cr, cap)
        cairo_translate(cr,t.x,t.y)
        cairo_rotate(cr,t.angle)

        local matrix0 = cairo_matrix_t:create()
        cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
        cairo_transform(cr,matrix0)

    
        
        --call the drawing function for blocks
        if t.blocks==1 and t.angle_bar==0 then
            draw_single_bar()
            if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
        else
            draw_multi_bar()
        end

        --dot for reminder
        --[[
        if t.blocks ~=1 then
            cairo_set_source_rgba(cr,1,0,0,1)
            cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
            cairo_fill(cr)
        else
            cairo_set_source_rgba(cr,1,0,0,1)
            cairo_arc(cr,0,0,3,0,2*math.pi)
            cairo_fill(cr)
        end
]]
        --call the drawing function for reflection and prepare the mask used        
        if t.reflection_alpha>0 and t.angle_bar==0 then
            local pat2
            local matrix1 = cairo_matrix_t:create()
            if t.angle_bar==0 then
                pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
                if t.reflection=="t" then
                    cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
                    pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
                elseif t.reflection=="r" then
                    cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
                    pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
                elseif t.reflection=="l" then
                    cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
                    pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
                else --bottom
                    cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
                    pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
                end
            end
            cairo_transform(cr,matrix1)

            if t.blocks==1 and t.angle_bar==0 then
                draw_single_bar()
                cairo_translate(cr,0,-t.height/2) 
            else
                draw_multi_bar()
            end
            
            
            cairo_set_line_width(cr,0.01)
            cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
            cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
            if t.angle_bar==0 then
                cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
            end
            cairo_clip_preserve(cr)
            cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
            cairo_stroke(cr)
            cairo_mask(cr,pat2)
            cairo_pattern_destroy(pat2)
            cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
            
        end --reflection
        
        
    end --setup_bar_graph()

    
    --start here !
    setup_bar_graph()
    cairo_restore(cr)
end

conkyrc2 (pour le volume et le bureau)

#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 25 1			#Taille minimum (px) ; largeur / hauteur
  maximum_width 25			#Largeur maximum (px)
 #---
  gap_x 2				#Écart avec le bord gauche / droit
  gap_y 2				#É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

#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 saxMono:size=9 		#Police par défaut
 #---
  stippled_borders 5			#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 6D8BB0				#Bleu clair
  color2 C46428				#Orange
 #---
  short_units yes			#Unités courtes
  pad_percents 2			#Unité à 2 décimales


TEXT
${color1}${alignr}${exec $HOME/Script/Volume}
${color2}${font Webdings:size=18}${alignr}${desktop_name}${font}

Le script pour le volume

#!/bin/bash

verif=$(amixer get Master | grep -i "off" | wc -l)
vol=$(amixer get PCM | sed '$!d' | cut -d "[" -f2 | cut -d "]" -f1)

if [ "$verif" = 0 ]
  then echo $vol   #Pour colorer le volume : then echo "\${color2}$vol\${color1}"
  else echo "off"
fi

exit 0

Voilà voilà !!

P.S. : le wallpaper est disponible ici.

Dernière modification par Fenouille84 (Le 18/07/2010, à 11:02)


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

Hors ligne

#2477 Le 18/07/2010, à 11:11

bece

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

Très jolie, j'allais te demander le wall, mais je n'avais pas lu tout le topic smile
Magnifique ce wall cool


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2478 Le 18/07/2010, à 12:12

bece

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

Quand je lance mon conky, j'ai un message d'erreur et le conky n'affiche pas tout.
Le message d'erreur :

Conky: '/home/bece/.conkyrc' modified, reloading...
Conky: /home/bece/.conkyrc: 128: no such configuration: 'rack:'
Conky: desktop window (e00d00) is subwindow of root window (9e)
Conky: window type - desktop
Conky: drawing to created window (0x1000001)
Conky: drawing to double buffer
Conky: Lua script '/home/bece/.conky/NightDrive/scripts/rings_blue2.lua' reloaded

Et le conky (l'erreur semble être au template9, mais je ne vois pas l'erreur):

##################################################
##################################################
##												##
##					Settings					##
##												##
##################################################
##################################################
background yes
update_interval 1.0
double_buffer yes
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
text_buffer_size 2048
imlib_cache_size 0
override_utf8_locale yes


# +++++ Window +++++
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 1060 120
maximum_width 1060

alignment bottom_middle
gap_x 0
gap_y -130 


# +++++ Styles +++++
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes


# +++++ Colors +++++
default_shade_color 101010
default_color 8F8F8F

# Blue
color1 71A1DF
color2 2C3949
color3 6F99B4
lua_load ~/.conky/NightDrive/scripts/rings_blue2.lua

# Green
#color1 AAB364
#color2 2F312E
#color3 628747
#lua_load ~/.conky/NightDrive/scripts/rings_green.lua

# Orange
#color1 DAB152
#color2 2E2B22
#color3 B28435
#lua_load ~/.conky/NightDrive/scripts/rings_orange.lua

# Red
#color1 EE6363
#color2 3B2A2A
#color3 AE4747
#lua_load ~/.conky/NightDrive/scripts/rings_red.lua

# Mono
#color1 8F8F8F
#color2 303030
#color3 555555
#lua_load ~/.conky/NightDrive/scripts/rings_mono.lua


# +++++ LUA +++++
lua_draw_hook_pre ring_stats


# +++++ Font +++++
use_xft yes
xftfont DejaVu Sans:size=5
xftalpha 0.1
uppercase no



##################################################
##################################################
##												##
##					Components					##
##												##
##################################################
##################################################

# +++++ Clock +++++
template1 ${goto 28}${voffset 35}${color2}${font Digital Readout Thick Upright:size=40}00${voffset -9}:${voffset 9}00${goto 28}${color1}${time %k}${voffset -9}:${voffset 9}${time %M}\n${goto 130}${voffset -68}${color2}${font Digital Readout Thick Upright:size=24}00${goto 130}${color1}${time %d}\n${font Digital Readout Thick Upright:size=12}${goto 130}${voffset -18}${color2}00${goto 130}${color1}${time %m}${goto 146}${color2}00${goto 146}${color1}${time %y}${font}\n

# +++++ Weather +++++
template2 ${execpi 1800 conkyForecast --location=FRXX0048 --template=~/.conky/NightDrive/conkyForecast.template}

# +++++ CPU +++++
template3 ${image /home/bece/.conky/NightDrive/images/icons/blue/cpu.png -p 278,47 -s 24x24 -f 86400}${voffset -62}${alignc 245}${font}${color}${execi 1 sensors coretemp-isa-0000 |grep 'Core 0' |cut -c 15-16}°C${alignc 230}${execi 1 sensors coretemp-isa-0001 |grep 'Core 1' |cut -c 15-16}°C\n${voffset 40}${alignc 240}${font}${freq_g 1}GHz\n


# +++++ Memory +++++
template4 ${image ~/.conky/NightDrive/images/icons/blue/mem.png -p 358,48 -s 24x24 -f 86400}${voffset -58}${alignc 160}${mem}\n${voffset 40}${alignc 160}${swap}\n


# +++++ Laptop & Battery +++++
template5 ${image /home/bece/.conky/NightDrive/images/icons/blue/battery2.png -p 437,49 -s 24x24 -f 86400}${voffset -58}${alignc 80}${hddtemp /dev/sda}\n${voffset 40}${alignc 80}${battery_percent BAT1}%\n


# +++++ Sys & Network +++++
template6 ${image ~/.conky/NightDrive/images/icons/blue/debian.png -p 515,33 -s 32x32 -f 86400}${voffset -22}${alignc}${color3}${font}${color3}${execi 60 cat /home/bece/.gmail.txt}${color}${if_match ${execi 60 cat /home/bece/.gmail.txt}>1} mails${else} mail${endif}\n${voffset -1}${alignc}${execi 60 date | awk -F" " '{print $1}'}\n${image ~/.conky/NightDrive/images/icons/blue/net.png -p 598,48 -s 24x24 -f 86400}${voffset -53}${alignc -80}${downspeed}\n${voffset 40}${alignc -80}${upspeed}\n


# +++++ Storage +++++
template7 ${image ~/.conky/NightDrive/images/icons/blue/hdd.png -p 678,48 -s 24x24 -f 86400}${voffset -58}${alignc -160}${fs_free /}\n${voffset 40}${alignc -160}${fs_free /media/data/Music}\n

# +++++ Vol +++++
template8 ${voffset -9}${alignc -240}${mixer}%\n

# +++++ Audacious +++++
template9 ${image ~/.conky/NightDrive/images/icons/blue/play.png -p 758,48 -s 24x24 -f 86400}${voffset -61}${alignc -240}${exec audtool2 --current-song-length} / ${exec audtool2 --current-song-output-length}\n${goto 901}${voffset 1}${font DejaVu Sans Mono:size=6}${exec audtool2 --current-song}\n${font}${goto 901}${color 414141}--------------------------------------------\n${goto 901}${voffset 1}${color3}${font}Album: ${color}No album\n${goto 901}${voffset 3}${color3}Bit: ${color}0 kbps${goto 968}${color3}Track: ${color}0

TEXT
${image ~/.conky/NightDrive/images/bg2.png -s 1060x120 -f 86400}${template1}${template2}${template3}${template4}${template5}${template6}${template7}${template8}${template9}
${image ~/.conky/NightDrive/images/cover/cover_overlay.png -p 821,35 -s 58x52 -f 86400}

Avez-vous une idée ?


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2479 Le 18/07/2010, à 16:25

bece

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

Allez, je m'auto-répond big_smile
Il semblerait que conky n'apprécie pas de lire des lignes beaucoup trop grande, il coupe donc et ne garde que ce qu'il veut, mettant le bazard partout ailleurs ^^


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2480 Le 18/07/2010, à 19:39

wlourf

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

très joli Fenouille,


Voici une autre utilisation du script bargraph (associé au script text.lua), un peu trop massif à mon goût finalement !

7a26b8a4f9b1805a9e053395fbf3bt.jpg

conkyrc :

# -- Conky settings -- #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

#own_window_type desktop
#own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window yes
#own_window_transparent yes
#own_window_argb_visual yes
own_window_title bargraph + text widgets

border_inner_margin 0
border_outer_margin 0

minimum_size 400 650
alignment tl

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


# -- Lua load -- #
lua_load ~/scripts/bargraph2/conky/bargraph.lua
lua_load ~/scripts/bargraph2/conky/text.lua 
lua_draw_hook_post main_bars
lua_draw_hook_pre draw_text

#au moins une ligne vide après TEXT
TEXT

bargraph.lua

--[[ BARGRAPH WIDGET
	v2.0 by wlourf (12.07.2010)
	ce script dessine des baragraphs avec différents effets
	plus d'exemples en couleur sur cette page
	http://u-scripts.blogspot.com/2010/07/bargraph-widget.html
	
	
Les paramètres sont :
3 paramètres obligatoires
name	- la variable conky à afficher, par ex. pour {$cpu cpu0}, inscrire name="cpu"
arg		- l'argument pour la variable ci-dessus, par ex. pour {$cpu cpu0}, inscrire arg="cpu0"
		  arg peut être une valeur numérique si name =""
max		- la valeur maxi pour la variable name ci-dessus, par ex. pour {$cpu cpu0}, inscrire max=100
	
Paramètres facultatifs :
x,y		- position du point de départ de la barre, défaut = milieu de la fenêtre
cap		- forme de la fin des ligne, valuers possibles r,b,s pour round, butt, square, défaut="b"
		  http://www.cairographics.org/samples/set_line_cap/
angle	- angle de rotation de la barre en degrés, défaut = 0 pour une barre verticale
		  mettre 90 pour une barre horizontale
skew_x	- déformation autour de l'axe x, défaut = 0
skew_y	- déformation autour de l'axe y, défaut = 0
blocks  - nombre de blocs a afficher dans la barre (valeurs >0), défaut = 10
height	- hauteur d'un bloc, défaut=10 pixels
width	- largeur d'un bloc, défaut=20 pixels
space	- espace entre deux blocs, défaut=2 pixels
angle_bar	- angle pour avoir la barre sous forme de cercle, bon ok ce n'est plus une barre, défaut=0
radius		- rayon initial en pixel, uniquement pour les barres circulaires, défaut=0
			  avec radius, "width" devient inopérent
Les couleurs ci-dessous sont définies entre accolades {couleur hexa, alpha}
fg_colour	- couleur d'un bloc "allumé", défaut = {0x00FF00,1}
bg_colour	- couleur d'un bloc "éteint", défaut = {0x00FF00,0.5}
alarm		- valeur au dessus de laquelle le bloc changera de couleur, défaut=max
alarm_colour - couleur d'un bloc au dessus de alarm, défaut=fg_colour
smooth		- (true ou false), faire un  gradient de fg_colour a bg_colour, défaut=false 
mid_colour	- couleurs à ajouter au gradient de la forme {position dans le gradient 0 à 1, couleur, alpha}
			  par exemple cette table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} ajoutera 
			  3 couleurs au gradient créer par fg_colour et alarm_colour, défaut=pas de mid_colour
led_effect	- permet d'ajouter des effets de "LED" à chaque bloc, défat=pas d'effet "led"
			  si smooth est présent, led_effect n'a pas d'effet
			  valuers possibles "r","a","e", pour radial, parrallèle, perdendiculaire à la barre (essayez)
			  led_effect doit être couplé avec des couleurs ci-dessous
fg_led		- couleur centrale d'un bloc "allumé", défaut = fg_colour
bg_led		- couleur centrale d'un bloc "allumé", défaut = bg_colour
alarm_led	- couleur centrale d'un bloc > alarm,  défaut = alarm_colour

paramètres de reflexion (la reflexion ne fonctionne pas pour les barres "circulaires")
reflection_alpha    - ajoute un effet de réflexion, valeurs de 0 à 1, défaut=0=pas de reflexion
reflection_scale    - hauteur de la réflexion (défaut=1=hauteur du texte)
reflection_length   - longueur de la réflexion, définit à quelle hauteur de la réflexion l'opacité sera nulle
                      valeur de 0 à 1, défaut=1
reflection			- position de la reflexion, relative à la bare verticale, défaut="b"
					  valeurs possibles "b","t","l","r" pour bottom, top, left, right


v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value	
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 March 2010) added parameters radius & angle_bar to draw the bar in a circular way
v2.0 (12 Jul. 2010) rewrite script + add reflection effects and parameters are now set into tables
]]

require 'cairo'

----------------START OF PARAMETERS ----------
function conky_main_bars()
	bars_settings={
		{ --bar for seconds 
			name="time",
			arg="%S",
			max=60,
			bg_colour={0xffff00,0.5},
			fg_colour={0xc0e040,1},
			x=25,y=150,
			blocks=60,
			space=1,
			height=5,width=0,
			angle=90,
			cap="r",
		},	

		{ -- bar for dl
			name="downspeedf",
			arg="eth0",
			max=1000,
			bg_colour={0x000000,1},
			bg_led={0x00BBBB,0.5},
			fg_colour={0x000000,1},
			fg_led={0xffff00,1},
			blocks=15,
			x=175,
			y=215,
			height=4,width=30,
			angle=-90,
			led_effect="e",
			reflection_alpha=0.9,
			reflection="l",
			reflection_length=0.7,		
			space=1,
			skew_y=-15,
		},	

		{ -- bar for ul
			name="upspeedf",
			arg="eth0",
			max=100,
			bg_colour={0x000000,1},
			bg_led={0x00BBBB,0.5},
			fg_colour={0x000000,1},
			fg_led={0xffff00,1},				
			blocks=15,
			x=240,
			y=185,
			height=4,width=30,
			angle=90,
			led_effect="e",
			reflection_alpha=0.9,
			reflection_length=0.7,
			reflection="r",
			space=1,
			skew_y=15,
		},	

		{ -- bar for cpu1
			name="cpu",
			arg="cpu1",
			max=100,
			bg_colour={0x00BBBB,0},
			bg_led={0x00BBBB,0.5},
			fg_colour={0x00BBBB,0},
			fg_led={0xffff00,1},				
			blocks=10,
			y=330,
			height=5,
			space=0,
			led_effect="a",
			space=1,
			angle=-90+90/2,
			angle_bar=90,
			radius=30,
			reflection="b",
			reflection_alpha=1
		},	

		{ -- bar for cpu2
			name="cpu",
			arg="cpu2",
			max=100,
			bg_colour={0x00BBBB,0},
			bg_led={0x00BBBB,0.5},
			fg_colour={0x00BBBB,0},
			fg_led={0xffff00,1},				
			blocks=10,
			y=330,
			height=5,
			space=0,
			led_effect="a",
			space=1,
			angle=90/2,
			angle_bar=90,
			radius = 30
		},	
		
		{
		name="fs_used_perc",
		arg="/home",
		max=100,
		x=40,y=475,
		alarm=80,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",			
		},
		{
		name="fs_used_perc",
		arg="/data",
		max=100,
		x=90,y=475,
		alarm=80,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",			
		},	
	
		{ -- chipset temp
		name="exec",
		arg="sensors | grep 'Sys Temp' | cut -c15-16",
		max=100,
		x=140,y=475,
		alarm=80,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",	
		},		
		{--cpu temp
		name="exec",
		arg="sensors | grep 'CPU Temp' | cut -c15-16",
		max=100,
		x=190,y=475,
		alarm=80,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",	
		},			
		{ --gpu temp
		name="nvidia",
		arg="temp",
		max=100,
		x=240,y=475,
		alarm=80,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",	
		},					

		{ --fan case
		name="exec",
		arg="sensors | grep Case | cut -c13-16",
		max=1500,
		x=290,y=475,
		alarm=1000,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",	
		},	

	
		{ --cpu fan
		name="exec",
		arg="sensors | grep 'CPU Fan' | cut -c10-17",
		max=1500,
		x=340,y=475,
		alarm=1500*.8,
		blocks=20,
		height=5,width=20,
		bg_colour={0x00BBBB,0},
		bg_led={0x00BBBB,0.5},
		fg_colour={0xffff00,0},
		fg_led={0xffff00,1},
		alarm_colour={0xff0000,0},
		alarm_led={0xff0000,1},
		led_effect="e",	
		},		
		
		
		{ --bar for memory 
			name="memperc",
			arg="",
			max=100,
			bg_colour={0xffff00,0.5},
			fg_colour={0xc0e040,1},
			x=25,y=550,
			blocks=60,
			space=1,
			height=5,width=0,
			angle=90,
			cap="r",
		},				
	}
	
-----------END OF PARAMETERS--------------


    
	if conky_window == nil then return end
	
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	
	cr = cairo_create(cs)    
	--prevent segmentation error when reading cpu state
    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(bars_settings) do
        	
        	draw_multi_bar_graph(bars_settings[i])
        	
        end
    end
	cairo_destroy(cr)
	cairo_surface_destroy(cs)

end



function draw_multi_bar_graph(t)
	cairo_save(cr)
	--check values
	if t.name==nil and t.arg==nil then 
		print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ") 
		return
	end
	if t.max==nil then
		print ("No maximum value defined, use 'max'")
		return
	end
	if t.name==nil then t.name="" end
	if t.arg==nil then t.arg="" end

	--set default values	
	if t.x == nil		then t.x = conky_window.width/2 end
	if t.y == nil		then t.y = conky_window.height/2 end
	if t.blocks == nil	then t.blocks=10 end
	if t.height == nil	then t.height=10 end
	if t.angle == nil 	then t.angle=0 end
	t.angle = t.angle*math.pi/180
	--line cap style
	if t.cap==nil		then t.cap = "b" end
	local cap="b"
	for i,v in ipairs({"s","r","b"}) do 
		if v==t.cap then cap=v end
	end
	delta=0
	if t.cap=="r" or t.cap=="s" then delta = t.height end
	if cap=="s" then 	cap = CAIRO_LINE_CAP_SQUARE
	elseif cap=="r" then
		cap = CAIRO_LINE_CAP_ROUND
	elseif cap=="b" then
		cap = CAIRO_LINE_CAP_BUTT
	end
	--end line cap style
	--if t.led_effect == nil	then t.led_effect="r" end
	if t.width == nil	then t.width=20 end
	if t.space == nil	then t.space=2 end
	if t.radius == nil	then t.radius=0 end

	if t.angle_bar == nil	then t.angle_bar=0 end
	t.angle_bar = t.angle_bar*math.pi/360 --halt angle

	--colours
	if t.bg_colour == nil 	then t.bg_colour = {0x00FF00,0.5} end
	if #t.bg_colour~=2 		then t.bg_colour = {0x00FF00,0.5} end
	if t.fg_colour == nil 	then t.fg_colour = {0x00FF00,1} end
	if #t.fg_colour~=2 		then t.fg_colour = {0x00FF00,1} end
	if t.alarm_colour == nil 	then t.alarm_colour = t.fg_colour end
	if #t.alarm_colour~=2 		then t.alarm_colour = t.fg_colour end

	if t.mid_colour ~= nil then	
		for i=1, #t.mid_colour do    
		    if #t.mid_colour[i]~=3 then 
		    	print ("error in mid_color table")
		    	t.mid_colour[i]={1,0xFFFFFF,1} 
		    end
		end
    end
    
	if t.bg_led ~= nil and #t.bg_led~=2	then t.bg_led = t.bg_colour end
	if t.fg_led ~= nil and #t.fg_led~=2	then t.fg_led = t.fg_colour end
	if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
	
	if t.led_effect~=nil then
		if t.bg_led == nil then t.bg_led = t.bg_colour end
		if t.fg_led == nil 	then t.fg_led = t.fg_colour end
		if t.alarm_led == nil  then t.alarm_led = t.fg_led end
	end
	

	if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
	if t.smooth == nil then t.smooth = false end

	if t.skew_x == nil then 
		t.skew_x=0 
	else
		t.skew_x = math.pi*t.skew_x/180	
	end
	if t.skew_y == nil then 
		t.skew_y=0
	else
		t.skew_y = math.pi*t.skew_y/180	
	end
	
	if t.reflection_alpha==nil then t.reflection_alpha=0 end
	if t.reflection_length==nil then t.reflection_length=1 end
	if t.reflection_scale==nil then t.reflection_scale=1 end
	
	--end of default values
	

 	local function rgb_to_r_g_b(col_a)
		return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
	end
	
	
	--functions used to create patterns

	local function create_smooth_linear_gradient(x0,y0,x1,y1)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end

	local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
		local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end
	
	local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
		cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
		cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
		cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
		return pat
	end

	local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
		local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		if mode==3 then
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))				
			cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		else
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		end
		return pat
	end






	local function draw_single_bar()
		--this fucntion is used for bars with a single block (blocks=1) but 
		--the drawing is cut in 3 blocks : value/alarm/background
		--not zvzimzblr for circular bar
		local function create_pattern(col_alp,col_led,bg)
			local pat
			
			if not t.smooth then
				if t.led_effect=="e" then
					pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
				elseif t.led_effect=="a" then
					pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
				elseif  t.led_effect=="r" then
					pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
				else
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
				end
			else
				if bg then
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				else
					pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
				end
			end
			return pat
		end
		
		local y1=-t.height*pct/100
		local y2=nil
		if pct>(100*t.alarm/t.max) then 
			y1 = -t.height*t.alarm/100
			y2 = -t.height*pct/100
			if t.smooth then y1=y2 end
		end
		
		if t.angle_bar==0 then
		
			--block for fg value
			pat = create_pattern(t.fg_colour,t.fg_led,false)
			cairo_set_source(cr,pat)
			cairo_rectangle(cr,0,0,t.width,y1)
			cairo_fill(cr)
		
			-- block for alarm value			
			if not t.smooth and y2 ~=nil then 
				pat = create_pattern(t.alarm_colour,t.alarm_led,false)
				cairo_set_source(cr,pat)
				cairo_rectangle(cr,0,y1,t.width,y2-y1)
				cairo_fill(cr)
				y3=y2
			else
				y2,y3=y1,y1
			end
			-- block for bg value
			cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
			pat = create_pattern(t.bg_colour,t.bg_led,true)
			cairo_set_source(cr,pat)
			cairo_pattern_destroy(pat)
			cairo_fill(cr)
		end		
	end  --end single bar
	





	local function draw_multi_bar()
		--function used for bars with 2 or more blocks
		for pt = 1,t.blocks do 
			--set block y
			local y1 = -(pt-1)*(t.height+t.space)
			local light_on=false
			
			--set colors
			local col_alp = t.bg_colour
			local col_led = t.bg_led
			if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
				if pct>=(pcb*(pt-1))  then 
					light_on = true
					col_alp = t.fg_colour
					col_led = t.fg_led
					if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
						col_alp = t.alarm_colour 
						col_led = t.alarm_led 
					end
				end
			end

			--set colors
			--have to try to create gradients outside the loop ?
			local pat 
			
			if not t.smooth then
				if t.angle_bar==0 then
					if t.led_effect=="e" then
						pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
					elseif t.led_effect=="a" then
						pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)					
					elseif  t.led_effect=="r" then
						pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
					end
				else
					 if t.led_effect=="a"  then
						 pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
														 0, 0, t.radius+(t.height+t.space)*(pt),						 
											 col_alp,col_led,3)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))					
					end
				end
			else
				
				if light_on then
					if t.angle_bar==0 then
						pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
					else
						pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
					end
				else		
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				end
			end
			cairo_set_source (cr, pat)
			cairo_pattern_destroy(pat)

			--draw a block
			if t.angle_bar==0 then
				cairo_move_to(cr,0,y1)
				cairo_line_to(cr,t.width,y1)
			else	
				cairo_arc( cr,0,0,
					t.radius+(t.height+t.space)*(pt)-t.height/2,
					 -t.angle_bar -math.pi/2 ,
					 t.angle_bar -math.pi/2)
			end
			cairo_stroke(cr)
		end	
	end
	
	
	
	
	local function setup_bar_graph()
		--function used to retrieve the value to display and to set the cairo structure
		if t.blocks ~=1 then t.y=t.y-t.height/2 end
		
		local value = 0
		if t.name ~="" then
			value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
		else
			value = tonumber(t.arg)
		end

		if value==nil then value =0 end
		
		pct = 100*value/t.max
		pcb = 100/t.blocks
		
		cairo_set_line_width (cr, t.height)
		cairo_set_line_cap  (cr, cap)
		cairo_translate(cr,t.x,t.y)
		cairo_rotate(cr,t.angle)

		local matrix0 = cairo_matrix_t:create()
		cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
		cairo_transform(cr,matrix0)

	
		
		--call the drawing function for blocks
		if t.blocks==1 and t.angle_bar==0 then
			draw_single_bar()
			if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
		else
			draw_multi_bar()
		end

		--dot for reminder
		--[[
		if t.blocks ~=1 then
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
			cairo_fill(cr)
		else
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,0,3,0,2*math.pi)
			cairo_fill(cr)
		end
]]
		--call the drawing function for reflection and prepare the mask used		
		if t.reflection_alpha>0 and t.angle_bar==0 then
			local pat2
			local matrix1 = cairo_matrix_t:create()
			if t.angle_bar==0 then
				pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
				if t.reflection=="t" then
					cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
				elseif t.reflection=="r" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
					pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
				elseif t.reflection=="l" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
					pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
				else --bottom
					cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
				end
			end
			cairo_transform(cr,matrix1)

			if t.blocks==1 and t.angle_bar==0 then
				draw_single_bar()
				cairo_translate(cr,0,-t.height/2) 
			else
				draw_multi_bar()
			end
			
			
			cairo_set_line_width(cr,0.01)
			cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
			cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
			if t.angle_bar==0 then
				cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
			end
			cairo_clip_preserve(cr)
			cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
			cairo_stroke(cr)
			cairo_mask(cr,pat2)
			cairo_pattern_destroy(pat2)
			cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
			
		end --reflection
		
		
	end --setup_bar_graph()

	
	--start here !
	setup_bar_graph()
	cairo_restore(cr)
end

text.lua

--[[TEXT WIDGET v1.3 by Wlourf 25/06/2010
Ce widget permet d'afficher différents textes définis dans la table 
text_settings{} ci-dessous avec différentes options

Les paramètres (tous facultatifs) sont :
text        - texte à afficher, défaut = "Conky is good for you"
            - coordonées suivantes relatives au coin supérieur gauche de la fenêtre conky
x           - coordonnée x du , défaut = milieu de la fenêtre conky
y           - coordonnée y de la première lettre, en bas à droite, défaut = milieu de la fenêtre conky
h_align		- alignement horizontal du texte par rapport au point (x,y), défaut="l"
			  valeurs possibles "l": gauche, "c" : centre, "r" : droite
v_align		- alignement vertical du texte par rapport au point (x,y), défaut="b"
			  valeurs possibles "t" : en haut (top), "m" au milieu, "b" en bas (bottom)

font_name   - nom de la police à utiliser, défaut = Free Sans
font_size   - taille de la police à utiliser, défaut = 14
italic      - afficher le texte en italic si true, défaut=false
oblique     - afficher le texte en oblique si true, défaut=false (je vois pas bien la différence avec italique!)
bold        - afficher le texte en gras si true, défaut=false
angle       - angle de rotation du texte, défaut = 0 (horizontal)
colour      - table de couleur du texte, défaut = texte blanc uni {{1,0xFFFFFF,1}}
              cette table contient une ou plusieurs table au format {P,C,A}
              P=position pour un dégradé (0 = début du texte, 1= fin du texte)
              C=couleur au format Hexadécimal (il y a plein de tables sur le net)
              A=alpha (opacité) de la couleur (0=invisible,1=opacité 100%)
              Exemples :
              pour une couleur unie {{1,0x00FF00,0.5}}
              pour un dégradé 2 couleurs {{0,0x00FF00,0.5},{1,0x000033,1}}
              ou {{0.5,0x00FF00,1},{1,0x000033,1}} -avec celui ci le dégradé ne commensera qu'au milieu du texte
              pour un dégradé 3 couleurs {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
              et ainsi de suite
orientation	- en cas de dégradé, définit le point de départ du dégradé linéaire, défaut="ww"
			  il y a 8 départs possibles : "nw","nn","ne","ee","se","ss","sw","ww"
			  (n pour north, w pour west ...)
			  qui correspondent aux 4 coins + aux 4 milieux du contour du texte,
			  donc un dégradé nn ira de nn à ss (de haut en bas, parralèle au texte)
			  un dégradé nw ira de nw à se (coin supérieur gauche au coin inférieur droit)
radial		- définit un gradient radial (si présent en même temps que "orientation", "orientation" devient inopérent
			  ce paramètre doit contenir une table de 6 chiffres définissant 2 cercles : {xa,ya,ra,xb,yb,rb}
			  les valeurs xa, ya et xb, yb sont relatives par rapport aux valeurs x et y ci-dessus
reflection_alpha	- ajoute un effet de réflexion, valeurs de 0 à 1
					  autres valeurs = opacité de départ
reflection_scale	- hauteur de la réflexion (défaut=1=hauteur du texte)
reflection_length	- longueur de la réflexion, définit à quelle hauteur de la réflexion l'opacité sera nulle
					  valeur de 0 à 1, défaut=1
rotx,roty	- déformation du texte autour de l'axe x ou de l'axe y
					  
			  
Quelques exemples de config ici :
http://u-scripts.blogspot.com/2010/06/text-widget.html

Necessite conky 1.8.0

Pour appeler ce script dans Conky, dans la section avant-TEXT:
    lua_load /path/to/the/lua/script/text.lua
    lua_draw_hook_pre draw_text
 
v1.0	07/06/2010, Original
v1.1	10/06/2010	Ajout du paramètre "orientation"
v1.2	14/06/2010  Ajout des paramètres "h_align", "v_align" et "radial"
v1.3	24/06/2010	Ajout des paramètres "reflection_alpha", "reflection_length", "reflection_scale", 
					"rotx" et "roty"

]]
require 'cairo'

function conky_draw_text()
	--DEBUT DES PARAMETRES
    text_settings={

		{
			text=conky_parse("${time %d/%m}"),
			font_name="Japan",
			font_size=18,
			h_align="c",
			bold=true,
			x=200,
			y=50,
			reflection_alpha=0.9,
			reflection_length=0.7,			
			colour={{0,0xffff00,0.5},{0.5,0xffff00,1},{1,0xffff00,0.5}},
		},

		{
			text=conky_parse("${time %H:%M}"),
			font_name="Japan",
			font_size=36,
			h_align="c",
			bold=true,
			x=200,
			y=100,
			reflection_alpha=0.7,
			reflection_length=0.7,
			colour={{0,0xffff00,1},{1,0x00bbbb,1}},
			radial={0,-0,0,0,-80,70}
		},

        {
		    text='dl/ul',
		    y=200,
		    v_align="m",
		    h_align="c",
		    font_name="Japan",
		    font_size=18,
		   	colour={{0,0xffff00,0.5},{0.5,0xffff00,1},{1,0xffff00,0.5}},
			orientation="nn",
    		reflection_alpha=0.9,
    		reflection_length=0.7,			
        },  
        {
		    text=conky_parse('${downspeed eth0}'),
		    x=20,
		    y=200,
		    v_align="m",
		    h_align="l",
		    font_name="Japan",
		    font_size=12,
		   	colour={{0,0xffff00,0.5},{0.5,0xffff00,1},{1,0xffff00,0.5}},
			orientation="nn",
    		reflection_alpha=0.9,
    		reflection_length=0.7,			
        },          
        {
		    text=conky_parse('${upspeed eth0}'),
		    x=380,
		    y=200,
		    v_align="m",
		    h_align="r",
		    font_name="Japan",
		    font_size=12,
		    colour={{0,0xffff00,0.5},{0.5,0xffff00,1},{1,0xffff00,0.5}},
			orientation="nn",
    		reflection_alpha=0.9,
    		reflection_length=0.7,			
        },    
        
        
        {
		    text="cpu",
		    y=325,
		    h_align="c",
		    font_name="Japan",
		    font_size=18,
		   	colour={{0,0xffff00,0.5},{0.5,0xffff00,1},{1,0xffff00,0.5}},
			orientation="nn",
        },  
 
 
        {
		    text="home",
		    x=50,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        }, 
        {
		    text=conky_parse("${fs_used_perc /home}%"),
		    x=50,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        }, 


        {
		    text="data",
		    x=100,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        },  
         {
		    text=conky_parse("${fs_used_perc /data}%"),
		    x=100,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        }, 
 
        
        {
		    text="mobo",
		    x=150,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        }, 
         {
		    text=conky_parse("${exec sensors | grep 'Sys Temp' | cut -c15-16}°C"),
		    x=150,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        },      
           
        {
		    text="cpu",
		    x=200,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        },  
         {
		    text=conky_parse("${exec sensors | grep 'CPU Temp' | cut -c15-16}°C"),
		    x=200,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        },  
                     
        {
		    text="gpu",
		    x=250,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        },       
          {
		    text=conky_parse("${nvidia temp}°C"),
		    x=250,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        }, 
        
               
        {
		    text="case",
		    x=300,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        },  
        
         {
		    text=conky_parse("${exec sensors | grep Case | cut -c13-16}rpm"),
		    x=300,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        },  
                    
         {
		    text="cpu",
		    x=350,y=490,
		    h_align="c",
		    font_name="Japan",
		    font_size=10,
		   	colour={{0,0xffff00,1}},
        },                  
         {
		    text=conky_parse("${exec sensors | grep 'CPU Fan' | cut -c13-16}rpm"),
		    x=350,y=505,
		    h_align="c",
		    font_name="Japan",
		    font_size=11,
		   	colour={{0,0x00bbbb,1}},
        },          
                          
        {
		    text="space",
		    x=75,y=525,
		    h_align="c",
		    font_name="Japan",
		    font_size=18,
		   	colour={{0,0xffff00,1},{1,0x00bbbb,1}},
			orientation="nn"
        },         		
        {
		    text=("temp."),
		    x=200,y=525,
		    h_align="c",
		    font_name="Japan",
		    font_size=18,
		   	colour={{0,0xffff00,1},{1,0x00bbbb,1}},
	   		orientation="nn"
        },  
        
         {
		    text=("fans"),
		    x=325,y=525,
		    h_align="c",
		    font_name="Japan",
		    font_size=18,
		   	colour={{0,0xffff00,1},{1,0x00bbbb,1}},
		   	orientation="nn"
        },  
        
               
   	{
    		text=conky_parse("$kernel"),
    		font_size=24,
    		bold=true,
    		font_name="Japan",
    		h_align="c",
    		x=200,
    		y=580,
    		reflection_alpha=0.8,
    		reflection_length=0.7,
    		colour={{0,0xffff00,1},{1,0x00bbbb,1}},
    		radial={0,-550,500,00,-4995,5000},
    		
    	}, 
 

    }
	
 
           
    
    
--------------FIN DES PARAMETERES----------------
    if conky_window == nil then return end
    if tonumber(conky_parse("$updates"))<3 then return end
   	
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

    for i,v in pairs(text_settings) do	
    	cr = cairo_create (cs)
		display_text(v)
	    cairo_destroy(cr)
    end
	
	cairo_surface_destroy(cs)
	


end

function rgb_to_r_g_b2(tcolour)
    colour,alpha=tcolour[2],tcolour[3]
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function display_text(t)

	local function set_pattern()
		--this function set the pattern
		if #t.colour==1 then 
		    cairo_set_source_rgba(cr,rgb_to_r_g_b2(t.colour[1]))
		else
			local pat
			
			if t.radial==nil then
				local pts=linear_orientation(t,te)
				pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
			else
				pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
			end
		
		    for i=1, #t.colour do
		        cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b2(t.colour[i]))
		    end
		    cairo_set_source (cr, pat)
		end
    end
    
    --set default values if needed
    if t.text==nil then t.text="Conky is good for you !" end
    if t.x==nil then t.x = conky_window.width/2 end
    if t.y==nil then t.y = conky_window.height/2 end
    if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
    if t.font_name==nil then t.font_name="Free Sans" end
    if t.font_size==nil then t.font_size=14 end
    if t.angle==nil then t.angle=0 end
    if t.italic==nil then t.italic=false end
    if t.oblique==nil then t.oblique=false end
    if t.bold==nil then t.bold=false end
    if t.radial ~= nil then
    	if #t.radial~=6 then 
    		print ("error in radial table")
    		t.radial=nil 
    	end
    end
    if t.orientation==nil then t.orientation="ww" end
    if t.h_align==nil then t.h_align="l" end
    if t.v_align==nil then t.v_align="b" end    
    if t.reflection_alpha == nil then t.reflection_alpha=0 end
    if t.reflection_length == nil then t.reflection_length=1 end
    if t.reflection_scale == nil then t.reflection_scale=1 end
    if t.rotx==nil then t.rotx=0 end
    if t.roty==nil then t.roty=0 end    
    cairo_translate(cr,t.x,t.y)
    cairo_rotate(cr,t.angle*math.pi/180)
    cairo_save(cr)       
 	
 

    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight =CAIRO_FONT_WEIGHT_NORMAL
    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
    
    cairo_select_font_face(cr, t.font_name, slant,weight)
 
    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

	local matrix0 = cairo_matrix_t:create()
	rotx,roty=t.rotx/t.font_size,t.roty/t.font_size
	cairo_matrix_init (matrix0, 1,roty,rotx,1,0,0)
	cairo_transform(cr,matrix0)
	cairo_set_font_size(cr,t.font_size)
	te=cairo_text_extents_t:create()
    cairo_text_extents (cr,t.text,te)
	
	set_pattern()


			
    mx,my=0,0
    
    if t.h_align=="c" then
	    mx=-te.width/2
    elseif t.h_align=="r" then
	    mx=-te.width
	end
    if t.v_align=="m" then
	    my=-te.height/2-te.y_bearing
    elseif t.v_align=="t" then
	    my=-te.y_bearing
	end
	cairo_move_to(cr,mx,my)
	
    cairo_show_text(cr,t.text)

 	
		
		
   if t.reflection_alpha ~= 0 then 
		local matrix1 = cairo_matrix_t:create()
		cairo_set_font_size(cr,t.font_size)

		cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(te.height+te.y_bearing+my)*(1+t.reflection_scale))
		cairo_set_font_size(cr,t.font_size)
		te=cairo_text_extents_t:create()
		cairo_text_extents (cr,t.text,te)
		
				
		cairo_transform(cr,matrix1)
		set_pattern()
		cairo_move_to(cr,mx,my)
		cairo_show_text(cr,t.text)


		local pat2 = cairo_pattern_create_linear (0,
										(te.y_bearing+te.height+my),
										0,
										te.y_bearing+my)
		cairo_pattern_add_color_stop_rgba (pat2, 0,1,0,0,1-t.reflection_alpha)
		cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)	
		
		
		cairo_set_line_width(cr,0)
		dy=te.x_bearing
		if dy<0 then dy=dy*(-1) end
		cairo_rectangle(cr,mx+te.x_bearing,te.y_bearing+te.height+my,te.width+dy,-te.height*1.05)
		cairo_clip_preserve(cr)
		cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
		--cairo_stroke(cr)
		cairo_mask(cr,pat2)
		cairo_pattern_destroy(pat2)
		cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
    end
    
end


function linear_orientation(t,te)
	local w,h=te.width,te.height
	local xb,yb=te.x_bearing,te.y_bearing
	
    if t.h_align=="c" then
	    xb=xb-w/2
    elseif t.h_align=="r" then
	    xb=xb-w
   	end	
    if t.v_align=="m" then
	    yb=-h/2
    elseif t.v_align=="t" then
	    yb=0
   	end	
   	
	if t.orientation=="nn" then
		p={xb+w/2,yb,xb+w/2,yb+h}
	elseif t.orientation=="ne" then
		p={xb+w,yb,xb,yb+h}
	elseif t.orientation=="ww" then
		p={xb,h/2,xb+w,h/2}
	elseif vorientation=="se" then
		p={xb+w,yb+h,xb,yb}
	elseif t.orientation=="ss" then
		p={xb+w/2,yb+h,xb+w/2,yb}
	elseif vorientation=="ee" then
		p={xb+w,h/2,xb,h/2}		
	elseif t.orientation=="sw" then
		p={xb,yb+h,xb+w,yb}
	elseif t.orientation=="nw" then
		p={xb,yb,xb+w,yb+h}
	end
	return p
end

Si vous avez des questions, n'hésitez pas!

Hors ligne

#2481 Le 18/07/2010, à 19:56

Fenouille84

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

wlourf a écrit :

très joli Fenouille,
Voici une autre utilisation du script bargraph (associé au script text.lua), un peu trop massif à mon goût finalement !!

Merci merci.

Le tien est bien aussi. L'idée est bonne, je le trouve très stylé !!
Mais tu as raison, peut être que pour une utilisation quotidienne sa fait trop...


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

Hors ligne

#2482 Le 18/07/2010, à 20:00

bece

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

Quadruple post big_smile big_smile (m'en voulez pas, hein ? mais z'êtes pas très bavard aujourd'hui roll )[edit]argh, j'ai mis trop de temps à faire mon post roll

Je peux enfin présenter mon conky sur le quel je m'échine dessus depuis quelques jours et qu'il m'a donné des envies de suicides à certains moment lol
Basé sur celui de sen7
Avec comme changement : la partie musique (ce n'est plus mpd mais audacious)
Et evidement tout le script à été adapter à mon portable et mes envies (et gôuts) cool

2010-07-18-204337_144x90_scrot.png

Le conky :

##################################################
##################################################
##												##
##					Settings					##
##												##
##################################################
##################################################
background yes
update_interval 1.0
double_buffer yes
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
text_buffer_size 2048
imlib_cache_size 0
override_utf8_locale yes


# +++++ Window +++++
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 1060 120
maximum_width 1060

alignment bottom_middle
gap_x 0
gap_y -125 


# +++++ Styles +++++
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes


# +++++ Colors +++++
default_shade_color 101010
default_color 8F8F8F

# Blue
color1 71A1DF
color2 2C3949
color3 6F99B4
lua_load ~/.conky/NightDrive/scripts/rings_blue2.lua

# Green
#color1 AAB364
#color2 2F312E
#color3 628747
#lua_load ~/.conky/NightDrive/scripts/rings_green.lua

# Orange
#color1 DAB152
#color2 2E2B22
#color3 B28435
#lua_load ~/.conky/NightDrive/scripts/rings_orange.lua

# Red
#color1 EE6363
#color2 3B2A2A
#color3 AE4747
#lua_load ~/.conky/NightDrive/scripts/rings_red.lua

# Mono
#color1 8F8F8F
#color2 303030
#color3 555555
#lua_load ~/.conky/NightDrive/scripts/rings_mono.lua


# +++++ LUA +++++
lua_draw_hook_pre ring_stats


# +++++ Font +++++
use_xft yes
xftfont DejaVu Sans:size=5
xftalpha 0.1
uppercase no



##################################################
##################################################
##												##
##					Components					##
##												##
##################################################
##################################################

# +++++ Clock +++++
template1 ${goto 28}${voffset 35}${color2}${font Digital Readout Thick Upright:size=40}00${voffset -9}:${voffset 9}00${goto 28}${color1}${time %k}${voffset -9}:${voffset 9}${time %M}\n${goto 130}${voffset -68}${color2}${font Digital Readout Thick Upright:size=24}00${goto 130}${color1}${time %d}\n${font Digital Readout Thick Upright:size=12}${goto 130}${voffset -18}${color2}00${goto 130}${color1}${time %m}${goto 146}${color2}00${goto 146}${color1}${time %y}${font}\n

# +++++ Weather +++++
template2 ${execpi 1800 conkyForecast --location=FRXX0048 --template=~/.conky/NightDrive/conkyForecast.template}

# +++++ CPU +++++
template3 ${image /home/bece/.conky/NightDrive/images/icons/blue/cpu.png -p 278,47 -s 24x24 -f 86400}${voffset -62}${alignc 245}${font}${color}${execi 1 sensors coretemp-isa-0000 |grep 'Core 0' |cut -c 15-16}°C${alignc 230}${execi 1 sensors coretemp-isa-0001 |grep 'Core 1' |cut -c 15-16}°C\n${voffset 40}${alignc 240}${font}${freq_g 1}GHz\n


# +++++ Memory +++++
template4 ${image ~/.conky/NightDrive/images/icons/blue/mem.png -p 358,48 -s 24x24 -f 86400}${voffset -58}${alignc 160}${mem}\n${voffset 40}${alignc 160}${swap}\n


# +++++ Laptop & Battery +++++
template5 ${image /home/bece/.conky/NightDrive/images/icons/blue/battery2.png -p 437,49 -s 24x24 -f 86400}${voffset -58}${alignc 80}\n${voffset -20}${alignc 80}${battery_percent BAT1}%\n


# +++++ Sys & Network +++++
template6 ${image ~/.conky/NightDrive/images/icons/blue/debian.png -p 515,33 -s 32x32 -f 86400}${voffset 38}${alignc}${color3}${font}${color3}${execi 60 cat /home/bece/.gmail.txt}${color}${if_match ${execi 60 cat /home/bece/.gmail.txt}>1} mails${else} mail${endif}\n${voffset -1}${alignc}${execi 60 date | awk -F" " '{print $1}'}\n${image ~/.conky/NightDrive/images/icons/blue/net.png -p 598,48 -s 24x24 -f 86400}${voffset -53}${alignc -80}${voffset 40}${alignc -80}\n


# +++++ Storage +++++
template7 ${image ~/.conky/NightDrive/images/icons/blue/hdd.png -p 678,48 -s 24x24 -f 86400}${voffset -58}${alignc -160} \n${voffset 40}${alignc -160} \n

# +++++ Vol +++++
template8 ${voffset -9}${alignc -240}\n

# +++++ Audacious +++++
template9 ${image ~/.conky/NightDrive/images/icons/blue/play.png -p 758,48 -s 24x24 -f 86400}${voffset -61}${alignc -240}\n


TEXT
${image ~/.conky/NightDrive/images/bg2.png -s 1060x120 -f 86400}${template1}${template2}${template3}${template4}${template5}${template6}${template7}${template8}${template9}
${exec bash /home/bece/.conky/NightDrive/scripts/album.sh}${goto 901}${voffset -2}${font DejaVu Sans Mono:size=6}${scroll 26 3 ${exec cat /home/bece/.artist.txt}}${font}${goto 901}${voffset 7}${color 414141}--------------------------------------------${goto 902}${voffset 10}${color3}${font}Album: ${color}${exec cat /home/bece/.album.txt}${goto 1001}${color3}Track: ${color}${exec cat /home/bece/.track.txt}${goto 901}${voffset 10}${color3}Genre: ${color}${exec cat /home/bece/.genre.txt}${goto 990}${exec audtool2 --current-song-output-length} ${color3}/${color} ${exec audtool2 --current-song-length}${goto 901}${voffset 10}${color3}Bitrate: ${color}${exec audtool2 --current-song-bitrate-kbps} kbps${goto 966}${color3}Frequency: ${color}${exec cat /home/bece/.freq.txt} khz
${exec bash /home/bece/.conky/NightDrive/scripts/cover.sh}${if_existing /tmp/cover_audacious.jpg}${image /tmp/cover_audacious.jpg -p 828,36 -s 48x48}${else}${image ~/.conky/NightDrive/images/cover/cover_bg.png -p 821,35 -s 58x52}${endif}
${image ~/.conky/NightDrive/images/cover/cover_overlay.png -p 821,35 -s 58x52 -f 86400}

Le script pour audacious (script de ma composition tout sauf jolie, mais j'avais la flemme de faire quelque chose de propre roll ) :

#!/bin/bash

## Partie information de la chanson
filename=$(audtool2 --current-song-filename)
## Album
album=$(oggz-comment -l "$filename" | grep ALBUM | sed 's/ALBUM: //g' | sed 's/^[ \t]//g')
nbc=$(echo $album | wc -c)
if [ $nbc -gt 20 ]
then
	echo $album | cut -c '-19' > /home/bece/.album.txt
else
	echo $album > /home/bece/.album.txt
fi
# Genre
oggz-comment -l "$filename" | grep GENRE | sed 's/GENRE: //g' | sed 's/^[ \t]//g' > /home/bece/.genre.txt
# Artist + nomde la chanson en scrolling
scroll=$(audtool2 --current-song) 
scroll+=" - "
scroll+=$(oggz-comment -l "$filename" | grep ARTIST | sed 's/ARTIST: //g' | sed 's/^[ \t]//g')
echo $scroll > /home/bece/.artist.txt
# Numéro de la chanson
oggz-comment -l "$filename" | grep TRACKNUMBER | sed 's/TRACKNUMBER: //g' | sed 's/^[ \t]//g' > /home/bece/.track.txt
#Fréquence
khz=$(audtool2 --current-song-frequency-khz)
nbck=$(echo $khz | wc -c)
if [ $nbck -gt 5 ]
then 
	echo "0.0" > /home/bece/.freq.txt
else
	echo $khz > /home/bece/.freq.txt
fi


## Partie de la durée pour les anneaux :)
tpsentier=$(audtool2 --current-song-length-seconds)
tpsecoule=$(audtool2 --current-song-output-length-seconds)
let a=100*$tpsecoule/$tpsentier
echo $a > /home/bece/.time.txt

Dernière modification par bece (Le 18/07/2010, à 20:04)


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2483 Le 18/07/2010, à 22:49

Levi59

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

Question à ceux qui passent par des fichiers annexes pour leurs conky...
Pourquoi ne pas passer par le dossier /tmp plutôt que d'encombrer vos dossier ~/.conky ou /home/XXX?

Hors ligne

#2484 Le 19/07/2010, à 09:23

bece

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

C'est une bonne remarque, pour mon cas, c'est juste que je n'y avais pas pensé smile


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2485 Le 19/07/2010, à 09:48

Fenouille84

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

Levi59 a écrit :

Question à ceux qui passent par des fichiers annexes pour leurs conky...
Pourquoi ne pas passer par le dossier /tmp plutôt que d'encombrer vos dossier ~/.conky ou /home/XXX?

Moi non plus... tongue

Mais comment faire ?
Au final, sa revient au même puisque ton fichier est sur ton disque...
Ensuite, qu'il soit dans $HOME/conky ou dans /tmp c'est pariel non ?


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

Hors ligne

#2486 Le 19/07/2010, à 11:11

JB-home

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

dans /tmp il serra effacé lorsqu'on éteins le pc je croit.

Hors ligne

#2487 Le 19/07/2010, à 12:28

bece

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


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2488 Le 19/07/2010, à 13:47

byidi

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

c69397ee0f7862b11414296438f71t.jpg

Voici le mien, pas très original mais assez light
Plusieurs petit script pas forcement très bien écrit, mais ça marche ^^

Dans l'ordre du plus petit au plus grand :

- Maj : Le nombre de paquet à mettre à jours (mis à jour toute les heures)
- Gmail : Le nombre de mail non lu sur ma boite gmail
- U, A, M : Le temps de réponse de mes 3 serveurs
- Down, Up : Vitesse de Download et d'Upload
- Bat : Ma batterie
- Temp : Température de mon proc (qui à chaud soit dit en passant XD)
- Mem, Cpu : Utilisation de ma ram et du cpu

Les retours de mes scripts sont enregistré dans un dossier juste pour eux => retour/

Pour le Lua je me suis inspiré du ring.lua et de text.lua trouvé sur le forum

conkyrc

double_buffer yes
override_utf8_locale yes

own_window  yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager 

draw_borders no

draw_shades no

gap_x 0
gap_y 0

update_interval 1

default_color  8f8f8f
default_shade_color 000000
own_window_colour 555555

use_xft yes
xftfont Arial:pixelsize=2

use_spacer none
minimum_size 300 300

#mpd
mpd_host localhost
mpd_port 6600

uppercase no

alignment top_left

# -- Lua Load -- #
lua_load /home/byidi/.config/conky/rings.lua
lua_draw_hook_pre ring_stats

TEXT
${color #FFFFFF}
${texeci 15 /home/byidi/.config/conky/script/ping Marienburg}
${texeci 15 /home/byidi/.config/conky/script/ping Ulthuan}
${texeci 15 /home/byidi/.config/conky/script/ping Altdorf}
${texeci 3600 /home/byidi/.config/conky/script/check_upgrade}

ring.lua

--[[
Ring Meters by londonali1010 (2009)

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

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

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
	lua_load ~/scripts/rings-v1.2.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=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=300,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='memperc',
		arg='',
		max=100,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=280,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='acpitemp',
		arg='',
		max=80,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=260,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec acpi | cut -d"," -f2 | cut -d" " -f2 | cut -d"%" -f1',
		arg='',
		max=80,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=240,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='upspeedf',
		arg='eth0',
		max=800,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=220,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='downspeedf',
		arg='eth0',
		max=800,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=200,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec cat /home/byidi/.config/conky/retour/ping_Marienburg',
		arg='',
		max=0.5,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=180,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec cat /home/byidi/.config/conky/retour/ping_Altdorf',
		arg='',
		max=100,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=160,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec cat /home/byidi/.config/conky/retour/ping_Ulthuan',
		arg='',
		max=0.5,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=140,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec /home/byidi/.config/conky/script/gmail',
		arg='',
		max=20,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=120,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
	{
		name='exec cat /home/byidi/.config/conky/retour/upgrade',
		arg='',
		max=20,
		bg_colour=0x000000,
		bg_alpha=.5,
		fg_colour=0xFFFFFF,
		fg_alpha=.5,
		x=0, y=0,
		radius=100,
		thickness=15,
		start_angle=90,
		end_angle=180
	},
}

require 'cairo'

function draw_text()
    if conky_window==nil then return end
    local w=conky_window.width
    local h=conky_window.height
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    cr=cairo_create(cs)

	cairo_select_font_face (cr, "OASIS", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	cairo_set_source_rgba (cr, 0, 0, 0, 1);
	cairo_translate (cr, -0.0, 0.0);
	cairo_set_font_size (cr, 9.0);
	
	cairo_rotate(cr,-0.90);
	cairo_translate (cr, -20.0, -0.0);
	
	cairo_translate (cr, -0.0, 1.0);
	cairo_move_to (cr,5.0, 302.0);
	cairo_show_text (cr, conky_parse('Cpu : ${cpu cpu0}%'));
	
	cairo_translate (cr, -0.0, -2.0);	
	cairo_move_to (cr,5.0, 284.0);
	cairo_show_text (cr, conky_parse('Mem : ${memperc}%'));
	
	cairo_translate (cr, -0.0, 1.0);
	cairo_move_to (cr, 5.0, 264.0);
	cairo_show_text (cr, conky_parse('Temp : ${acpitemp}°'));
	
	cairo_move_to (cr, 5.0, 244.0);
	cairo_show_text (cr, conky_parse('Bat : ${exec acpi | cut -d"," -f2 | cut -d" " -f2 | cut -d"%" -f1}%'));
	
	cairo_move_to (cr, 5.0,  224.0);
	cairo_show_text (cr, conky_parse('Up : ${upspeed eth0}'));
	
	cairo_translate (cr, -5.0, -2.0);
	cairo_move_to (cr, 5.0,  204.0);
	cairo_show_text (cr, conky_parse('Down : ${downspeed eth0}'));
	
	cairo_translate (cr, 5.0, 2.0);
	cairo_move_to (cr, 5.0,  184.0);
	cairo_show_text (cr, conky_parse('M : ${exec cat /home/byidi/.config/conky/retour/ping_Marienburg}'));
	
	cairo_move_to (cr, 5.0,  164.0);
	cairo_show_text (cr, conky_parse('A : ${exec cat /home/byidi/.config/conky/retour/ping_Altdorf}'));
	
	cairo_move_to (cr, 5.0,  144.0);
	cairo_show_text (cr, conky_parse('U : ${exec cat /home/byidi/.config/conky/retour/ping_Ulthuan}'));
	
	cairo_translate (cr, -6.0, -1.0);
	cairo_move_to (cr, 5.0,  124.0);
	cairo_show_text (cr, conky_parse('Gmail : ${exec /home/byidi/.config/conky/script/gmail}'));
	
	cairo_move_to (cr, 9.0,  104.0);
	cairo_show_text (cr, conky_parse('Maj : ${exec cat /home/byidi/.config/conky/retour/upgrade}'));
	
	cairo_stroke (cr);




end

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
	
	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
	draw_text()
	end
end

script/check_upgrade

#!/bin/bash
#

apt-get -s upgrade | grep jour, | cut -d"," -f1 | cut -d"m" -f1 > /home/byidi/.config/conky/retour/upgrade

script/gmail

#!/bin/bash
#

gmail_login="XXXXXXXXX"
gmail_password="XXXXXXXXXX"
mails="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - https://${gmail_login}:${gmail_password}@mail.google.com/mail/feed/atom --no-check-certificate | grep 'fullcount' | sed -e 's/.*<fullcount>//;s/<\/fullcount>.*//' 2>/dev/null)"

echo $mails

script/ping

#!/bin/bash
#

ligne=0

pingr=$(ping -c 1 $1 | grep -o time....... | cut -d"=" -f2 | cut -d" " -f1)

nbr=$(echo $pingr | wc -w)

if [ $nbr == 0 ]
	then echo '0.000' > "./retour/ping_"$1
else
	echo $pingr > "./retour/ping_"$1
fi

Voila tout questions ou suggestions est la bienvenu smile
Je suis encore à la recherche de petite chose à afficher

Dernière modification par byidi (Le 19/07/2010, à 14:17)

Hors ligne

#2489 Le 19/07/2010, à 15:15

maestroom

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

http://uppix.net/3/e/8/7dc64939a392a1dc … 55a57.html

Bon alors Salut tout le monde voici mon conkyrc

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 150 0
#maximum_width 200

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

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

# 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 20
gap_y 39

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

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

TEXT
${alignc 57}${font Radio Space:size=16}${color Cyan}  Bonjour Meastroom
${color grey}${font URW Chancery L:style=Medium Italic:pixelsize=15}Date & Heure ${hr 1}${color Cyan}
${alignc 57}${font Radio Space:size=16}${time %A %d %B %Y}
${alignc 57}${font Radio Space:size=16}${font Astron Boy Video:style=Bold:pixelsize=30}${time %H:%M:%S}${font}${color}

${color grey}${font URW Chancery L:style=Medium Italic:pixelsize=15}Système ${hr 1}${color Cyan}
${font}$alignc Ubuntu running on $machine $alignc Kernel: ${kernel}
${font}$alignc $alignc Host: ${nodename} ${color cyan}AMD PHENOM 9550E : ${color orange}${freq} MHz 

${color cyan}Hard Disk: ${color orange}${execpi 10 hddtemp -n -q -u /dev/sde}°C

${color Cyan}Cpu 1-2:${color orange}${hwmon 0 temp 1}C°  	
${color Cyan}Cpu 2-3:${color orange}${hwmon 1 temp 1}C°
${color Cyan}${font StyleBats:size=15}A${font} CPU1: ${color orange}${cpu cpu1}% ${alignr}${color Cyan}${cpugraph cpu1 12,240 000000 bd0000}
${color Cyan}${font StyleBats:size=15}A${font} CPU2: ${color orange}${cpu cpu2}% ${alignr}${color Cyan}${cpugraph cpu2 12,240 000000 bd0000}
${color Cyan}${font StyleBats:size=15}A${font} CPU3: ${color orange}${cpu cpu3}% ${alignr}${color Cyan}${cpugraph cpu3 12,240 000000 bd0000} 
${color Cyan}${font StyleBats:size=15}A${font} CPU4: ${color orange}${cpu cpu4}% ${alignr}${color Cyan}${cpugraph cpu4 12,240 000000 bd0000} 
${color Cyan}${font StyleBats:size=15}g${font} RAM: ${color orange}$memperc% ${alignr}${color Cyan}${membar 12,240 000000 bd0000}
${color Cyan}${font StyleBats:size=15}j${font} SWAP: ${color orange}$swapperc% ${alignr}${color Cyan}${swapbar 12,240 000000 bd0000} 

${color grey}${font URW Chancery L:style=Medium Italic:pixelsize=15}Disque Dur  ${color grey}${hr}${font}

${color Cyan}Home: ${color orange}${fs_used_perc /home/}% ${alignr}${fs_free /home/} ${color Cyan}${fs_bar 5,120 /home/}
${color Cyan}Multimedia: ${color orange}${fs_used_perc /media/multimedia/}% ${alignr}${fs_free /media/multimedia/} ${color Cyan}${fs_bar 5,120 /media/multimedia/}
${color Cyan}Games: ${color orange}${fs_used_perc /media/games/}% ${alignr}${fs_free /media/games/} ${color Cyan}${fs_bar 5,120 /media/games/}
${if_mounted /media/backup_}${color cyan}backup: ${color orange}${fs_used_perc /media/backup_/}% ${alignr}${fs_free /media/backup_/} ${color Cyan}${fs_bar 5,120 /media/backup_/}${endif}

${color grey}${font URW Chancery L:style=Medium Italic:pixelsize=15}Carte Graphique Nvidia${hr 1}
${color cyan}Fréquence   Gpu  GTS 250 :  ${color orange}${nvidia gpufreq} MHz
${color cyan}Fréquence  Mem  GTS 250 :  ${color orange}${nvidia memfreq} MHz
${color cyan}Température        GTS 250 :      ${color orange}${nvidia temp}°C

${color grey}${font URW Chancery L:style=Medium Italic:pixelsize=15}Music ${hr 1}
${color Orange}${font URW Chancery L:style=Medium Italic:pixelsize=20}${alignc}.::CURRENT SONG INFO ::.${font}

${if_running rhythmbox}${color cyan}Artiste: ${color red}${goto 50}${exec rhythmbox-client --no-start --print-playing-format %ta}${goto 200}${color cyan}Année: ${color red}${exec rhythmbox-client --no-start --print-playing-format %ay}
${color cyan}Titre: ${color red}${goto 50}${exec rhythmbox-client --print-playing-format %tt}${goto 200}${color cyan}temps: ${color red}${exec rhythmbox-client --no-start --print-playing-format %td}${color red}
${color cyan}Album: ${color red}${goto 50}${exec rhythmbox-client --no-start --print-playing-format %at}
${color cyan}Genre: ${color red}${goto 50}${exec rhythmbox-client --no-start --print-playing-format %ag}
${color cyan}Position: ${color red}${exec rhythmbox-client --no-start --print-playing-format %te}$else${color #f2f2f2}${alignc}${font sans:size=6:bold}No Activity${font}$endif

${color grey}${font URW Chancery L:style=Medium :pixelsize=15}Réseau ${hr 1}
${font}${color cyan}
Down: ${color orange}${downspeed eth0} k/s ${alignr}Up: ${color orange}${upspeed eth0} k/s   
${font}${color cyan}${downspeedgraph eth0 25,135 000000 1d9a00} ${alignr}${upspeedgraph eth0 25,135 000000 03a3ff}$color
Total: ${color 1d9a00}${totaldown eth0}${color }${alignr}Total: ${color 03a3ff}${totalup eth0}

et il me reste plus que de faire le script pour la température de tous mes disque dur soit afficher smile

Dernière modification par maestroom (Le 19/07/2010, à 15:20)


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

Hors ligne

#2490 Le 19/07/2010, à 18:24

raumin

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

Bonjour, quelqu'un pourrait il m'aider à installer lm-sensors sur 10.04 64bits ? j'ai un i5 750 et une MSI P55M-GD45.

J'ai suivi la doc avec la méthode automatique avec sensors-detect et la méthode manuelle mais pas moyen de voir les sondes.

Merci...

Hors ligne

#2491 Le 19/07/2010, à 21:27

maestroom

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

as-tu installer Im-sensors si non va sur http://doc.ubuntu-fr.org/conky_scripts_ … emperature
ou encore mieu va dans synaptics pour l'installer

une fois installer il y a un bon conseil sur ce topic http://forum.ubuntu-fr.org/viewtopic.php?id=52594

Dernière modification par maestroom (Le 19/07/2010, à 21:30)


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

Hors ligne

#2492 Le 20/07/2010, à 09:11

raumin

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

salut, rien y fait il ne me détecte rien du tout.

c'est exactement le même problème que cette personne : http://forum.ubuntu-fr.org/viewtopic.php?id=398684

Il y a ceci mais bon : http://www.mjmwired.net/kernel/Documentation/hwmon/f71882fg
Je vais ouvrir un autre sujet je crois.

Merci

Hors ligne

#2493 Le 20/07/2010, à 20:29

Levi59

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

z0rg> a écrit :

dans /tmp il serra effacé lorsqu'on éteins le pc je croit.

Exact! En théorie, ca fait partie des comportement par défaut à avoir avec des fichiers temporaires...

Hors ligne

#2494 Le 20/07/2010, à 21:59

wlourf

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

raumin a écrit :

salut, rien y fait il ne me détecte rien du tout.

c'est exactement le même problème que cette personne : http://forum.ubuntu-fr.org/viewtopic.php?id=398684

Il y a ceci mais bon : http://www.mjmwired.net/kernel/Documentation/hwmon/f71882fg
Je vais ouvrir un autre sujet je crois.

Merci

Salut,
tu devrais ouvrir un fil en effet, je viens de refaire mon PC et sensors-detect ne renvoyait pas d'erreurs, /etc/modules était bien modifié mais quand je chargeais les modules à la main avec modprobe module, j'avais des erreurs, ce que j'ai mis un peu de temps à trouver tout seul !
Donc retourne dans ton fil ce que donne "sensors-detect" et "cat /etc/modules" puis si "modprobe modulemachin" donne des erreurs.

Hors ligne

#2495 Le 22/07/2010, à 10:00

raumin

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

d'accord merci wlourf

Hors ligne

#2496 Le 24/07/2010, à 16:50

samυncle

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

Mon nouveau conky

1279986481.png

Si jamais, les scores au TDCT c'est ici

Dernière modification par samuncle (Le 24/07/2010, à 17:59)


Hello world

Hors ligne

#2497 Le 25/07/2010, à 01:12

crowd

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

Excellent ton conky samuncle, peut on avoir les sources ?
Merci

Hors ligne

#2498 Le 26/07/2010, à 10:39

Fenouille84

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

Voici mon nouveau bureau.
Enjoy wink

Screen :
capturett.th.png

conkyrc :

#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 275 10			#Taille minimum (px) ; largeur / hauteur
  maximum_width 275			#Largeur maximum (px)
 #---
  gap_x 1150				#Écart avec le bord gauche / droit
  gap_y 5					#É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

#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 right			#Ajoute des espaces après certains objets (qu'avec des polices fixes)
 #---
  xftfont saxMono:size=9 		#Police par défaut
 #---
  default_bar_size 138 3		#Barre par défaut (longeur hauteur)
  stippled_borders 5			#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 2d540f				#Vert
  color2 C96E00				#Caramel
 #---
  short_units yes				#Unités courtes
  pad_percents 2				#Unité à 2 décimales


TEXT
${color1}${hr}
${font Jellyka CuttyCupcakes:size=30}${color1}${alignc}- ${exec cat /etc/lsb-release | grep -i "code" | cut -d "=" -f2 | sed 's/^.\| [a-z]/\U&/g'} Inside -${font}${voffset 10}
${color2}${voffset -50}${offset 20}${font Arboris Folium:size=45}d${font}
${color1}${voffset -10}${font saxMono:italic:size=7}${alignc}Powered by Fenouille84
${alignc}Designed for Ubuntu${font}
${color2}${voffset -40}${goto 216}${font Arboris Folium:size=45}D${font}
${color1}${hr}${voffset 10}
${color1}${font plumBAE:size=30}${offset 20}${time %H}${font}
${font plumBAE:size=12}${goto 63}${voffset -32}${time %M}${voffset -7}
${color2}${goto 63}${time %S}${font}

${color1}${font plumBAE:size=30}${offset 20}${time %d}${font}
${font plumBAE:size=12}${goto 63}${voffset -32}${time %m}${voffset -7}
${color2}${goto 63}${time %y}${font}${voffset 0}${voffset -78}
${color1}${font saxMono:size=9}${execp cal | sed 's/^/ /g' | sed 's/'" $(date +%e)"'/\${color2}'" $(date +%e)"'\${color1}/1' | sed -e "1d ; s/^/\${goto 108}/g"}${font}
${hr}
 ${font Jellyka CuttyCupcakes:size=45} ${color1}Cpu${font}${voffset -35}
${goto 115}Core1 : ${color2}${cpu cpu1}%${color1}${goto 206}${freq_g cpu1}GHz
${goto 115}${voffset -2}${cpubar cpu1 3,138}
${goto 115}${voffset -10}${cpubar cpu2 3,138}
${goto 115}Core2 : ${color2}${cpu cpu2}%${color1}${goto 206}${freq_g cpu2}GHz

${font Jellyka CuttyCupcakes:size=45} ${color1}Mem${font}${voffset -35}
${goto 115}Ram   : ${memperc}%    ${mem}
${goto 115}${voffset -2}${membar 3,138}
${goto 115}${voffset -10}${swapbar 3,138}
${goto 115}Swap  : ${swapperc}%    ${swap}

${font Jellyka CuttyCupcakes:size=45} ${color1}Sys${font}${voffset -35}
${goto 115}Uptme : ${color2}${uptime}${color1}
${goto 115}${voffset -2}${execbar $HOME/Script/Volume}
${goto 115}${voffset -10}${execbar $HOME/Script/desktop}
${goto 115}Kernl : ${exec uname -r | cut -c 1-9}

 ${stippled_hr}
 ${font Jellyka CuttyCupcakes:size=45} ${color1}Net${font}${voffset -35}
${goto 115}Cnnct : ${if_existing /proc/net/route eth0}${color2}eth0  ${color1}wlan0${else}${if_existing /proc/net/route wlan0}${color1}eth0  ${color2}wlan0${color1}${else}${color1}eth0  wlan0${endif}${endif}
${goto 115}ULoad : ${totalup eth0} ${totalup wlan0}
${goto 115}DLoad : ${totaldown eth0} ${totaldown wlan0}

 ${font Jellyka CuttyCupcakes:size=45} ${color1}Tmp${font}${voffset -35}
${execp $HOME/Script/température}

 ${stippled_hr}
${font Jellyka CuttyCupcakes:size=45} ${color1}Sda${font}${voffset -38}
${goto 115}/root : ${fs_used_perc /}%    ${color2}${fs_free /}${color1}
${goto 115}${voffset -2}${fs_bar 3,138 /}
${goto 115}${voffset -10}${fs_bar 3,138 /home}
${goto 115}/home : ${fs_used_perc /home}%    ${color2}${fs_free /home}${color1}

${font Jellyka CuttyCupcakes:size=45} ${color1}Sdx${font}${voffset -38}
${goto 115}Lexar : ${if_mounted /media/LEXAR}${fs_used_perc /media/LEXAR}%    ${color2}${fs_free /media/LEXAR}${color1}${else}unplugged${endif}
${goto 115}${voffset -2}${fs_bar 3,138 /media/LEXAR}
${goto 115}${voffset -10}${fs_bar 3,138 /media/Linux}
${goto 115}Linux : ${if_mounted /media/Linux}${fs_used_perc /media/Linux}%    ${color2}${fs_free /media/Linux}${color1}${else}unplugged${endif}

${font Jellyka CuttyCupcakes:size=45} ${color1}Sdx²${font}${voffset -38}
${goto 115}LaCie : ${if_mounted /media/LaCie_PC}${fs_used_perc /media/LaCie_PC}%    ${color2}${fs_free /media/LaCie_PC}${color1}${else}unplugged${endif}
${goto 115}${voffset -2}${fs_bar 3,138 /media/LaCie_PC}
${goto 115}${voffset -10}${fs_bar 3,138 /media/ZMATH}
${goto 115}ZMath : ${if_mounted /media/ZMATH}${fs_used_perc /media/ZMATH}%    ${color2}${fs_free /media/ZMATH}${color1}${else}unplugged${endif}

${hr}

Et voilà !
Si vous avez des questions (dépendances & Cie), n'hésitez pas !!


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

Hors ligne

#2499 Le 26/07/2010, à 11:12

bece

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

C'est très frais, j'aime beaucoup smile


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#2500 Le 26/07/2010, à 11:37

Fenouille84

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

bece a écrit :

C'est très frais, j'aime beaucoup smile

Oui moi aussi smile
J'en avais marre des bureau toujours noirs ou sombres...
Donc hop !! C'est frais, c'est jeune, c'est dynamique... Bref tongue

Merci pour le compliment en tout cas wink


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

Hors ligne