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.

nombre réponses : 25

#0 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 19/06/2015, à 20:48

Didier-T
Réponses : 1 634
loutch a écrit :

http://www.stci.qc.ca/smilies/smilies%20(204).gif

Didier

Ajout de tes deux scripts ( le logo_radio.py j'ai du le mettre dans mon home pas dans le .conky/radiotray/)
j'ai bien le nom de la radio ainsi que l'artiste et le titre de la chanson qui s'affiche .C'est tout je n'ais pas la pochette ni de logos ,et la konsole me donne ceci:

Conky: desktop window (280017c) is subwindow of root window (32c)
Conky: window type - normal
Conky: drawing to created window (0xc00003)
Conky: drawing to double buffer
  File "logo_radio.py", line 42
SyntaxError: Non-ASCII character '\xc3' in file logo_radio.py on line 43, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
convert: pas de délégué pour décoder ce format d'image `' @ error/constitute.c/ReadImage/501.
convert: pas d'images définies `/home/romuald/.conky/radiotray/cover.png' @ error/convert.c/ConvertImageCommand/3210.
  File "logo_radio.py", line 42
SyntaxError: Non-ASCII character '\xc3' in file logo_radio.py on line 43, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
convert: pas de délégué pour décoder ce format d'image `' @ error/constitute.c/ReadImage/501.
convert: pas d'images définies `/home/romuald/.conky/radiotray/cover.png' @ error/convert.c/ConvertImageCommand/3210.

Voila .


http://www.stci.qc.ca/smilies/smilies%20(1).gif

Désolé pour le retard.
Parfois je ne reçois pas les mails pour les nouveaux messages, hmm

ce message signifie que python ne sait pas interpréter un caractère (certainement un accent), ce qui est étrange car je n'ai pas rencontré ce soucis.
peut tu vérifier que le script python est bien copié en entier.

a priori le soucis ce situe au niveau de l'aide pour l'utilisation du script hmm

A+,
Didier.

#1 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 19/06/2015, à 22:08

Didier-T
Réponses : 1 634

sa dépend ricorde,
s'il s’agit de deux écrans physique il faut lancer deux conky avec des positions différentes
si non il doit apparaître dans tous les espaces virtuel

#2 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 24/06/2015, à 15:48

Didier-T
Réponses : 1 634

Bonjour Ferod et tous,
je me suis un laché sur ton conky, désolé big_smile
voici le lien vers le pack

parmi les changement nous avons la disparition des deux scripts météo écrit en bash, j'ai écrit un script lua pour les remplacer les infos sont toujours prise au même endroit (en fait, c'est plus un portage vers lua)
pour clementine j'ai écrit deux scripts :
        - un en python à lancer au démarrage de l'ordinateur, il sert de démon et écrit dans l'espace temporaire les informations concernant la lecture de clementine (dans mon cas cette espace est un disque virtuel).
        - un en lua qui vas chercher les informations mise a disposition par le script python.

cher moi le conky ne consomme quasiment plus de ressource système ~12 Mo entre 0 et 5 % de processeur (intel core 2 duo @2.66Ghz)
et le démon pour clementine ~7 Mo  ~0% pendant la lecture monte à ~5% au changement de titre.

pour l'utilisation il te faudra modifier .conkyrc et script.lua (les chemins et le département pour la météo).


Pour les curieux voici les scripts du conky.

playing_clementine.py

#!/usr/bin/env python2
#-*- coding: ascii -*-
#
# playing_clementine.py
# Script creer sur la base de anowplaying.py
# par Didier-T
#
# pour utilisation avec conky
#

import dbus, optparse, shutil, commands
import unicodedata
from time import sleep


class maj:
    def __init__(self):
        '''Get system bus'''
        bus = dbus.SessionBus()
        try:
            self.amarok = bus.get_object('org.mpris.clementine', '/Player')
        except:
            self.amarok=None
            return
        self.amarokdict = self.amarok.GetMetadata()
        self.holdprogress = 0
        self.init = 1

    def unaccent(self, str):
        return unicodedata.normalize('NFKD', str).encode('ascii', 'ignore')

    def init_ok(self):
        if self.amarok is not None:
            return 0
        else:
            return 1

    def maj(self):
        temp = {}
        ret = {}
        cpos = mt = mtime = etime = rtime = progress = None

        if self.amarokdict.has_key('mtime'):
            try :
                cpos = self.amarok.PositionGet()/1000
            except:
                self.amarok=None
                return
            mt = self.amarokdict['mtime']/1000
            mtime = str(mt/60)+":"+str(mt%60) if mt%60>9 else str(mt/60)+":0"+str(mt%60)
            etime = str(cpos/60)+":"+str(cpos%60) if cpos%60>9 else str(cpos/60)+":0"+str(cpos%60)
            rtime = str((mt-cpos)/60)+":"+str((mt-cpos)%60) if (mt-cpos)%60>9 else str((mt-cpos)/60)+":0"+str((mt-cpos)%60)
            progress= float(cpos)/float(mt)*100
        if etime is not None:
            temp["etime"]=etime
        if rtime is not None:
            temp["rtime"]=rtime
        if mtime is not None:
            temp["mtime"]=mtime
        if progress is not None:
            temp["progress"]=progress

        if self.holdprogress >= progress or self.init == 1:
            self.init = 0
            self.holdprogress = progress
            try :
                self.amarokdict = self.amarok.GetMetadata()
            except:
                self.amarok=None
                return
            if self.amarokdict.has_key('artist') :
                ret["artist"] = self.unaccent(self.amarokdict['artist'][0:50])
            if self.amarokdict.has_key('title'):
                ret["title"] = self.unaccent(self.amarokdict['title'][0:50])
            if self.amarokdict.has_key('album'):
                ret["album"] = self.unaccent(self.amarokdict['album'][0:35])
            if self.amarokdict.has_key('genre'):
                ret["genre"] = self.unaccent(self.amarokdict['genre'][0:50])
            if self.amarokdict.has_key('year'):
                ret["year"] = str(self.amarokdict['year'])
            if self.amarokdict.has_key('tracknumber'):
                ret["tracknumber"] = str(self.amarokdict['tracknumber'])
            if self.amarokdict.has_key('audio-bitrate'):
                ret["bitrate"] = str(self.amarokdict['audio-bitrate'])
            if self.amarokdict.has_key('audio-samplerate'):
                ret["samplerate"] = str(self.amarokdict['audio-samplerate'])

            if self.amarokdict.has_key('arturl'):
                cover = self.amarokdict['arturl']
                if cover != "" :
                    try :
                        shutil.copyfile(cover.replace('file://', ''), "/tmp/jaquet.jpg")
                    except Exception, e:
                        print e

            fiche = open("/tmp/clem_play", "w")
            fiche.write(str(ret))
            fiche.close()

        fiche = open("/tmp/clem_temp", "w")
        fiche.write(str(temp))
        fiche.close()


def demonise(init):
    x=0
    while 1 :
#        if x==240 :
#            raise SystemExit
#        x=x+1
        '''Check if clementine is running'''
        output = commands.getoutput('ps -A')
        if 'clementine' in output:
            if init==1 :
                miseajour=maj()
                init=miseajour.init_ok()
            else:
                init=miseajour.init_ok()
                if init==0:
                    miseajour.maj()

        sleep(1)


if __name__ == '__main__':
    demonise(1)

playing_clementine.lua

-- Biliothèque de récupération de donées clementine pour conky
-- Ecrit par Didier-T
-- Du forum ubuntu.fr
-- Pour les besoins d'un conky créer par Ferod
-- Le 23/06/2015


local json = require('json')
local math = require('math')
local tonumber = tonumber
local assert = assert
local os = require('os')
local io = require('io')
local collectgarbage = collectgarbage
local dermodif = nil
local info_titre, time_titre
module("playing_clementine")

do
    function info(recherche)
        local function exec(cmd)
            local cmd=cmd.." > /tmp/exec.log"
            local e=os.execute(cmd)
            local file=assert(io.open("/tmp/exec.log", "r"))
            local r=file:read()
            assert(file:close())
            return r
        end
        --Vérifier l'existence d'un fichier
        local function existe(file)
            local a = io.open(file, "r")
            local present
            if a then
                present = true
                io.close(a)
            else
                present = false
            end
            return present
        end
        if existe("/tmp/clem_play") then
            local dermodif2=exec("date -r /tmp/clem_play '+%s'")
            if dermodif == nil or dermodif ~= dermodif2 then
                dermodif=dermodif2
                local file = assert(io.open("/tmp/clem_play", "rb") )
                local line = file:read()
                info_titre = json.decode(line)
                assert(file:close())
            end
        end
        if existe("/tmp/clem_temp") then
            local dermodif4=exec("date -r /tmp/clem_temp '+%s'")
            if dermodif3 == nil or dermodif3 ~= dermodif4 then
                dermodif3=dermodif4
                local file = assert(io.open("/tmp/clem_temp", "rb") )
                local line = file:read()
                time_titre = json.decode(line)
                assert(file:close())
            end
        end

        if recherche=="artiste" then
            return info_titre["artist"] or "N/A"
        elseif recherche=="titre" then
            return info_titre["title"] or "N/A"
        elseif recherche=="album" then
            return info_titre["album"] or "N/A"
        elseif recherche=="genre" then
            return info_titre["genre"] or "N/A"
        elseif recherche=="annee" then
            return info_titre["year"] or "N/A"
        elseif recherche=="tracknumber" then
            return info_titre["tracknumber"] or "N/A"
        elseif recherche=="bitrate" then
            return info_titre["bitrate"] or "N/A"
        elseif recherche=="samplerate" then
            return info_titre["samplerate"] or "N/A"
        elseif recherche=="temp_passe" then
            return time_titre["etime"] or "0"
        elseif recherche=="temp_restant" then
            return time_titre["rtime"] or "0"
        elseif recherche=="temp_titre" then
            return time_titre["mtime"] or "0"
        elseif recherche=="avancement" then
            return time_titre["progress"] or "0"
        else
            return "Non affecté"
        end
        collectgarbage()
    end
end

meteo.lua

-- Biliothèque météo simple pour conky
-- Ecrit par Didier-T
-- Du forum ubuntu.fr
-- Pour les besoins d'un conky créer par Ferod
-- Le 23/06/2015


local json = require('json')
local math = require('math')
local tonumber = tonumber
local assert = assert
local os = require('os')
local io = require('io')
local collectgarbage = collectgarbage
local cc, sj
local print = print
local tostring = tostring
module("meteo")

-- utiliser le code postal pour trouver la ville

do
    function maj(code_postal, periode)
        print("Mise à jour météo")
        periode=periode or "all"
        code_postal=code_postal or "75000"

        local function curl(url)
            local cmd="curl -o /tmp/curl.log -s ".."\""..url.."\""
            local e=os.execute(cmd)
            local file=assert(io.open("/tmp/curl.log", "r"))
            local r=file:read()
            assert(file:close())
            return r, (e==0 or e==true)
        end
        local function cond_cour(code_postal)
            local r,e=curl("http://api.openweathermap.org/data/2.5/weather?q="..code_postal..",fr&mode=json&units=metric&lang=fr")
            local ret=json.decode(r)
            ret["weather"][1]["id"]=tostring(ret["weather"][1]["id"]):gsub("200", "i"):gsub("201", "i"):gsub("202", "i"):gsub("230", "i"):gsub("231", "i"):gsub("232", "i"):gsub("906", "i"):
                                        gsub("210", "f"):gsub("211", "f"):gsub("212", "f"):
                                        gsub("221", "W"):gsub("731", "W"):gsub("900","W"):
                                        gsub("300", "G"):gsub("301", "G"):gsub("302", "G"):gsub("310", "G"):gsub("311", "G"):gsub("312", "G"):gsub("321", "G"):
                                        gsub("500", "g"):gsub("501", "g"):gsub("520", "g"):
                                        gsub("502", "h"):gsub("503", "h"):gsub("504", "h"):gsub("521", "h"):gsub("522", "h"):
                                        gsub("511", "k"):gsub("600", "k"):gsub("601", "k"):gsub("611", "k"):gsub("621", "k"):
                                        gsub("602", "j"):
                                        gsub("701", "J"):gsub("711", "J"):
                                        gsub("721", "I"):
                                        gsub("741", "F"):
                                        gsub("800", "C"):
                                        gsub("801", "b"):
                                        gsub("802", "c"):
                                        gsub("803", "d"):
                                        gsub("804", "e"):
                                        gsub("901", "V"):gsub("902", "V"):
                                        gsub("903", "x"):
                                        gsub("904", "z"):
                                        gsub("905", "v")
            return ret
        end
        local function sept_jour(code_postal)
            local r,e=curl("http://api.openweathermap.org/data/2.5/forecast/daily?q="..code_postal..",fr&mode=json&units=metric&cnt=7&lang=fr")
            local ret=json.decode(r)
            for jour=1, 7 do
                ret["list"][jour]["weather"][1]["id"]=tostring(ret["list"][jour]["weather"][1]["id"]):
                                                    gsub("200", "i"):gsub("201", "i"):gsub("202", "i"):gsub("230", "i"):gsub("231", "i"):gsub("232", "i"):gsub("906", "i"):
                                                    gsub("210", "f"):gsub("211", "f"):gsub("212", "f"):
                                                    gsub("221", "W"):gsub("731", "W"):gsub("900","W"):
                                                    gsub("300", "G"):gsub("301", "G"):gsub("302", "G"):gsub("310", "G"):gsub("311", "G"):gsub("312", "G"):gsub("321", "G"):
                                                    gsub("500", "g"):gsub("501", "g"):gsub("520", "g"):
                                                    gsub("502", "h"):gsub("503", "h"):gsub("504", "h"):gsub("521", "h"):gsub("522", "h"):
                                                    gsub("511", "k"):gsub("600", "k"):gsub("601", "k"):gsub("611", "k"):gsub("621", "k"):
                                                    gsub("602", "j"):
                                                    gsub("701", "J"):gsub("711", "J"):
                                                    gsub("721", "I"):
                                                    gsub("741", "F"):
                                                    gsub("800", "C"):
                                                    gsub("801", "b"):
                                                    gsub("802", "c"):
                                                    gsub("803", "d"):
                                                    gsub("804", "e"):
                                                    gsub("901", "V"):gsub("902", "V"):
                                                    gsub("903", "x"):
                                                    gsub("904", "z"):
                                                    gsub("905", "v")
            end

            return ret
        end

        if periode=="all" then
            cc=cond_cour(code_postal)
            sj=sept_jour(code_postal)
        elseif periode=="cc" then
            cc=cond_cour(code_postal)
        else
            sj=sept_jour(code_postal)
        end
        collectgarbage()
    end

    function info(valeur, jour)
        jour=tonumber(jour) or 0

        if jour==0 then
            if valeur=="lon" then
                r = cc["coord"]["lon"]
            elseif valeur=="lat" then
                r = cc["coord"]["lat"]
            elseif valeur=="pays" then
                r = cc["sys"]["country"]
            elseif valeur=="leve_soleil" then
                r = cc["sys"]["sunrise"]
            elseif valeur=="coucher_soleil" then
                r = cc["sys"]["sunset"]
            elseif valeur=="meteo_id" then
                r = cc["weather"][1]["id"]
            elseif valeur=="meteo_main" then
                r = cc["weather"][1]["main"]
            elseif valeur=="meteo_description" then
                r = cc["weather"][1]["description"]
            elseif valeur=="meteo_icone" then
                r = cc["weather"][1]["icon"]
            elseif valeur=="temp" then
                r = math.floor(cc["main"]["temp"])
            elseif valeur=="temp_min" then
                r = math.floor(cc["main"]["temp_min"])
            elseif valeur=="temp_max" then
                r = math.floor(cc["main"]["temp_max"])
            elseif valeur=="pression" then
                r = cc["main"]["pressure"]
            elseif valeur=="sea_level" then
                r = cc["main"]["sea_level"]
            elseif valeur=="grnd_level" then
                r = cc["main"]["grnd_level"]
            elseif valeur=="humidite" then
                r = cc["main"]["humidity"]
            elseif valeur=="vent_vitesse" then
                r = math.floor(cc["wind"]["speed"])
            elseif valeur=="vent_direction" then
                r = cc["wind"]["deg"]
            elseif valeur=="couverture_nuageuse" then
                r = cc["clouds"]["all"]
            elseif valeur=="pluie_court_terme" then
                if cc["rain"] ~= nil then
                    r = cc["rain"]["3h"]
                else
                    r = 0
                end
            elseif valeur=="date" then
                r = cc["dt"]
            elseif valeur=="ville" then
                r = cc["name"]
            else
                r = valeur.." n'éxiste pas"
            end
        else
            if valeur=="date" then
                r = sj["list"][jour]["dt"]
            elseif valeur=="temp_jour" then
                r = math.floor(sj["list"][jour]["temp"]["day"])
            elseif valeur=="temp_min" then
                r = math.floor(sj["list"][jour]["temp"]["min"])
            elseif valeur=="temp_max" then
                r = math.floor(sj["list"][jour]["temp"]["max"])
            elseif valeur=="temp_nuit" then
                r = math.floor(sj["list"][jour]["temp"]["night"])
            elseif valeur=="temp_soir" then
                r = math.floor(sj["list"][jour]["temp"]["eve"])
            elseif valeur=="temp_matin" then
                r = math.floor(sj["list"][jour]["temp"]["morn"])
            elseif valeur=="pression" then
                r = sj["list"][jour]["pressure"]
            elseif valeur=="humidite" then
                r = sj["list"][jour]["humidity"]
            elseif valeur=="meteo_id" then
                r = sj["list"][jour]["weather"][1]["id"]
            elseif valeur=="meteo_main" then
                r = sj["list"][jour]["weather"][1]["main"]
            elseif valeur=="meteo_description" then
                r = sj["list"][jour]["weather"][1]["description"]
            elseif valeur=="meteo_icone" then
                r = sj["list"][jour]["weather"][1]["icon"]
            elseif valeur=="vent_vitesse" then
                r = math.floor(sj["list"][jour]["speed"])
            elseif valeur=="vent_direction" then
                r = sj["list"][jour]["deg"]
            elseif valeur=="couverture_nuageuse" then
                r = sj["list"][jour]["clouds"]
            elseif valeur=="pluviometrie" then
                r = sj["list"][jour]["rain"] or 0
            else
                r = valeur.." "..jour.." n'éxiste pas"
            end
        end
        return r
    end

end

script.lua

--this is a lua script for use in conky
require 'cairo'
require 'os'
local meteo=require('meteo')
local play=require('playing_clementine')

-- Parametre a modifier
local chemin="~/.conky/conky-perso/Monochrome" -- répertoire ou ce trouve vos scripts
local departement="95100" -- indiquer le département pour la météo
local disque_1="/home"
local disque_2="/"
local disque_3="~"

--[[
###################################################################################################
#  Ne pas faire de modification après cette ligne (sauf si vous savez ce que vous faite), Merci.  #
###################################################################################################
]]--
local home = os.getenv("HOME")
chemin=string.gsub(chemin,"~",home)
disque_1=string.gsub(disque_1,"~",home)
disque_2=string.gsub(disque_2,"~",home)
disque_3=string.gsub(disque_3,"~",home)
local nb_coeur=tonumber(conky_parse("${exec cat /proc/cpuinfo | grep processor | wc -l}"))
local Clementine
local T0=0
local T=0

-- Partie Fonctions
function draw_circle(alpha,progress,x_center,y_center,radius,epaisseur)
    cairo_set_source_rgba(cr,1,1,1,alpha)
    cairo_set_line_width(cr,epaisseur)
    cairo_arc(cr, x_center, y_center, radius, 0-math.pi/2, progress * 2 * math.pi / 100 - math.pi/2)
    cairo_stroke(cr)
end

function draw_circle_gauge(alpha,nb_gauge,angle_step,angle_step_ink,x_center,y_center,radius,epaisseur)
    cairo_set_source_rgba(cr,1,1,1,alpha)
    cairo_set_line_width(cr,epaisseur)
    angle_step_rad=angle_step*math.pi/180
    angle_step_ink_rad=angle_step_ink*math.pi/180
    local i = 1
    angle=-math.pi/2
    while i <= nb_gauge do
        cairo_arc(cr, x_center, y_center, radius, angle, angle + angle_step_ink_rad)
        angle=angle+angle_step_rad
        cairo_stroke(cr)
        i = i+1
    end

end

function draw_line(alpha,progress,x_ligne,y_ligne,longueur,epaisseur)
    red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    cairo_set_dash(cr,1.,0,1)
    cairo_move_to (cr, x_ligne, y_ligne)
    cairo_line_to (cr, x_ligne+((progress/100)*longueur), y_ligne)
    cairo_stroke (cr)
end

function draw_dash_line(alpha,progress,x_ligne,y_ligne,longueur,epaisseur)
    red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    cairo_set_dash(cr,5.,1,0)
    cairo_move_to (cr, x_ligne, y_ligne)
    cairo_line_to (cr, x_ligne+longueur*progress/100, y_ligne)
    cairo_stroke (cr)
end

function draw_scale(alpha,x_ligne,y_ligne,nb_step,long_step_ink,long_step,epaisseur)
    red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    local i = 1
    x_step=x_ligne
    while i <= nb_step do
        cairo_move_to (cr, x_step, y_ligne)
        cairo_line_to (cr, x_step+long_step_ink,y_ligne)
        cairo_stroke (cr)
        x_step=x_step + long_step
        i=i+1
    end
end

function affiche_texte(police,taille,x,y,alpha,texte)
    red,green,blue,alpha=1,1,1,alpha
    cairo_select_font_face (cr, police, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    cairo_set_font_size (cr, taille)
    cairo_set_source_rgba (cr,red,green,blue,alpha)
    cairo_move_to (cr,x,y)
    cairo_show_text (cr,texte)
    cairo_stroke (cr)
end

-- Partie script
function graph_line(Maj)
    -- Variable a afficher
    -- Tous les intervals (30 secondes)
    if Maj == 1 then
        -- Utilisation Disque
        used_perc1=tonumber(conky_parse("${fs_used_perc "..disque_1.."}"))
        used_perc2=tonumber(conky_parse("${fs_used_perc "..disque_2.."}"))
        used_perc3=tonumber(conky_parse("${fs_used_perc "..disque_3.."}"))
        -- Températures
        T1=tonumber(conky_parse("${exec "..chemin.."/sensors.sh 1}"))
        T2=tonumber(conky_parse("${exec "..chemin.."/sensors.sh 2}"))
    end

    -- A chaque cycle
    -- Heure
    heure=tonumber(conky_parse("${time %I}"))
    minute=tonumber(conky_parse("${time %M}"))
    seconde=tonumber(conky_parse("${time %S}"))
    -- Utilisation CPU
    local cpu={}
    for i = 1,nb_coeur do
        cpu[i]=tonumber(conky_parse("${cpu cpu"..i.."}"))
    end
    -- UP Down
    ratio_upload=tonumber(conky_parse("${upspeedf eth0}")/55*100)
    ratio_download=tonumber(conky_parse("${downspeedf eth0}")/302*100)
    -- Clementine
    Clementine=play.info("avancement") --conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -p}")

    -- Horloge
    draw_circle(0.2,100,200,48,20,2)
    draw_circle(0.2,100,200,48,25,2)
    if heure == 12 then
        heure = 0
    end
    prog_seconde=seconde/60
    prog_minute=(minute+prog_seconde)/60
    prog_heure=(heure+prog_minute)/12
    draw_circle(1.,prog_minute*100,200,48,25,2)
    draw_circle(1.,prog_heure*100,200,48,20,2)
    draw_circle_gauge(1,12,30,2,200,48,20,2)
    draw_circle_gauge(1,12,30,2,200,48,25,2)
    draw_circle_gauge(1,seconde,6,2,200,48,30,2)

    --CPU & RAM
    local y_img_4 = 219
    draw_scale(0.5,153,y_img_4+32,36,1,5,3)
    draw_scale(1,153,y_img_4+32,8,1,25,6)
    t1=T1-30
    t2=T2-30
    if t1<0 then
        t1 = 0
    end
    if t2<0 then
        t2 = 0
    end
    draw_line(t1/35,(t1/70)*100,153,y_img_4+31,176,2)
    draw_line(t2/35,(t2/70)*100,153,y_img_4+33,176,2)

    for i = 1,nb_coeur do
        if cpu[i] == nil then cpu[i]=0 end
    end
    draw_line(0.2,100,180,y_img_4+49,150,2)
    ratio_barre=(150/nb_coeur)

    -- calcul pour affichage barre ratio cpu
    local x1 = {}
    x1[1]=180 -- début barre cpu1
    for i = 1,nb_coeur do
        x1[i+1]=x1[i]+cpu[i]/100*ratio_barre
    end

    -- affichage barre occupation cpu
    ratio_trans=(0.8/nb_coeur)
    for i = 1,nb_coeur do
        draw_line(1-(i-1)*ratio_trans,cpu[i],x1[i],y_img_4+49,ratio_barre,2)
    end

    draw_line(0.2,100,180,y_img_4+72,150,2)
    mem_perc=tonumber(conky_parse("${memperc}"))
    draw_line(1,mem_perc,180,y_img_4+72,150,2)

    --utilisation disque :
    local y_img_5 = 292
    draw_line(0.2,100,160,y_img_5+33,170,2)
    draw_line(1,used_perc1,160,y_img_5+33,170,2)

    draw_line(0.2,100,160,y_img_5+53,170,2)
    draw_line(1,used_perc2,160,y_img_5+53,170,2)

    draw_line(0.2,100,160,y_img_5+83,170,2)
    draw_line(1,used_perc3,160,y_img_5+73,170,2)

    --upload
    local y_img_6 = 365
    draw_line(0.2,100,170,y_img_6+33,160,2)
    draw_line(1,ratio_upload,170,y_img_6+33,160,2)
    --download
    draw_line(0.2,100,170,y_img_6+48,160,2)
    draw_line(1,ratio_download,170,y_img_6+48,160,2)

    -- lecture musique
    if Clementine ~= "" then
        local y_img_7 = 438
        draw_line(0.2,100,100,y_img_7+70,230,2)
        progress=tonumber(Clementine)
        draw_line(1,progress,100,y_img_7+70,230,2)
    end
end

function display_text(Maj)
    -- Variable a afficher
    -- Tous les intervals (30 secondes)
    if Maj == 1 then
        h_leve=os.date("%H:%M", meteo.info("leve_soleil"))--conky_parse("${exec "..chemin.."/meteo_display.sh current 1}")
        h_couche=os.date("%H:%M", meteo.info("coucher_soleil"))--conky_parse("${exec "..chemin.."/meteo_display.sh current 2}")
        meteo_act=meteo.info("meteo_description")--conky_parse("${exec "..chemin.."/meteo_display.sh current 8}")
        pression=meteo.info("pression")--conky_parse("${exec "..chemin.."/meteo_display.sh pression 1}").." hPa"
        temp_act=meteo.info("temp")--conky_parse("${exec "..chemin.."/meteo_display.sh current 3}")
        text_meteo=meteo.info("meteo_id")--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 1}")
        humidite=meteo.info("humidite")--conky_parse("${exec "..chemin.."/meteo_display.sh current 6}")
        speed=meteo.info("vent_vitesse")--conky_parse("${exec "..chemin.."/meteo_display.sh current 7}")
        precipitation=meteo.info("pluie_court_terme")--conky_parse("${exec "..chemin.."/meteo_display.sh current 9}")
        temp_min=meteo.info("temp_min", 1)--conky_parse("${exec "..chemin.."/meteo_display.sh current 4}")
        temp_max=meteo.info("temp_max", 1)--conky_parse("${exec "..chemin.."/meteo_display.sh current 5}")
        semaine_meteo_2=meteo.info("meteo_id", 2)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 2}")
        semaine_meteo_3=meteo.info("meteo_id", 3)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 3}")
        semaine_meteo_4=meteo.info("meteo_id", 4)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 4}")
        semaine_meteo_5=meteo.info("meteo_id", 5)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 5}")
        semaine_meteo_6=meteo.info("meteo_id", 6)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 6}")
        semaine_meteo_7=meteo.info("meteo_id", 7)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 7}")
        -- affichage du jour
        semaine_jour_2=os.date("%a", meteo.info("date", 2))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 2}")
        semaine_jour_3=os.date("%a", meteo.info("date", 3))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 3}")
        semaine_jour_4=os.date("%a", meteo.info("date", 4))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 4}")
        semaine_jour_5=os.date("%a", meteo.info("date", 5))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 5}")
        semaine_jour_6=os.date("%a", meteo.info("date", 6))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 6}")
        semaine_jour_7=os.date("%a", meteo.info("date", 7))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 7}")
        -- prévision température jour
        semaine_temp_2=meteo.info("temp_jour", 2)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 2}").."°C"
        semaine_temp_3=meteo.info("temp_jour", 3)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 3}").."°C"
        semaine_temp_4=meteo.info("temp_jour", 4)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 4}").."°C"
        semaine_temp_5=meteo.info("temp_jour", 5)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 5}").."°C"
        semaine_temp_6=meteo.info("temp_jour", 6)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 6}").."°C"
        semaine_temp_7=meteo.info("temp_jour", 7)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 7}").."°C"

        espace1=conky_parse("${fs_used_perc "..disque_1.."}").."%"
        espace2=conky_parse("${fs_used_perc "..disque_2.."}").."%"
        espace3=conky_parse("${fs_used_perc "..disque_3.."}").."%"
        esp_used1=conky_parse("${fs_used "..disque_1.."}")
        esp_used2=conky_parse("${fs_used "..disque_2.."}")
        esp_used3=conky_parse("${fs_used "..disque_3.."}")
        esp_free1=conky_parse("${fs_free "..disque_1.."}")
        esp_free2=conky_parse("${fs_free "..disque_2.."}")
        esp_free3=conky_parse("${fs_free "..disque_3.."}")


    end

    -- A chaque cycle
   local cpu=conky_parse("${cpu cpu0}")

    local y_img_1 = 0
    --[[###########################################
        Heure et Date
    ##############################################]]
    affiche_texte("Ubuntu",11,92,y_img_1+30,1,"J"..conky_parse("${time %j}").." - S"..conky_parse("${time %V}"))
    affiche_texte("Sans",50,85,y_img_1+73,1,"☼")
    affiche_texte("Ubuntu",11,130,y_img_1+50,1,h_leve)
    affiche_texte("Ubuntu",11,130,y_img_1+70,1,h_couche)
    affiche_texte("Ubuntu",12,185,y_img_1+52,1,conky_parse("${time %H:%M}"))     --heure
    affiche_texte("Ubuntu",12,282,y_img_1+34,1,conky_parse("${time %A}"))        --nom du jour
    affiche_texte("Ubuntu",12,282,y_img_1+45,1,conky_parse("${time %B}"))        --nom du mois
    affiche_texte("Ubuntu",32,245,y_img_1+45,1,conky_parse("${time %d}"))        --numeros du jour
    affiche_texte("Ubuntu",32,245,y_img_1+71,1,conky_parse("${time %Y}"))        --année

    --[[###########################################
        Météo actuelle
    ##############################################]]
    local y_img_2 = 73
    affiche_texte("Weather",65,95,y_img_2+77,1,text_meteo)
    --affiche_texte("Weather",65,95,y_img_2+77,1,"g")
    affiche_texte("Ubuntu",11,150,y_img_2+30,1,meteo_act.." - "..temp_act.." - "..pression)

    affiche_texte("Ubuntu",11,150,y_img_2+45,1,pression.." - "..humidite.." hum")
    affiche_texte("Ubuntu",11,150,y_img_2+60,1,"Vent : "..speed)
    affiche_texte("Ubuntu",11,150,y_img_2+75,1,"Pluies : "..precipitation)

    --affiche_texte("Ubuntu",11,150,y_img_2+40,1,"min : "..temp_min.." - max : "..temp_max)
    affiche_texte("Ubuntu",11,310,y_img_2+70,1,temp_min)
    affiche_texte("Ubuntu",11,310,y_img_2+45,1,temp_max)
    affiche_texte("Weather",50,295,y_img_2+75,1,"y")

    --[[###########################################
        prévision météo semaine
    ##############################################]]
    local y_img_3 = 146
    affiche_texte("Weather",50,95,y_img_3+67,1,semaine_meteo_2)
    affiche_texte("Weather",50,135,y_img_3+67,1,semaine_meteo_3)
    affiche_texte("Weather",50,175,y_img_3+67,1,semaine_meteo_4)
    affiche_texte("Weather",50,215,y_img_3+67,1,semaine_meteo_5)
    affiche_texte("Weather",50,255,y_img_3+67,1,semaine_meteo_6)
    affiche_texte("Weather",50,295,y_img_3+67,1,semaine_meteo_7)

    -- affichage du jour
    affiche_texte("Ubuntu",11,100,y_img_3+27,1,semaine_jour_2)
    affiche_texte("Ubuntu",11,140,y_img_3+27,1,semaine_jour_3)
    affiche_texte("Ubuntu",11,180,y_img_3+27,1,semaine_jour_4)
    affiche_texte("Ubuntu",11,220,y_img_3+27,1,semaine_jour_5)
    affiche_texte("Ubuntu",11,260,y_img_3+27,1,semaine_jour_6)
    affiche_texte("Ubuntu",11,300,y_img_3+27,1,semaine_jour_7)

    -- prévision température jour
    affiche_texte("Ubuntu",12,100,y_img_3+74,1,semaine_temp_2)
    affiche_texte("Ubuntu",12,140,y_img_3+74,1,semaine_temp_3)
    affiche_texte("Ubuntu",12,180,y_img_3+74,1,semaine_temp_4)
    affiche_texte("Ubuntu",12,220,y_img_3+74,1,semaine_temp_5)
    affiche_texte("Ubuntu",12,260,y_img_3+74,1,semaine_temp_6)
    affiche_texte("Ubuntu",12,300,y_img_3+74,1,semaine_temp_7)


    --[[###########################################
        CPU Temperature et RAM
    ##############################################]]
    local y_img_4 = 219
    affiche_texte("Ubuntu",13,100,y_img_4+32,1,"Temp :")
    affiche_texte("Ubuntu",13,100,y_img_4+52,1,"CPU    :")
    affiche_texte("Ubuntu",13,100,y_img_4+72,1,"RAM   :")

    affiche_texte("Ubuntu",10,147,y_img_4+26,1,"30°")
    affiche_texte("Ubuntu",10,197,y_img_4+26,1,"50°")
    affiche_texte("Ubuntu",10,247,y_img_4+26,1,"70°")
    affiche_texte("Ubuntu",10,297,y_img_4+26,1,"90°")

    if cpu == nil then cpu=0 end

    affiche_texte("Ubuntu",11,150,y_img_4+52,1,cpu.."%")

    affiche_texte("Ubuntu",11,150,y_img_4+72,1,conky_parse("${memperc}").."%")
    affiche_texte("Ubuntu",11,180,y_img_4+69,1,conky_parse("${mem}"))
    affiche_texte("Ubuntu",11,290,y_img_4+69,0.7,conky_parse("${memeasyfree}"))

    --[[###########################################
        Espace disponible
    ##############################################]]
    local y_img_5 = 292
    affiche_texte("Heydings Icons",18,100,y_img_5+34,1,"H")
    affiche_texte("Heydings Icons",18,100,y_img_5+54,1,"L")
    affiche_texte("Heydings Icons",18,100,y_img_5+74,1,"F")

    affiche_texte("Ubuntu",15,123,y_img_5+33,1,espace1)
    affiche_texte("Ubuntu",15,123,y_img_5+53,1,espace2)
    affiche_texte("Ubuntu",15,123,y_img_5+73,1,espace3)

    affiche_texte("Ubuntu",11,160,y_img_5+30,1,esp_used1)
    affiche_texte("Ubuntu",11,160,y_img_5+50,1,esp_used2)
    affiche_texte("Ubuntu",11,160,y_img_5+70,1,esp_used3)

    affiche_texte("Ubuntu",11,290,y_img_5+30,0.7,esp_free1)
    affiche_texte("Ubuntu",11,290,y_img_5+50,0.7,esp_free2)
    affiche_texte("Ubuntu",11,290,y_img_5+70,0.7,esp_free3)

    --[[###########################################
        Débit internet
    ##############################################]]
    local y_img_6 = 365
    affiche_texte("Deja",18,100,y_img_6+38,1,"↗")
    affiche_texte("Ubuntu",12,120,y_img_6+38,1,conky_parse("${upspeed eth0}"))
    affiche_texte("Deja",18,100,y_img_6+53,1,"↘")
    affiche_texte("Ubuntu",12,120,y_img_6+53,1,conky_parse("${downspeed eth0}"))
    up_total=conky_parse("${totalup eth0}")
    down_total=conky_parse("${totaldown eth0}")
    affiche_texte("Ubuntu",12,100,y_img_6+68,1,"Total : "..up_total.." / "..down_total)

    --[[###########################################
        Musique
    ##############################################]]
    if Clementine ~= "" then
        local y_img_7 = 438
        affiche_texte("Ubuntu",11,100,y_img_7+35,1,play.info("album"))--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -l}"))
        affiche_texte("Ubuntu",11,100,y_img_7+50,1,play.info("titre"))--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -t}"))
        temp_ecoule=play.info("temp_passe")--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -e}")
        temp_remain=play.info("temp_restant")--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -r}")
        affiche_texte("Ubuntu",11,100,y_img_7+65,1,temp_ecoule)
        affiche_texte("Ubuntu",11,310,y_img_7+65,0.7,temp_remain)
    end
end

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

    local cs = cairo_xlib_surface_create(conky_window.display,
                                         conky_window.drawable,
                                         conky_window.visual,
                                         conky_window.width,
                                         conky_window.height)
    cr = cairo_create(cs)
    local display = cairo_create(cs)
    local updates=tonumber(conky_parse('${updates}'))

    local interval=30
    local timer=(updates % interval)
    local T1 = os.time()

    if os.difftime(T1, T) >= 300 then
        if os.difftime(T1, T0) >= 3600 then
            meteo.maj(departement, "7jours")
            T0=T1
        end
        meteo.maj(departement, "cc")
        T=T1
    end

    if updates>5 then
        if timer == 0 or conky_start == 1 then
            Maj=1
            if updates > 6 then
                conky_start=nil
            end
        else
            Maj=0
        end
        display_text(Maj)
        graph_line(Maj)
    else
        conky_start = 1
    end

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

.conkyrc

######################
# - Conky settings - #
######################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1

#imlib_cache_size 0
double_buffer yes
no_buffers yes

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Ubuntu:size=9
override_utf8_locale yes
text_buffer_size 2048

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

alignment tr
gap_x -2
gap_y 180
minimum_size 350 520


default_bar_size 60 10

# - Graphics settings - #
#########################
draw_shades no

default_color ffffff
default_shade_color 1d1d1d
color0 ffffff
color1 ffffff
color2 ffffff

lua_load ~/.conky/conky-perso/Monochrome/script.lua
lua_draw_hook_pre main
TEXT
#${voffset 0}
#---DATE & HEURE----
#---METEO----
#${execi 600 ~/.conky/conky-perso/Monochrome/meteo_update.sh}
#---CPU ET RAM----
#---DISQUE DUR----
#---DEBIT INTERNET----
#${if_up eth0}
#${voffset 255}
#${endif}
#---MUSIQUE----
#${if_running clementine}
#${color}
#$endif

#---IMAGES----
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,0 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,73 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,146 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,219 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,292 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,365 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,438 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/calendar.png -p 28,20 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/weather.png -p 28,93 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/weather.png -p 28,166 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/emblem-system.png -p 28,239 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/folder.png -p 28,312 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/nm-signal-75.png -p 28,385 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/emblem-sound.png -p 28,458 -s 45x45}

sensors.sh

#!/bin/bash
if [ $1 = 1 ] ; then
    temp=`sensors | awk ' $2=="0:" {print $3}' | cut -c 2-3`
else
    temp=`sensors | awk ' $2=="1:" {print $3}' | cut -c 2-3`
fi
echo $temp

A+,
Didier.

P.S. : je ne suis pas encore satisfait de script.lua. Mais ce sera pour une autre fois

#3 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 24/06/2015, à 15:52

Didier-T
Réponses : 1 634
ricorde a écrit :
Didier-T a écrit :

sa dépend ricorde,
s'il s’agit de deux écrans physique il faut lancer deux conky avec des positions différentes
si non il doit apparaître dans tous les espaces virtuel

peux tu me dire comment lancer 2 conky avec positions différents
merci

Bonjour ricorde,
en fait, je suis certain que tu sait déjà le faire, parfois on cherche a ce compliquer la vie.

tu crée une copie de ton conky dans un second répertoire et tu modifie avant TEXT

alignment 
gap_x 
gap_y 

de manière a le placer la ou il te convient.

A+,
Didier.

#4 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 24/06/2015, à 21:53

Didier-T
Réponses : 1 634

Bonsoir Ferod,
en fait avec conky il vaut mieux employer lua car les script sont chargé en mémoire, donc il ne sont interprété qu'une fois, c'est aussi ce qui a motivé mon choix pour le démon qui surveille clementine.
Le fait de ne lancer les scripts qu'une fois fait chuter la consommation processeur car il n'a plus a décoder le code et a l’interpréter.

Le pire ennemi du conky est le script bash. Un script bash sa passe son temps a appeler d'autres programmes pour exécuter des taches, du coup ton conky ne consomme pas grand chose, mais ton processeur est très sollicité (par les processus lancé par le bash).

#5 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 24/06/2015, à 23:29

Didier-T
Réponses : 1 634

en générale un conky qui devient trouble est un conky lancé plusieurs fois.
sa arrive assé facilement sous xfce avec l'option "enregistrer la session pour la prochaine utilisation"

vérifie dans ton gestionnaire de tache

#6 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 25/06/2015, à 10:16

Didier-T
Réponses : 1 634

Bonjour ricorde,
si tu n'as qu'une instance de ton conky lancé, je ne vois pas d'ou sa peut venir.

Désolé de ne pouvoir aider plus.

#7 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 25/06/2015, à 11:57

Didier-T
Réponses : 1 634

Bonjour Ferod et tous ceux qui seront intéressé,
j'ai effectué une batterie d'essais sur les scripts posté hier.
et bien le résultat était pas folichon, fuite de mémoire sur le conky, pour ce test je passe le rafraîchissement à 0.1 seconde note l'heure de début la quantité de mémoire utilisé (indiquer dans le gestionnaire de tache) et je regarde 1 ou 2 heure après s'il y  a une évolution, pour le coup je suis passé de 10Mo à + de 40Mo au bout de 2h00 (sa équivaut à 20h00 d'utilisation normal).
j'ai aussi réussi a faire dysfonctionné le démon a défaut de le planter, en lançant le démon avant Clementine.

les scripts sont corrigés.
le conky utilise 11Mo de mémoire et entre 0 et 4% de processeur si Clementine est lancé on augmente de 1%.
le démon utilise 7Mo de mémoire et entre 0 et 2% de processeur indépendamment de la lecture si Clementine n'est pas lancé 0%.

le lien vers le pack reste inchangé

pour les curieux voici les scripts

playing_clementine.py

#!/usr/bin/env python2
#-*- coding: ascii -*-
#
# playing_clementine.py
# Script creer sur la base de anowplaying.py
# par Didier-T
#
# pour utilisation avec conky
#

import dbus, optparse, shutil, commands
import unicodedata
from time import sleep


class maj:
    def __init__(self):
        '''Get system bus'''
        bus = dbus.SessionBus()
        try:
            self.amarok = bus.get_object('org.mpris.clementine', '/Player')
        except:
            self.amarok=None
            return
        self.amarokdict = self.amarok.GetMetadata()
        self.holdtitle=""
        self.holdcover=""

    def unaccent(self, str):
        return unicodedata.normalize('NFKD', str).encode('ascii', 'ignore')

    def init_ok(self):
        if self.amarok is not None:
            return 0
        else:
            return 1

    def maj(self):
        temp = {}
        ret = {}
        cpos = mt = mtime = etime = rtime = progress = None

        if self.amarokdict.has_key('mtime'):
            try :
                cpos = self.amarok.PositionGet()/1000
            except:
                self.amarok=None
                return

            mt = self.amarokdict['mtime']/1000
            mtime = str(mt/60)+":"+str(mt%60) if mt%60>9 else str(mt/60)+":0"+str(mt%60)
            etime = str(cpos/60)+":"+str(cpos%60) if cpos%60>9 else str(cpos/60)+":0"+str(cpos%60)
            rtime = str((mt-cpos)/60)+":"+str((mt-cpos)%60) if (mt-cpos)%60>9 else str((mt-cpos)/60)+":0"+str((mt-cpos)%60)
            progress= float(cpos)/float(mt)*100

        if etime is not None:
            temp["etime"]=etime
        if rtime is not None:
            temp["rtime"]=rtime
        if mtime is not None:
            temp["mtime"]=mtime
        if progress is not None:
            temp["progress"]=progress

        try :
            self.amarokdict = self.amarok.GetMetadata()
        except:
            self.amarok=None
            return

        if self.amarokdict.has_key('artist') :
            ret["artist"] = self.unaccent(self.amarokdict['artist'][0:50])
        if self.amarokdict.has_key('title'):
            ret["title"] = self.unaccent(self.amarokdict['title'][0:50])
        if self.amarokdict.has_key('album'):
            ret["album"] = self.unaccent(self.amarokdict['album'][0:35])
        if self.amarokdict.has_key('genre'):
            ret["genre"] = self.unaccent(self.amarokdict['genre'][0:50])
        if self.amarokdict.has_key('year'):
            ret["year"] = str(self.amarokdict['year'])
        if self.amarokdict.has_key('tracknumber'):
            ret["tracknumber"] = str(self.amarokdict['tracknumber'])
        if self.amarokdict.has_key('audio-bitrate'):
            ret["bitrate"] = str(self.amarokdict['audio-bitrate'])
        if self.amarokdict.has_key('audio-samplerate'):
            ret["samplerate"] = str(self.amarokdict['audio-samplerate'])

        if self.amarokdict.has_key('arturl'):
            cover = self.amarokdict['arturl']
            if cover != "" and self.holdcover != cover :
                self.holdcover=cover
                try :
                    shutil.copyfile(cover.replace('file://', ''), "/tmp/jaquet.jpg")
                except Exception, e:
                    print e

        if self.holdtitle != ret["title"] :
            self.holdtitle = ret["title"]
            fiche = open("/tmp/clem_play", "w")
            fiche.write(str(ret))
            fiche.close()

        fiche = open("/tmp/clem_temp", "w")
        fiche.write(str(temp))
        fiche.close()


def demonise(init):
    x=0
    while 1 :
        '''Check if clementine is running'''
        output = commands.getoutput('ps -A')
        if 'clementine' in output:
            if init==1 :
                miseajour=maj()
                init=miseajour.init_ok()
            else:
                init=miseajour.init_ok()
                if init==0:
                    miseajour.maj()

        sleep(1)


if __name__ == '__main__':
    demonise(1)

playing_clementine.lua

-- Biliothèque de récupération de donées clementine pour conky
-- Ecrit par Didier-T
-- Du forum ubuntu.fr
-- Pour les besoins d'un conky créer par Ferod
-- Le 23/06/2015


local json = require('json')
local math = require('math')
local tonumber = tonumber
local assert = assert
local os = require('os')
local io = require('io')
local dermodif = nil
local info_titre, time_titre
module("playing_clementine")

do
    function info(recherche)
        local function exec(cmd)
            local cmd=cmd.." > /tmp/exec.log"
            local e=os.execute(cmd)
            local file=assert(io.open("/tmp/exec.log", "r"))
            local r=file:read()
            assert(file:close())
            return r
        end
        --Vérifier l'existence d'un fichier
        local function existe(file)
            local a = io.open(file, "r")
            local present
            if a then
                present = true
                io.close(a)
            else
                present = false
            end
            return present
        end
        if existe("/tmp/clem_play") then
            local dermodif2=exec("date -r /tmp/clem_play '+%s'")
            if dermodif == nil or dermodif ~= dermodif2 then
                dermodif=dermodif2
                local file = assert(io.open("/tmp/clem_play", "rb") )
                local line = file:read()
                info_titre = json.decode(line)
                assert(file:close())
            end
        end
        if existe("/tmp/clem_temp") then
            local dermodif4=exec("date -r /tmp/clem_temp '+%s'")
            if dermodif3 == nil or dermodif3 ~= dermodif4 then
                dermodif3=dermodif4
                local file = assert(io.open("/tmp/clem_temp", "rb") )
                local line = file:read()
                time_titre = json.decode(line)
                assert(file:close())
            end
        end

        if info_titre==nil or time_titre==nil then
            return
        elseif recherche=="artiste" then
            return info_titre["artist"] or "N/A"
        elseif recherche=="titre" then
            return info_titre["title"] or "N/A"
        elseif recherche=="album" then
            return info_titre["album"] or "N/A"
        elseif recherche=="genre" then
            return info_titre["genre"] or "N/A"
        elseif recherche=="annee" then
            return info_titre["year"] or "N/A"
        elseif recherche=="tracknumber" then
            return info_titre["tracknumber"] or "N/A"
        elseif recherche=="bitrate" then
            return info_titre["bitrate"] or "N/A"
        elseif recherche=="samplerate" then
            return info_titre["samplerate"] or "N/A"
        elseif recherche=="temp_passe" then
            return time_titre["etime"] or "0"
        elseif recherche=="temp_restant" then
            return time_titre["rtime"] or "0"
        elseif recherche=="temp_titre" then
            return time_titre["mtime"] or "0"
        elseif recherche=="avancement" then
            return time_titre["progress"] or "0"
        else
            return "Non affecté"
        end
    end
end

meteo.lua

-- Biliothèque météo simple pour conky
-- Ecrit par Didier-T
-- Du forum ubuntu.fr
-- Pour les besoins d'un conky créer par Ferod
-- Le 23/06/2015


local json = require('json')
local math = require('math')
local tonumber = tonumber
local assert = assert
local os = require('os')
local io = require('io')
local cc, sj, r
local print = print
local tostring = tostring
module("meteo")

-- utiliser le code postal pour trouver la ville

do
    function maj(code_postal, periode)
        periode=periode or "all"
        code_postal=code_postal or "75000"

        local function curl(url)
            local cmd="curl -o /tmp/curl.log -s ".."\""..url.."\""
            local e=os.execute(cmd)
            local file=assert(io.open("/tmp/curl.log", "r"))
            local r=file:read()
            assert(file:close())
            return r, (e==0 or e==true)
        end
        local function cond_cour(code_postal)
            local r,e=curl("http://api.openweathermap.org/data/2.5/weather?q="..code_postal..",fr&mode=json&units=metric&lang=fr")
            local ret=json.decode(r)
            ret["weather"][1]["id"]=tostring(ret["weather"][1]["id"]):gsub("200", "i"):gsub("201", "i"):gsub("202", "i"):gsub("230", "i"):gsub("231", "i"):gsub("232", "i"):gsub("906", "i"):
                                        gsub("210", "f"):gsub("211", "f"):gsub("212", "f"):
                                        gsub("221", "W"):gsub("731", "W"):gsub("900","W"):
                                        gsub("300", "G"):gsub("301", "G"):gsub("302", "G"):gsub("310", "G"):gsub("311", "G"):gsub("312", "G"):gsub("321", "G"):
                                        gsub("500", "g"):gsub("501", "g"):gsub("520", "g"):
                                        gsub("502", "h"):gsub("503", "h"):gsub("504", "h"):gsub("521", "h"):gsub("522", "h"):
                                        gsub("511", "k"):gsub("600", "k"):gsub("601", "k"):gsub("611", "k"):gsub("621", "k"):
                                        gsub("602", "j"):
                                        gsub("701", "J"):gsub("711", "J"):
                                        gsub("721", "I"):
                                        gsub("741", "F"):
                                        gsub("800", "C"):
                                        gsub("801", "b"):
                                        gsub("802", "c"):
                                        gsub("803", "d"):
                                        gsub("804", "e"):
                                        gsub("901", "V"):gsub("902", "V"):
                                        gsub("903", "x"):
                                        gsub("904", "z"):
                                        gsub("905", "v")
            return ret
        end
        local function sept_jour(code_postal)
            local r,e=curl("http://api.openweathermap.org/data/2.5/forecast/daily?q="..code_postal..",fr&mode=json&units=metric&cnt=7&lang=fr")
            local ret=json.decode(r)
            for jour=1, 7 do
                ret["list"][jour]["weather"][1]["id"]=tostring(ret["list"][jour]["weather"][1]["id"]):
                                                    gsub("200", "i"):gsub("201", "i"):gsub("202", "i"):gsub("230", "i"):gsub("231", "i"):gsub("232", "i"):gsub("906", "i"):
                                                    gsub("210", "f"):gsub("211", "f"):gsub("212", "f"):
                                                    gsub("221", "W"):gsub("731", "W"):gsub("900","W"):
                                                    gsub("300", "G"):gsub("301", "G"):gsub("302", "G"):gsub("310", "G"):gsub("311", "G"):gsub("312", "G"):gsub("321", "G"):
                                                    gsub("500", "g"):gsub("501", "g"):gsub("520", "g"):
                                                    gsub("502", "h"):gsub("503", "h"):gsub("504", "h"):gsub("521", "h"):gsub("522", "h"):
                                                    gsub("511", "k"):gsub("600", "k"):gsub("601", "k"):gsub("611", "k"):gsub("621", "k"):
                                                    gsub("602", "j"):
                                                    gsub("701", "J"):gsub("711", "J"):
                                                    gsub("721", "I"):
                                                    gsub("741", "F"):
                                                    gsub("800", "C"):
                                                    gsub("801", "b"):
                                                    gsub("802", "c"):
                                                    gsub("803", "d"):
                                                    gsub("804", "e"):
                                                    gsub("901", "V"):gsub("902", "V"):
                                                    gsub("903", "x"):
                                                    gsub("904", "z"):
                                                    gsub("905", "v")
            end

            return ret
        end

        if periode=="all" then
            cc=cond_cour(code_postal)
            sj=sept_jour(code_postal)
        elseif periode=="cc" then
            cc=cond_cour(code_postal)
        else
            sj=sept_jour(code_postal)
        end
    end

    function info(valeur, jour)
        jour=tonumber(jour) or 0

        if jour==0 then
            if valeur=="lon" then
                r = cc["coord"]["lon"]
            elseif valeur=="lat" then
                r = cc["coord"]["lat"]
            elseif valeur=="pays" then
                r = cc["sys"]["country"]
            elseif valeur=="leve_soleil" then
                r = cc["sys"]["sunrise"]
            elseif valeur=="coucher_soleil" then
                r = cc["sys"]["sunset"]
            elseif valeur=="meteo_id" then
                r = cc["weather"][1]["id"]
            elseif valeur=="meteo_main" then
                r = cc["weather"][1]["main"]
            elseif valeur=="meteo_description" then
                r = cc["weather"][1]["description"]
            elseif valeur=="meteo_icone" then
                r = cc["weather"][1]["icon"]
            elseif valeur=="temp" then
                r = math.floor(cc["main"]["temp"])
            elseif valeur=="temp_min" then
                r = math.floor(cc["main"]["temp_min"])
            elseif valeur=="temp_max" then
                r = math.floor(cc["main"]["temp_max"])
            elseif valeur=="pression" then
                r = math.floor(cc["main"]["pressure"])
            elseif valeur=="sea_level" then
                r = cc["main"]["sea_level"]
            elseif valeur=="grnd_level" then
                r = cc["main"]["grnd_level"]
            elseif valeur=="humidite" then
                r = cc["main"]["humidity"]
            elseif valeur=="vent_vitesse" then
                r = math.floor(cc["wind"]["speed"])
            elseif valeur=="vent_direction" then
                r = cc["wind"]["deg"]
            elseif valeur=="couverture_nuageuse" then
                r = cc["clouds"]["all"]
            elseif valeur=="pluie_court_terme" then
                if cc["rain"] ~= nil then
                    r = cc["rain"]["3h"]
                else
                    r = 0
                end
            elseif valeur=="date" then
                r = cc["dt"]
            elseif valeur=="ville" then
                r = cc["name"]
            else
                r = valeur.." n'éxiste pas"
            end
        else
            if valeur=="date" then
                r = sj["list"][jour]["dt"]
            elseif valeur=="temp_jour" then
                r = math.floor(sj["list"][jour]["temp"]["day"])
            elseif valeur=="temp_min" then
                r = math.floor(sj["list"][jour]["temp"]["min"])
            elseif valeur=="temp_max" then
                r = math.floor(sj["list"][jour]["temp"]["max"])
            elseif valeur=="temp_nuit" then
                r = math.floor(sj["list"][jour]["temp"]["night"])
            elseif valeur=="temp_soir" then
                r = math.floor(sj["list"][jour]["temp"]["eve"])
            elseif valeur=="temp_matin" then
                r = math.floor(sj["list"][jour]["temp"]["morn"])
            elseif valeur=="pression" then
                r = sj["list"][jour]["pressure"]
            elseif valeur=="humidite" then
                r = sj["list"][jour]["humidity"]
            elseif valeur=="meteo_id" then
                r = sj["list"][jour]["weather"][1]["id"]
            elseif valeur=="meteo_main" then
                r = sj["list"][jour]["weather"][1]["main"]
            elseif valeur=="meteo_description" then
                r = sj["list"][jour]["weather"][1]["description"]
            elseif valeur=="meteo_icone" then
                r = sj["list"][jour]["weather"][1]["icon"]
            elseif valeur=="vent_vitesse" then
                r = math.floor(sj["list"][jour]["speed"])
            elseif valeur=="vent_direction" then
                r = sj["list"][jour]["deg"]
            elseif valeur=="couverture_nuageuse" then
                r = sj["list"][jour]["clouds"]
            elseif valeur=="pluviometrie" then
                r = sj["list"][jour]["rain"] or 0
            else
                r = valeur.." "..jour.." n'éxiste pas"
            end
        end
        return r
    end

end

script.lua

--this is a lua script for use in conky
require 'cairo'
require 'os'
local meteo=require('meteo')
local play=require('playing_clementine')

-- Parametre a modifier
local chemin="~/.conky/conky-perso/Monochrome" -- répertoire ou ce trouve vos scripts
local departement="95100" -- indiquer le département pour la météo
local disque_1="/home"
local disque_2="/"
local disque_3="~"

--[[
###################################################################################################
#  Ne pas faire de modification après cette ligne (sauf si vous savez ce que vous faite), Merci.  #
###################################################################################################
]]--
local home = os.getenv("HOME")
chemin=string.gsub(chemin,"~",home)
disque_1=string.gsub(disque_1,"~",home)
disque_2=string.gsub(disque_2,"~",home)
disque_3=string.gsub(disque_3,"~",home)
local nb_coeur=tonumber(conky_parse("${exec cat /proc/cpuinfo | grep processor | wc -l}"))
local Clementine
local T00=0
local T0=0
local T=0
local cr, T1, T2
local demon=1

-- Partie Fonctions
local function draw_circle(alpha,progress,x_center,y_center,radius,epaisseur)
    cairo_set_source_rgba(cr,1,1,1,alpha)
    cairo_set_line_width(cr,epaisseur)
    cairo_arc(cr, x_center, y_center, radius, 0-math.pi/2, progress * 2 * math.pi / 100 - math.pi/2)
    cairo_stroke(cr)
end

local function draw_circle_gauge(alpha,nb_gauge,angle_step,angle_step_ink,x_center,y_center,radius,epaisseur)
    cairo_set_source_rgba(cr,1,1,1,alpha)
    cairo_set_line_width(cr,epaisseur)
    local angle_step_rad=angle_step*math.pi/180
    local angle_step_ink_rad=angle_step_ink*math.pi/180
    local i = 1
    local angle=-math.pi/2
    while i <= nb_gauge do
        cairo_arc(cr, x_center, y_center, radius, angle, angle + angle_step_ink_rad)
        angle=angle+angle_step_rad
        cairo_stroke(cr)
        i = i+1
    end

end

local function draw_line(alpha,progress,x_ligne,y_ligne,longueur,epaisseur)
    progress=progress or 0
    local red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    cairo_set_dash(cr,1.,0,1)
    cairo_move_to (cr, x_ligne, y_ligne)
    cairo_line_to (cr, x_ligne+((progress/100)*longueur), y_ligne)
    cairo_stroke (cr)
end

local function draw_dash_line(alpha,progress,x_ligne,y_ligne,longueur,epaisseur)
    local red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    cairo_set_dash(cr,5.,1,0)
    cairo_move_to (cr, x_ligne, y_ligne)
    cairo_line_to (cr, x_ligne+longueur*progress/100, y_ligne)
    cairo_stroke (cr)
end

local function draw_scale(alpha,x_ligne,y_ligne,nb_step,long_step_ink,long_step,epaisseur)
    local red,green,blue=1,1,1
    cairo_set_source_rgba (cr,1,1,1,alpha)
    cairo_set_line_width (cr, epaisseur)
    local i = 1
    local x_step=x_ligne
    while i <= nb_step do
        cairo_move_to (cr, x_step, y_ligne)
        cairo_line_to (cr, x_step+long_step_ink,y_ligne)
        cairo_stroke (cr)
        x_step=x_step + long_step
        i=i+1
    end
end

local function affiche_texte(police,taille,x,y,alpha,texte)
    local red,green,blue,alpha=1,1,1,alpha
    cairo_select_font_face (cr, police, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
    cairo_set_font_size (cr, taille)
    cairo_set_source_rgba (cr,red,green,blue,alpha)
    cairo_move_to (cr,x,y)
    cairo_show_text (cr,texte)
    cairo_stroke (cr)
end

-- Partie script
function graph_line(Maj)
    if Maj==1 then
        -- Températures
        T1=tonumber(conky_parse("${exec sensors | awk ' $2==\"0:\" {print $3}' | cut -c 2-3}"))
        T2=tonumber(conky_parse("${exec sensors | awk ' $2==\"1:\" {print $3}' | cut -c 2-3}"))
    end

    -- Utilisation Disque
    local used_perc1=tonumber(conky_parse("${fs_used_perc "..disque_1.."}"))
    local used_perc2=tonumber(conky_parse("${fs_used_perc "..disque_2.."}"))
    local used_perc3=tonumber(conky_parse("${fs_used_perc "..disque_3.."}"))
    -- A chaque cycle
    -- Heure
    local heure=tonumber(conky_parse("${time %I}"))
    local minute=tonumber(conky_parse("${time %M}"))
    local seconde=tonumber(conky_parse("${time %S}"))
    -- Utilisation CPU
    local cpu={}
    for i = 1,nb_coeur do
        cpu[i]=tonumber(conky_parse("${cpu cpu"..i.."}"))
    end
    -- UP Down
    local ratio_upload=tonumber(conky_parse("${upspeedf eth0}")/55*100)
    local ratio_download=tonumber(conky_parse("${downspeedf eth0}")/302*100)
    -- Clementine
    Clementine=play.info("avancement") --conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -p}")

    -- Horloge
    draw_circle(0.2,100,200,48,20,2)
    draw_circle(0.2,100,200,48,25,2)
    if heure == 12 then
        heure = 0
    end
    local prog_seconde=seconde/60
    local prog_minute=(minute+prog_seconde)/60
    local prog_heure=(heure+prog_minute)/12
    draw_circle(1.,prog_minute*100,200,48,25,2)
    draw_circle(1.,prog_heure*100,200,48,20,2)
    draw_circle_gauge(1,12,30,2,200,48,20,2)
    draw_circle_gauge(1,12,30,2,200,48,25,2)
    draw_circle_gauge(1,seconde,6,2,200,48,30,2)

    --CPU & RAM
    local y_img_4 = 219
    draw_scale(0.5,153,y_img_4+32,36,1,5,3)
    draw_scale(1,153,y_img_4+32,8,1,25,6)
    local t1=T1-30
    local t2=T2-30
    if t1<0 then
        t1 = 0
    end
    if t2<0 then
        t2 = 0
    end
    draw_line(t1/35,(t1/70)*100,153,y_img_4+31,176,2)
    draw_line(t2/35,(t2/70)*100,153,y_img_4+33,176,2)

    for i = 1,nb_coeur do
        if cpu[i] == nil then cpu[i]=0 end
    end
    draw_line(0.2,100,180,y_img_4+49,150,2)
    local ratio_barre=(150/nb_coeur)

    -- calcul pour affichage barre ratio cpu
    local x1 = {}
    x1[1]=180 -- début barre cpu1
    for i = 1,nb_coeur do
        x1[i+1]=x1[i]+cpu[i]/100*ratio_barre
    end

    -- affichage barre occupation cpu
    local ratio_trans=(0.8/nb_coeur)
    for i = 1,nb_coeur do
        draw_line(1-(i-1)*ratio_trans,cpu[i],x1[i],y_img_4+49,ratio_barre,2)
    end

    draw_line(0.2,100,180,y_img_4+72,150,2)
    local mem_perc=tonumber(conky_parse("${memperc}"))
    draw_line(1,mem_perc,180,y_img_4+72,150,2)

    --utilisation disque :
    local y_img_5 = 292
    draw_line(0.2,100,160,y_img_5+33,170,2)
    draw_line(1,used_perc1,160,y_img_5+33,170,2)

    draw_line(0.2,100,160,y_img_5+53,170,2)
    draw_line(1,used_perc2,160,y_img_5+53,170,2)

    draw_line(0.2,100,160,y_img_5+83,170,2)
    draw_line(1,used_perc3,160,y_img_5+73,170,2)

    --upload
    local y_img_6 = 365
    draw_line(0.2,100,170,y_img_6+33,160,2)
    draw_line(1,ratio_upload,170,y_img_6+33,160,2)
    --download
    draw_line(0.2,100,170,y_img_6+48,160,2)
    draw_line(1,ratio_download,170,y_img_6+48,160,2)

    -- lecture musique
    if Clementine ~= nil then
        local y_img_7 = 438
        draw_line(0.2,100,100,y_img_7+70,230,2)
        local progress=tonumber(Clementine)
        draw_line(1,progress,100,y_img_7+70,230,2)
    end
end

function display_text(Maj)
    local h_leve=os.date("%H:%M", meteo.info("leve_soleil"))--conky_parse("${exec "..chemin.."/meteo_display.sh current 1}")
    local h_couche=os.date("%H:%M", meteo.info("coucher_soleil"))--conky_parse("${exec "..chemin.."/meteo_display.sh current 2}")
    local meteo_act=meteo.info("meteo_description")--conky_parse("${exec "..chemin.."/meteo_display.sh current 8}")
    local pression=meteo.info("pression")--conky_parse("${exec "..chemin.."/meteo_display.sh pression 1}").." hPa"
    local temp_act=meteo.info("temp")--conky_parse("${exec "..chemin.."/meteo_display.sh current 3}")
    local text_meteo=meteo.info("meteo_id")--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 1}")
    local humidite=meteo.info("humidite")--conky_parse("${exec "..chemin.."/meteo_display.sh current 6}")
    local speed=meteo.info("vent_vitesse")--conky_parse("${exec "..chemin.."/meteo_display.sh current 7}")
    local precipitation=meteo.info("pluie_court_terme")--conky_parse("${exec "..chemin.."/meteo_display.sh current 9}")
    local temp_min=meteo.info("temp_min", 1)--conky_parse("${exec "..chemin.."/meteo_display.sh current 4}")
    local temp_max=meteo.info("temp_max", 1)--conky_parse("${exec "..chemin.."/meteo_display.sh current 5}")
    local semaine_meteo_2=meteo.info("meteo_id", 2)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 2}")
    local semaine_meteo_3=meteo.info("meteo_id", 3)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 3}")
    local semaine_meteo_4=meteo.info("meteo_id", 4)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 4}")
    local semaine_meteo_5=meteo.info("meteo_id", 5)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 5}")
    local semaine_meteo_6=meteo.info("meteo_id", 6)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 6}")
    local semaine_meteo_7=meteo.info("meteo_id", 7)--conky_parse("${exec "..chemin.."/meteo_display.sh meteo 7}")
    -- affichage du jour
    local semaine_jour_2=os.date("%a", meteo.info("date", 2))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 2}")
    local semaine_jour_3=os.date("%a", meteo.info("date", 3))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 3}")
    local semaine_jour_4=os.date("%a", meteo.info("date", 4))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 4}")
    local semaine_jour_5=os.date("%a", meteo.info("date", 5))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 5}")
    local semaine_jour_6=os.date("%a", meteo.info("date", 6))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 6}")
    local semaine_jour_7=os.date("%a", meteo.info("date", 7))--conky_parse("${exec "..chemin.."/meteo_display.sh jour 7}")
    -- prévision température jour
    local semaine_temp_2=meteo.info("temp_jour", 2)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 2}").."°C"
    local semaine_temp_3=meteo.info("temp_jour", 3)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 3}").."°C"
    local semaine_temp_4=meteo.info("temp_jour", 4)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 4}").."°C"
    local semaine_temp_5=meteo.info("temp_jour", 5)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 5}").."°C"
    local semaine_temp_6=meteo.info("temp_jour", 6)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 6}").."°C"
    local semaine_temp_7=meteo.info("temp_jour", 7)--conky_parse("${exec "..chemin.."/meteo_display.sh temperature 7}").."°C"

    local espace1=conky_parse("${fs_used_perc "..disque_1.."}").."%"
    local espace2=conky_parse("${fs_used_perc "..disque_2.."}").."%"
    local espace3=conky_parse("${fs_used_perc "..disque_3.."}").."%"
    local esp_used1=conky_parse("${fs_used "..disque_1.."}")
    local esp_used2=conky_parse("${fs_used "..disque_2.."}")
    local esp_used3=conky_parse("${fs_used "..disque_3.."}")
    local esp_free1=conky_parse("${fs_free "..disque_1.."}")
    local esp_free2=conky_parse("${fs_free "..disque_2.."}")
    local esp_free3=conky_parse("${fs_free "..disque_3.."}")


    local cpu=conky_parse("${cpu cpu0}")

    local y_img_1 = 0
    --[[###########################################
        Heure et Date
    ##############################################]]
    affiche_texte("Ubuntu",11,92,y_img_1+30,1,"J"..conky_parse("${time %j}").." - S"..conky_parse("${time %V}"))
    affiche_texte("Sans",50,85,y_img_1+73,1,"☼")
    affiche_texte("Ubuntu",11,130,y_img_1+50,1,h_leve)
    affiche_texte("Ubuntu",11,130,y_img_1+70,1,h_couche)
    affiche_texte("Ubuntu",12,185,y_img_1+52,1,conky_parse("${time %H:%M}"))     --heure
    affiche_texte("Ubuntu",12,282,y_img_1+34,1,conky_parse("${time %A}"))        --nom du jour
    affiche_texte("Ubuntu",12,282,y_img_1+45,1,conky_parse("${time %B}"))        --nom du mois
    affiche_texte("Ubuntu",32,245,y_img_1+45,1,conky_parse("${time %d}"))        --numeros du jour
    affiche_texte("Ubuntu",32,245,y_img_1+71,1,conky_parse("${time %Y}"))        --année

    --[[###########################################
        Météo actuelle
    ##############################################]]
    local y_img_2 = 73
    affiche_texte("Weather",65,95,y_img_2+77,1,text_meteo)
    --affiche_texte("Weather",65,95,y_img_2+77,1,"g")
    affiche_texte("Ubuntu",11,150,y_img_2+30,1,meteo_act.." - "..temp_act.." - "..pression)

    affiche_texte("Ubuntu",11,150,y_img_2+45,1,pression.." - "..humidite.." hum")
    affiche_texte("Ubuntu",11,150,y_img_2+60,1,"Vent : "..speed)
    affiche_texte("Ubuntu",11,150,y_img_2+75,1,"Pluies : "..precipitation)

    --affiche_texte("Ubuntu",11,150,y_img_2+40,1,"min : "..temp_min.." - max : "..temp_max)
    affiche_texte("Ubuntu",11,310,y_img_2+70,1,temp_min)
    affiche_texte("Ubuntu",11,310,y_img_2+45,1,temp_max)
    affiche_texte("Weather",50,295,y_img_2+75,1,"y")

    --[[###########################################
        prévision météo semaine
    ##############################################]]
    local y_img_3 = 146
    affiche_texte("Weather",50,95,y_img_3+67,1,semaine_meteo_2)
    affiche_texte("Weather",50,135,y_img_3+67,1,semaine_meteo_3)
    affiche_texte("Weather",50,175,y_img_3+67,1,semaine_meteo_4)
    affiche_texte("Weather",50,215,y_img_3+67,1,semaine_meteo_5)
    affiche_texte("Weather",50,255,y_img_3+67,1,semaine_meteo_6)
    affiche_texte("Weather",50,295,y_img_3+67,1,semaine_meteo_7)

    -- affichage du jour
    affiche_texte("Ubuntu",11,100,y_img_3+27,1,semaine_jour_2)
    affiche_texte("Ubuntu",11,140,y_img_3+27,1,semaine_jour_3)
    affiche_texte("Ubuntu",11,180,y_img_3+27,1,semaine_jour_4)
    affiche_texte("Ubuntu",11,220,y_img_3+27,1,semaine_jour_5)
    affiche_texte("Ubuntu",11,260,y_img_3+27,1,semaine_jour_6)
    affiche_texte("Ubuntu",11,300,y_img_3+27,1,semaine_jour_7)

    -- prévision température jour
    affiche_texte("Ubuntu",12,100,y_img_3+74,1,semaine_temp_2)
    affiche_texte("Ubuntu",12,140,y_img_3+74,1,semaine_temp_3)
    affiche_texte("Ubuntu",12,180,y_img_3+74,1,semaine_temp_4)
    affiche_texte("Ubuntu",12,220,y_img_3+74,1,semaine_temp_5)
    affiche_texte("Ubuntu",12,260,y_img_3+74,1,semaine_temp_6)
    affiche_texte("Ubuntu",12,300,y_img_3+74,1,semaine_temp_7)


    --[[###########################################
        CPU Temperature et RAM
    ##############################################]]
    local y_img_4 = 219
    affiche_texte("Ubuntu",13,100,y_img_4+32,1,"Temp :")
    affiche_texte("Ubuntu",13,100,y_img_4+52,1,"CPU    :")
    affiche_texte("Ubuntu",13,100,y_img_4+72,1,"RAM   :")

    affiche_texte("Ubuntu",10,147,y_img_4+26,1,"30°")
    affiche_texte("Ubuntu",10,197,y_img_4+26,1,"50°")
    affiche_texte("Ubuntu",10,247,y_img_4+26,1,"70°")
    affiche_texte("Ubuntu",10,297,y_img_4+26,1,"90°")

    if cpu == nil then cpu=0 end

    affiche_texte("Ubuntu",11,150,y_img_4+52,1,cpu.."%")

    affiche_texte("Ubuntu",11,150,y_img_4+72,1,conky_parse("${memperc}").."%")
    affiche_texte("Ubuntu",11,180,y_img_4+69,1,conky_parse("${mem}"))
    affiche_texte("Ubuntu",11,290,y_img_4+69,0.7,conky_parse("${memeasyfree}"))

    --[[###########################################
        Espace disponible
    ##############################################]]
    local y_img_5 = 292
    affiche_texte("Heydings Icons",18,100,y_img_5+34,1,"H")
    affiche_texte("Heydings Icons",18,100,y_img_5+54,1,"L")
    affiche_texte("Heydings Icons",18,100,y_img_5+74,1,"F")

    affiche_texte("Ubuntu",15,123,y_img_5+33,1,espace1)
    affiche_texte("Ubuntu",15,123,y_img_5+53,1,espace2)
    affiche_texte("Ubuntu",15,123,y_img_5+73,1,espace3)

    affiche_texte("Ubuntu",11,160,y_img_5+30,1,esp_used1)
    affiche_texte("Ubuntu",11,160,y_img_5+50,1,esp_used2)
    affiche_texte("Ubuntu",11,160,y_img_5+70,1,esp_used3)

    affiche_texte("Ubuntu",11,290,y_img_5+30,0.7,esp_free1)
    affiche_texte("Ubuntu",11,290,y_img_5+50,0.7,esp_free2)
    affiche_texte("Ubuntu",11,290,y_img_5+70,0.7,esp_free3)

    --[[###########################################
        Débit internet
    ##############################################]]
    local y_img_6 = 365
    affiche_texte("Deja",18,100,y_img_6+38,1,"↗")
    affiche_texte("Ubuntu",12,120,y_img_6+38,1,conky_parse("${upspeed eth0}"))
    affiche_texte("Deja",18,100,y_img_6+53,1,"↘")
    affiche_texte("Ubuntu",12,120,y_img_6+53,1,conky_parse("${downspeed eth0}"))
    local up_total=conky_parse("${totalup eth0}")
    local down_total=conky_parse("${totaldown eth0}")
    affiche_texte("Ubuntu",12,100,y_img_6+68,1,"Total : "..up_total.." / "..down_total)

    --[[###########################################
        Musique
    ##############################################]]
    if Clementine ~= nil then
        local y_img_7 = 438
        affiche_texte("Ubuntu",11,100,y_img_7+35,1,play.info("album"))--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -l}"))
        affiche_texte("Ubuntu",11,100,y_img_7+50,1,play.info("titre"))--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -t}"))
        local temp_ecoule=play.info("temp_passe")--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -e}")
        local temp_remain=play.info("temp_restant")--conky_parse("${execi 5 python2 "..chemin.."/anowplaying.py -r}")
        affiche_texte("Ubuntu",11,100,y_img_7+65,1,temp_ecoule)
        affiche_texte("Ubuntu",11,310,y_img_7+65,0.7,temp_remain)
    end
end

function conky_main()
    local function exec(cmd)
        local cmd=cmd.." > /tmp/exec.log"
        local e=os.execute(cmd)
        local file=assert(io.open("/tmp/exec.log", "r"))
        local r=file:read("*all")
        assert(file:close())
        return r
    end

    if conky_window == nil then
        return
    end

    if demon==1 then
        local list=exec("ps -sa | awk '{print $NF}'")
        if list:find("playing_clementine.py")~=nil then
            demon=0
        else
            demon=os.execute('python '..chemin..'/playing_clementine.py &')
        end
    end

    local cs = cairo_xlib_surface_create(conky_window.display,
                                         conky_window.drawable,
                                         conky_window.visual,
                                         conky_window.width,
                                         conky_window.height)
    cr = cairo_create(cs)
    local updates=tonumber(conky_parse('${updates}'))

    local interval=30
    local timer=(updates % interval)
    local T1 = os.time()

    -- Gestion mise a jour météo
    if os.difftime(T1, T) >= 300 then
        if os.difftime(T1, T0) >= 3600 then
            meteo.maj(departement, "7jours")
            T0=T1
        end
        meteo.maj(departement, "cc")
        T=T1
    end


    if updates>=5 then
        if os.difftime(T1, T00) >= 30 then
            display_text(1)
            graph_line(1)
            T00=T1
        else
            display_text(0)
            graph_line(0)
        end
    end

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

.conkyrc

######################
# - Conky settings - #
######################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1

#imlib_cache_size 0
double_buffer yes
no_buffers yes

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Ubuntu:size=9
override_utf8_locale yes
text_buffer_size 2048

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

alignment tr
gap_x -2
gap_y 180
minimum_size 350 520


default_bar_size 60 10

# - Graphics settings - #
#########################
draw_shades no

default_color ffffff
default_shade_color 1d1d1d
color0 ffffff
color1 ffffff
color2 ffffff

lua_load ~/.conky/conky-perso/Monochrome/script.lua
lua_draw_hook_pre main
TEXT

#---IMAGES----
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,0 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,73 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,146 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,219 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,292 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,365 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/base.png -p 10,438 -s 339x86}
${image ~/.conky/conky-perso/Monochrome/calendar.png -p 28,20 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/weather.png -p 28,93 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/weather.png -p 28,166 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/emblem-system.png -p 28,239 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/folder.png -p 28,312 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/nm-signal-75.png -p 28,385 -s 45x45}
${image ~/.conky/conky-perso/Monochrome/emblem-sound.png -p 28,458 -s 45x45}

A+,
Didier.

P.S. : j'ai supprimé les décimals de la pression, j'aurais besoins du nombre de carractères max à afficher pour modifier le fichier playing_clementine.lua

P.P.S. : pour l'utilisation il faudra modifier .conkyrc et script.lua (les chemins et le département pour la météo), je n'ai pas besoins de rendre les scripts lua exécutable pour qu'ils fonctionnes cher moi (les joies de l'informatique)

Edit : (sa change des P.S), il n'y a plus besoins de se soucier du lancement de playing_clementine.py, il est gérer automatiquement par script.lua

#8 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 26/06/2015, à 12:02

Didier-T
Réponses : 1 634

Bonjour Ferod,
Je viens de finir les modifications.

40 caractères max pour les infos de la lecture en cours.
Le message d’erreur était du au fait que le conky ne soit pas lancé depuis le répertoire ou il est stocké, ce soucis est réglé.
Les unité sont remise en place dans l'archive.
Le soucis de changement d'image est réglé, tu verras dans le conky l'option "-n" derrière les infos des images concerné, c'est bien mieux que le" imlib_cache_size 0", et sa veux dire la même chose (sauf que la on cible les images concernées).
Enfin pour le "playing_clementine.py" qui ce lance sans cesse, vérifie s'il n'est pas lancé par le lanceur du conky, si c'est le cas supprime le de ton lanceur, son exécution est géré par le conky (en fait le conky regarde s'il est déjà lancé et le lance si nécessaire).

l'archive est modifier, toujours a la même adresse

Pour info en cherchant une solution pour le répertoire de travail je suis tombé sur un truc sympas pour voir l'heure de la dernière modification d'un fichier (je m'en sert pour Clementine), résultat le conky consomme entre 0 et 2 % de processeur (il dépasse rarement 1%), le reste ne change pas.

A+,
Didier.

P.S. : mon processeur monte assé facilement a 75°c si je le titille un peut trop big_smile

#9 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 26/06/2015, à 18:57

Didier-T
Réponses : 1 634

Re-bonjour Ferod,
7% de consommation... c'est quoi comme processeur, j'avais vue que  tu gérais 4 cœurs dans script.lua

Tu parle d'un forum ou l'on discute "lua", tu peut m'indiquer le chemin, je suis certain que j'y apprendrais plein de chose (au fait il s’agit bien de posix.stat).

A+,
Didier.

#10 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 08/07/2015, à 11:37

Didier-T
Réponses : 1 634

bonjour loutch,
a tout hasard tu pourrais essayer ceci

${execi 10 bash ~/.conky/radiotray/pochette.sh}

#11 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 14/07/2015, à 00:13

Didier-T
Réponses : 1 634

Bonsoir alius,
tu pourrais nous donner les scripts que tu utilises.

@ loutch,
il me semble l'avoir déjà fait, mais je ne le retrouve pas tongue

edit : c'est bon je l'ai retrouvé.

image.lua

require 'cairo'
home = os.getenv ('HOME')

--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)

	path = string.gsub(path, "~", home)
	path = string.gsub(path, "$HOME", home)

	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	
	local function fDrawImage(path,x,y,w,h,arc)
		x=x+(w/2)
		y=y+(h/2)
		local img =  cairo_image_surface_create_from_png(path)
		local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)

		local cr = cairo_create (cs)
		cairo_translate (cr, x, y)

		if arc then
			cairo_rotate (cr, arc)
		end

		cairo_scale (cr, w/w_img, h/h_img)
		cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
		cairo_paint (cr)
		cairo_destroy(cr)
		cairo_surface_destroy (img)
	end
	fDrawImage(path,x,y,w,h,arc)
	cairo_surface_destroy(cs)
	return ""
end

pour l'utilisation

avant TEXT
lua_load image.lua (avec le chemin qui vas bien)

après TEXT
${lua conky_fDrawImage Image_a_afficher position_x position_y largeur hauteur angle_de_rotation}

l'angle de rotation n'est pas une obligation, tu peux ne rien mettre.

#12 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 15/07/2015, à 21:56

Didier-T
Réponses : 1 634

Bonsoir alius,
tu étais sur la bonne voie, voici le script corrigé.

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

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

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

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

Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xFF6600,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=100, y=150,
        -- "radius" is the radius of the ring.
        radius=50,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.4,
        x=100, y=150,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.6,
        x=100, y=150,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=150,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=1,
        x=100, y=150,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=50, y=300,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=75, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=400,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=125, y=450,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
        {
        name='downspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x339900,
        fg_alpha=0.8,
        x=150, y=500,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
        {
        name='upspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff6600,
        fg_alpha=0.8,
        x=150, y=500,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
}

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

clock_r=65

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

clock_x=100
clock_y=150

show_seconds=true

require 'cairo'

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


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

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

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

    -- Draw background ring

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

    -- Draw indicator ring

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

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)

    end
end

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

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

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

        draw_ring(cr,pct,pt)
    end

    -- Check that Conky has been running for at least 5s

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

    local cr=cairo_create(cs)

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

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

    draw_clock_hands(cr,clock_x,clock_y)
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
end

#13 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 13/08/2016, à 13:56

Didier-T
Réponses : 1 634

Bonjour a tous,
cela fait bien longtemps que je n'ai plus posté ici smile

je viens de modifier le flichier clock_rings.lua afin de régler le soucis remonté par pianistocrate concernant les rings qui ne suivent pas les aiguilles.

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

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

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

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

Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='clock',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='heure',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xFF6600,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=100, y=150,
        -- "radius" is the radius of the ring.
        radius=50,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='clock',
        arg='minutes',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.4,
        x=100, y=150,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='clock',
        arg='secondes',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.6,
        x=100, y=150,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=150,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=1,
        x=100, y=150,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=50, y=300,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=75, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=400,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=125, y=450,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
        {
        name='downspeedf',
        arg='wlp2s0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x339900,
        fg_alpha=0.8,
        x=150, y=500,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
        {
        name='upspeedf',
        arg='wlp2s0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xff6600,
        fg_alpha=0.8,
        x=150, y=500,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
}

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

clock_r=65

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

clock_x=100
clock_y=150

show_seconds=true

require 'cairo'

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

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

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

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

    -- Draw background ring

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

    -- Draw indicator ring

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

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+0.85*clock_r*math.sin(mins_arc)
    ym=yc-0.85*clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local secs, mins, hours, mins_secs, hours_mins
        local str=''
        local value=0

        if pt['name']=='clock' then
            secs=os.date("%S")
            mins=os.date("%M")
            hours=os.date("%I")

            mins_secs=mins+secs/60
            hours_mins=hours+mins/60
            if pt['arg']=="heure" then
            str=hours_mins
            elseif pt['arg']=="minutes" then
            str=mins_secs
            else
            str=secs
            end
        else
            str=string.format('${%s %s}',pt['name'],pt['arg'])
            str=conky_parse(str)
        end

        value=tonumber(str)

        if value==nil then -- Gestion du problème de séparateur décimale
            str=conky_parse(str):gsub("%.",",")
            value=tonumber(str)
        end

        if value == nil then value = 0 end
        pct=value/pt['max']

        draw_ring(cr,pct,pt)
    end

    -- Check that Conky has been running for at least 5s

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

    local cr=cairo_create(cs)

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

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

    draw_clock_hands(cr,clock_x,clock_y)
end

J’espère avoir bien saisi le problème

A+,
Didier.

#14 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 13/08/2016, à 19:18

Didier-T
Réponses : 1 634

@pianistocrate,
voici ton script modifié, avec correction du bug 12h00

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

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

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

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

Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)

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

settings_table = {
    {
        name='clock',
        arg='heure',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.6,
        x=100, y=150,
        radius=50,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='clock',
        arg='minutes',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.7,
        x=100, y=150,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='clock',
        arg='secondes',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=150,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.9,
        x=100, y=150,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=1,
        x=100, y=150,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=50, y=300,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=50, y=300,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=75, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=100, y=400,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=125, y=450,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/home',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=125, y=450,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
        {
        name='downspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x339900,
        fg_alpha=0.8,
        x=150, y=500,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
        {
        name='upspeedf',
        arg='eth0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF3300,
        fg_alpha=0.8,
        x=150, y=500,
        radius=20,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
}
-- Use these settings to define the origin and extent of your clock.

clock_r=65

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

clock_x=100
clock_y=150

show_seconds=true

require 'cairo'

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

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

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

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

    -- Draw background ring

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

    -- Draw indicator ring

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

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys

    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")

    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12

    -- Draw hour hand

    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)

    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)

    -- Draw minute hand

    xm=xc+0.85*clock_r*math.sin(mins_arc)
    ym=yc-0.85*clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)

    cairo_set_line_width(cr,3)
    cairo_stroke(cr)

    -- Draw seconds hand

    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)

        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local secs, mins, hours, mins_secs, hours_mins
        local str=''
        local value=0

        if pt['name']=='clock' then
            secs=os.date("%S")
            mins=os.date("%M")
            hours=os.date("%I")

            mins_secs=mins+secs/60
            hours_mins=hours+mins/60
            if hours_mins > 12 then hours_mins=hours_mins-12 end
            if pt['arg']=="heure" then
            str=hours_mins
            elseif pt['arg']=="minutes" then
            str=mins_secs
            else
            str=secs
            end
        else
            str=string.format('${%s %s}',pt['name'],pt['arg'])
            str=conky_parse(str)
        end

        value=tonumber(str)

        if value==nil then -- Gestion du problème de séparateur décimale
            str=conky_parse(str):gsub("%.",",")
            value=tonumber(str)
        end

        if value == nil then value = 0 end
        pct=value/pt['max']

        draw_ring(cr,pct,pt)
    end

    -- Check that Conky has been running for at least 5s

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

    local cr=cairo_create(cs)

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

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

    draw_clock_hands(cr,clock_x,clock_y)
end

@Tous,
voici la correction apporté pour le soucis 12h00

code avant correction

            hours_mins=hours+mins/60
            if pt['arg']=="heure" then

code après correction

            hours_mins=hours+mins/60
            if hours_mins > 12 then hours_mins=hours_mins-12 end
            if pt['arg']=="heure" then

A bientôt,
Didier.

#15 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 14/08/2016, à 07:49

Didier-T
Réponses : 1 634

Bonjour chepioq,
J'ai simplement oublier de retirer une ligne de débogage.
Recherche dans le code lua la ligne contenant "print" et supprime la, sa réglera le soucis.

#17 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 15/08/2016, à 18:12

Didier-T
Réponses : 1 634

Bonjour,
Dans la ligne ajouté remplacez le > par un ==
Bien les deux signes égales.

Sa devrait coller ;-)

#18 Re : -1 »  [5] Conky : Postez vos conkyrc ou certaines parties intéressantes » Le 19/08/2016, à 15:18

Didier-T
Réponses : 1 634

Bonjour,

if hours_mins >= 12 then hours_mins=hours_mins-12 end

il y a une légère modification wink

@loutch,
je n'ai pas de solution toute prête pour toi, mais a ta place je regarderai le retour de ses commandes conky et radiotray lancés et conky et radiotray fermés, a mon avis le souci est a ce niveau.

pgrep -f /home/$USER/.conky/radiotray/conkyrc
pgrep -f "usr/bin/radiotray"

#19 Re : -1 »  [Conky] Alternative à weather.com (3) » Le 28/07/2015, à 05:56

Didier-T
Réponses : 1 454

Bonjour loutch,
le soucis est certainement dans le fichier "/tmp/conky_meteo.txt"
Il n'ait créé que si le conky est exécuté.
Si tu pouvais en copier le contenu, merci.

A+,
Didier.

P.S. : je viens de regarder la capture d'écran, j'y vois des température, mais certainement fausse, a moins que ce soit l'hiver cher toi wink

#21 Re : -1 »  [Conky] Alternative à weather.com (3) » Le 03/10/2015, à 11:12

Didier-T
Réponses : 1 454

Bonjour Yvance,
tu n'est simplement pas a jour tongue

voici le retour cher moi, pour info ma connexion est saturée actuellement cool

conky -c conkyrc 
Conky: desktop window (e00003) is subwindow of root window (256)
Conky: window type - desktop
Conky: drawing to created window (0x4800002)
Conky: drawing to double buffer
[INFO] ~/.conky/conky-meteo/meteo6jours/meteo.cfg
	version = v1.15
	web = http://www.accuweather.com/fr/fr/argenteuil/133593/weather-forecast/133593
	Pévision Nb jours = 7 
	Pévision Matin = non
	Pévision Après Midi = non
	Pévision Soirée = non
	Pévision Nuit = non
	Prévision sur 8 heures = non
	nbFoisHuit= 1
	Délais = 15
	Chemin de travail = /tmp
	Palier = 20
	Chemin de sauvegarde = /home/didier/.conky/conky-meteo/meteo6jours/reptravail
	Chemin script = /usr/bin
	Notification = non
	ID = 14040
[ OK ] Condition courante
[ OK ] Prévision 1
[ OK ] Prévision 2
[ OK ] Prévision 3
[ OK ] Prévision 4
[ OK ] Prévision 5
[ OK ] Prévision 6
[ OK ] Prévision 7
[INFO] Recmeteo Version = 1.31d
[ OK ] Jour 1
[ OK ] Jour 2
[ OK ] lunaison
[ OK ] Jour 3
[ OK ] Jour 4
[ OK ] Jour 5
[ OK ] Jour 6
[ OK ] Jour 7
[ OK ] CC
[ OK ] mise a jour en : 73.10455322265625
[ OK ] Condition courante
[ OK ] Prévision 1
[ OK ] Prévision 2
[ OK ] Prévision 3
[ OK ] Prévision 4
[ OK ] Prévision 5
[ OK ] Prévision 6
[ OK ] Prévision 7

Météolua version 1.15
Recmeteo version 1.31b

A+,
Didier.

#22 Re : -1 »  [Conky] Alternative à weather.com (3) » Le 04/10/2015, à 11:35

Didier-T
Réponses : 1 454

Bonjour Yvance,
peut tu me donner le contenu de ton conkyrc.

A+,
Didier.

#23 Re : -1 »  [Conky] Alternative à weather.com (3) » Le 06/10/2015, à 09:28

Didier-T
Réponses : 1 454

Bonjour Yvance,
le soucis est ici

lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua

en fait il ne pointe pas vers le bon fichier, le chemin a changé depuis l'ajout des packs DEB
il faut remplacer par ceci

lua_load /usr/bin/meteo2.lua

A+,
Didier.

#24 Re : -1 »  [Conky] Alternative à weather.com (3) » Le 22/11/2015, à 14:15

Didier-T
Réponses : 1 454

Bonjour a tous,
j'ai reçus un email hier matin de Yvance77, me signalant le soucis que vous rencontriez avec meteo lua.
Les notifications du site n'avaient pas fonctionnées, ou étaient passées en spam ???

le pack est corrigé mais certaines informations sont devenus trop chiante à extraire.
dans condition courante le vent n'est plus renseigné il y a des valeurs bidon a la place 0 km/h et direction Nord.

le soucis que je rencontre est qu'ils ont fait pleins de modification sur le site accuweather et ceci sur plusieurs page, tout est géré sauf sur la page de condition courante la direction du vent n'est simplement plus renseignée hmm, et la vitesse du vent est placé dans un coins étrange, rendant son extraction difficile. N'ayant pas beaucoup de temps libre en ce moment je ne me pencherais pas trop sur ce soucis, si certains ont des idées pour récupérer les informations qu'ils n’hésite pas big_smile

A+,
Didier.