@Didier-T
conkyrc-baro
#Fonctionnement de conky
total_run_times 0 #Temps en secondes ; 0 = toujours actif
background yes #Pour que conky tourne en arrière plan ; no = pour les tests
#Réglages système
cpu_avg_samples 1 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
net_avg_samples 2 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
#Mémoire
double_buffer yes #Éviter le clignotement
no_buffers yes #Soustraire les mémoires tampons de la mémoire utilisée
text_buffer_size 2048 #Taille du cache pour le texte
#Affichage
out_to_console no #Affiche le texte sur la sortie standard
update_interval 1 #Taux de rafraîchissement de la fenêtre (s)
#Fenêtre conky
#alignment top_left #Alignement
#---
minimum_size 350 100 #Taille minimum (px) ; largeur / hauteur
maximum_width 900 200 #Largeur maximum (px)
#---
gap_x 480 #Écart avec le bord gauche / droit
gap_y 570 #Écart avec le bord haut / bas
#---
draw_shades no #Afficher les ombres
draw_outline no #Afficher les contours de fenêtre
draw_borders no #Afficher des contours autour des blocs de texte
border_width 1 #Largeur du contour
border_margin 1 #Largeur des marges
#---
own_window yes #Utiliser sa propre fenêtre
own_window_type override #Type de fenêtre ; normal / override / desktop
own_window_transparent yes #Pseudo transparence
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#Mise en forme
use_xft yes #Utiliser Xft (polices lissées etc)
xftalpha 1 #Utiliser Xft
override_utf8_locale yes #Force l'UTF8
uppercase no #Tout le texte en majuscule
use_spacer right #Ajoute des espaces après certains objets (qu'avec des polices fixes)
#---
xftfont saxMono:size=9 #Police par défaut
#---
default_bar_size 360 3 #Barre par défaut (longeur hauteur)
stippled_borders 6 #Taille des pointillés
#Couleurs
default_color FFFFFF #Couleur par défaut
default_shade_color 333333 #Couleur des ombres
default_outline_color black #Couleur des contours
#---
color1 242424 #Gris
#---
short_units yes #Unités courtes
pad_percents 2 #Unité à 2 décimales
default_color FFFFFF
color1 D2CBC1
color2 red #red, color of current T°
color3 blue #color of feels like T°
color4 B1ADA7
color5 7B7870
color6 3F3C36
color7 black #text color
# -- Declaration template -- #
template0 ${image ~/conky/script/images/\1 -p \2 -s \3} # -- images fond -- #
template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
template2 ${lua_parse Meteo_\1 \2 \3 \4 60 \5} # -- icones météo -- \2=repertoir icones \3=position \4=taille \5=jour (pour les prévisions) #
template3 ${lua Lune_\1}
lua_load ~/meteo/conky/script/meteo.lua
lua_load ~/conky/Baro/baro.lua
lua_draw_hook_pre main
lua_load ~/conky/Baro/textwriting.lua
lua_draw_hook_post draw_text
TEXT
${template1 Maj http://www.accuweather.com/fr/fr/stiring-wendel/135054 5 1800 /tmp ~/conky}
${font URW Chancery L:style=Bold:size=14}${image /usr/share/conkyforecast/images/weathericons/00.png -s 60x60 -p 10,150}\
${image /usr/share/conkyforecast/images/weathericons/40.png -s 60x60 -p 20,80}\
${image /usr/share/conkyforecast/images/weathericons/09.png -s 60x60 -p 50,30}\
${image /usr/share/conkyforecast/images/weathericons/39.png -s 60x60 -p 120,0}\
${image /usr/share/conkyforecast/images/weathericons/28.png -s 60x60 -p 200,0}\
${image /usr/share/conkyforecast/images/weathericons/30.png -s 60x60 -p 250,40}\
${image /usr/share/conkyforecast/images/weathericons/34.png -s 60x60 -p 270,90}\
${image /usr/share/conkyforecast/images/weathericons/32.png -s 60x60 -p 270,150}
${voffset 120}${color black}${alignc}${template1 Pression}mb
${voffset 70}${font URW Chancery L:style=Bold:size=18}${goto 30}T°${font URW Chancery L:style=Bold:size=12} Actuelle / Ressentis#
${voffset -10}${goto 240}${font URW Chancery L:style=Bold:size=18}T° ${font URW Chancery L:style=Bold:size=12}Nuit
${font URW Chancery L:style=Bold:size=16}${goto 60}${color2}${template1 Jour_Temp 1}°C / ${template1 Jour_TempRes 1}°C
${voffset -30}${goto 260}${color3}${template1 Nuit_Temp 1}°C
baro.lua
--==============================================================================
-- baro.lua
--
-- author : SLK-adapted by shamen456
-- version : v2011-06-13
-- license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='cpu', arg='', max_value=1060, sub_value=960,
x=175, y=150,
graph_radius=60,
graph_thickness=10,
graph_start_angle=235,
graph_unit_angle=2.5, graph_unit_thickness=2.,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.4,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0x000000, hand_fg_alpha=.0,
txt_radius=0,
txt_weight=0, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0,
graduation_radius=50,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=18,
graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.8,
},
{
name='execpi', arg='120 bash ~/conky/conkymeteo/afmeteo pression cc|sed "s/ mb//"|sed "s/,/\./"', max_value=1050, sub_value=950,
x=175, y=150,
graph_radius=30,
graph_thickness=70,
graph_start_angle=255,
graph_unit_angle=2.1, graph_unit_thickness=2.,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.4,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0xFF0000, hand_fg_alpha=.5,
txt_radius=20,
txt_weight=0, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0,
graduation_radius=70,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=18,
graduation_fg_colour=0x4F4B41, graduation_fg_alpha=1,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.8,
},
{
name='execi', arg='120 ~/conky/conkymeteo/afmeteo temp_res cc',
max_value=60, sub_value=-30,--valeur de depart du graphe
x=175, y=200,
graph_radius=20,
graph_thickness=40,
graph_start_angle=75,
graph_unit_angle=2.33, graph_unit_thickness=1.5,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.4,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0xFF0000, hand_fg_alpha=1,
txt_radius=18,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xC0C0FF, txt_fg_alpha=0,
graduation_radius=20,
graduation_thickness=8, graduation_mark_thickness=2,
graduation_unit_angle=11.6,
graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0.6,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='execi', arg='120 ~/conky/conkymeteo/afmeteo temp cc', max_value=60, sub_value=-30,
x=175, y=200,
graph_radius=20,
graph_thickness=40,
graph_start_angle=75,
graph_unit_angle=2.33, graph_unit_thickness=1.5,
graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.,
graph_fg_colour=0xB1ADA7, graph_fg_alpha=0,
hand_fg_colour=0xED7F77, hand_fg_alpha=1,
txt_radius=30,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xED7F77, txt_fg_alpha=0,
graduation_radius=22,
graduation_thickness=14, graduation_mark_thickness=2,
graduation_unit_angle=23.3,
graduation_fg_colour=0x4F4B41, graduation_fg_alpha=1,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']-data['sub_value']
local sub_value = data['sub_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value-sub_value) % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_gauge_rings(display)
end
end
textwriting.lua
--[[circlewriting by mrpeachy (2010)]]
require 'cairo'
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end
function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2)
end
end
function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end
function conky_draw_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
--circlewriting variable
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=("Tempete - Pluie - Variable - Beau - Tres Sec")
--text=("Stormy - Rain - Change - Fair - Very Dry")
--font name must be in quotes
font="URW Chancery L"
fontsize=15
radius=80
positionx=175
positiony=150
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=-115
finish=115
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewritingdown variables
--mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=(" 0 ")
--font name must be in quotes
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=150
finish=144
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("50")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=268
finish=262
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("40")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=245
finish=239
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("30")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=222
finish=216
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("20")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=199
finish=193
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("10")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=0
colorgreen=0
colorblue=0
coloralpha=1
start=176
finish=170
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("-10")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=134
finish=124
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
text=("-20")
font="URW Chancery L"
fontsize=12
radius=45
positionx=175
positiony=200
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=112
finish=99
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
[[--circlewritingdown variable
hdd=tonumber(conky_parse('${fs_used_perc /}'))
--text must be in quotes
text=("FILESYS " .. (addzero100(hdd)) .. "%")
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=80
positionx=260
positiony=280
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=180
finish=0
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)]]
[[--circlewriting variables
swap=tonumber(conky_parse('${swapperc}'))
--text must be in quotes
text=("SWAP " .. (addzero100(swap)) .. "% ")
--font name must be in quotes
font="White Rabbit"
fontsize=18
radius=60
positionx=105
positiony=130
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=200
finish=340
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)]]
end
end
conkyrc-pression
#Mémoire
double_buffer yes #Éviter le clignotement
no_buffers yes #Soustraire les mémoires tampons de la mémoire utilisée
text_buffer_size 2048 #Taille du cache pour le texte
#Fonctionnement de conky
total_run_times 0 #Temps en secondes ; 0 = toujours actif
background yes #Pour que conky tourne en arrière plan ; no = pour les tests
#Réglages système
cpu_avg_samples 1 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
net_avg_samples 2 #Nb d'échantillons pour calculer la moyenne d'utilisation CPU
#Affichage
out_to_console no #Affiche le texte sur la sortie standard
update_interval 1 #Taux de rafraîchissement de la fenêtre (s)
#Fenêtre conky
#alignment top_left #Alignement
#---
minimum_size 660 200 #Taille minimum (px) ; largeur / hauteur
maximum_width 410 300 #Largeur maximum (px)
#---
gap_x 520 #Écart avec le bord gauche / droit
gap_y 360 #Écart avec le bord haut / bas
#---
draw_shades no #Afficher les ombres
draw_outline no #Afficher les contours de fenêtre
draw_borders no #Afficher des contours autour des blocs de texte
border_width 1 #Largeur du contour
border_margin 1 #Largeur des marges
#---
own_window yes #Utiliser sa propre fenêtre
own_window_type override #Type de fenêtre ; normal / override / desktop
own_window_transparent yes #Pseudo transparence
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#Mise en forme
use_xft yes #Utiliser Xft (polices lissées etc)
xftalpha 1 #Utiliser Xft
override_utf8_locale yes #Force l'UTF8
uppercase no #Tout le texte en majuscule
use_spacer right #Ajoute des espaces après certains objets (qu'avec des polices fixes)
#---
xftfont saxMono:size=9 #Police par défaut
#---
default_bar_size 360 3 #Barre par défaut (longeur hauteur)
stippled_borders 6 #Taille des pointillés
#Couleurs
default_color FFFFFF #Couleur par défaut
default_shade_color 333333 #Couleur des ombres
default_outline_color black #Couleur des contours
#---
color1 242424 #Gris
#---
short_units yes #Unités courtes
pad_percents 2 #Unité à 2 décimales
default_color FFFFFF
color1 D2CBC1
color2 red #red, color of current T°
color3 blue #color of feels like T°
color4 B1ADA7
color5 7B7870
color6 3F3C36
color7 black #text color
#---
color1 242424 #Gris
TEXT
${voffset -6}${font chopinscript:size=16}${color black}Pression Atmospherique ${execi 120 sed -n 11p /home/claude/conky/conkymeteo/curr_cond}
${if_gw}${execi 1200 bash /home/claude/conky/barograph/barognuplot.sh }${endif}#
${image /home/claude/conky/barograph/graph2.png -s 270x150 -p -10,10 -n}#
${font Verdana:size=7}#
${color black}#
${voffset -5}${goto 10} 40 C${color black}${goto 250}1040mb
${voffset 13}${goto 10} 20 C${color black}${goto 250}1020mb
${voffset 11}${goto 10} 0 C${color black}${goto 250}1000mb
${voffset 13}${goto 10} -20 C${color black}${goto 250} 980mb
${voffset 8}${goto 250} 960mb
barognuplot.sh "courbe graphique
#!/bin/bash
## files
LOG="$HOME/conky/barograph/ListePression2.log"
GRAPH="$HOME/conky/barograph/graph2.png"
## Verifier argument
##Infos generales
DATE=$(date +"%s")
DATE1WEEK=$(date --date="1 week ago" +"%s")
# liste des dates de releve du fichier log
EPOCH=()
while read
do
EPOCH+=( "$REPLY" )
done< <(awk '{print $1}' "$LOG")
# si le fichier existe et contient des valeurs de plus d'une semaine (premiere = plus vieille)
#supprimer premiere valeur
[[ -f $LOG ]] && {
for i in $(seq 0 $(($(wc -l < $LOG)-1)))
do
[[ $DATE1WEEK -gt ${EPOCH[$i]} ]] && sed -i '1d' $LOG || break
done
}
## Conversion en hectopascal et soustraction de la pression moyenne pour ramener l'axe a zero
PR_HP=`sed -n 10p ~/conky/conkymeteo/curr_cond|sed 's/ mb//'|sed 's/,/\./'`
TEMP=`sed -n 2p ~/conky/conkymeteo/curr_cond`
PR_CALC=$(bc << EOF
scale=0
$PR_HP - 1000
EOF
)
echo "$DATE $PR_CALC $TEMP" >> $LOG
gnuplot <<EOF
set terminal png enhanced size 300,170 transparent #font "Ubuntu,10" 400,350
set term png font "Ubuntu,9"
set output "$GRAPH"
unset key
set grid
set xzeroaxis lt 3 lw 2
set yzeroaxis
set ytics ("" -40, "" -20, "" 20, "" 40)
set mxtics 0
set xdata time
set timefmt "%s"
set xtics 86400
set format x "%d"
set style line 1 lw 2
set style line 2 lw 2
plot ["$DATE1WEEK":"$DATE"] [-40:50] "$LOG" using 1:3 with lines ls 2, "$LOG" using 1:2 with lines ls 1
EOF
exit 0
Merci de ton aide