Vos Conky
Postez ici vos conkys ou des petits bouts et demandes d'aide.
Discussions Libres

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
Reprise du message précédent
BonjourUn baromêtre qui utilise les prévisions du conky précédent.
conkyrc
Code :
conky.config = {
background = true,
use_xft = true,
font = 'Bebas Neue Bold:size=12',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
double_buffer = true,
minimum_width = 290, minimum_height = 290,
maximum_width = 290,
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 40,
gap_y = 790,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
-- Taille des pointillés
stippled_borders = 5,
-- Couleurs
default_color = '#ffffff',--ffd579
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = '~/.conky/barometr/loader.lua',
lua_draw_hook_pre = 'loader_lua',
};
conky.text = [[
${lua conky_draw_bg 126 20 18 260 260 0x000000 0.2}
${lua fDrawImage $HOME/conky-openmeteo/Suisse/fond/suite-bgv.png 15 10 270 270}
${execi 1800 bash $HOME/conky-openmeteo/Suisse/suisse.sh}
${execi 3600 cat $HOME/conky-openmeteo/rawdata/rawsuisse | jq --raw-output '.current_condition.wnd_dir' > $HOME/.conky/barometr/dir}
${execi 3600 cat $HOME/conky-openmeteo/rawdata/rawsuisse | jq --raw-output '.current_condition.wnd_spd' > $HOME/.conky/barometr/vit}
${execi 3600 cat $HOME/conky-openmeteo/rawdata/rawsuisse | jq --raw-output '.current_condition.pressure' | awk '{printf("%d\n",$1)}' > $HOME/.conky/barometr/pre}
${execi 3600 cat $HOME/conky-openmeteo/rawdata/rawsuisse | jq --raw-output '.current_condition.humidity' > $HOME/.conky/barometr/hum}
${voffset -200}
]];
le loader.lua
Code :
require 'cairo'
function conky_loader_lua()
usrhome = os.getenv("HOME")
dofile (usrhome .."/.conky/barometr/barometr.lua")
dofile (usrhome .."/.conky/lua/image.lua")
dofile (usrhome .."/.conky/lua/draw_bg.lua")
conky_main_weather()
end
barometr.lua
Code :
--[[ barometr_v.0.1.lua by olgmen 07.12.2010
script displays the weather forecast with http://weather.noaa.gov
Use scripts:
BARGRAPH WIDGET v2.0 by wlourf (12.07.2010)
circlewriting by mrpeachy (2010)
Скрипт выводит прогноз погоды с http://weather.noaa.gov
Использованы скрипты:
BARGRAPH WIDGET v2.0 by wlourf (12.07.2010)
circlewriting by mrpeachy (2010)
]]
require 'cairo'
-- [[ здесь вводятся все параметры ]] --
function conky_main_weather()
weather_settings = { -- ВЫВОД ГРАФИКИ
{ -- фон
sectors = 1,
gap_sectors = -1,
radius = 150,
thickness = 150,
bg_colour1 = {{0, 0x000000, 0.0}}, -- fond du grand cercle
},
{ -- обод
sectors = 1,
gap_sectors = -1,
radius = 0,
thickness = 3,
bg_colour1 = {{0, 0xFFFFFF, 0.7}},
bg_colour2 = {{0, 0x1B1A25, 1},{0.5, 0x7D7D78, 0.9},{1, 0x5D5D78, 0}}, -- grand cercle
},
{ -- фон шкалы барометра
radius = 111,
thickness = 7,
sectors = 1,
fill_sectors = true,
start_angle = -120,
end_angle = 120,
bg_colour1 = {{0, 0xffffff, 0.75}}, -- белый
},
{ -- деления шкалы барометра
radius = 110,
thickness = 5,
sectors = 80,
gap_sectors = 1,
fill_sectors = true,
start_angle = -120,
end_angle = 120,
bg_colour1 = {{0, 0x000000, 1}}, -- черный
},
{ -- деления шкалы термометра
radius = 110,
sectors = 9,
gap_sectors = 21,
start_angle = 125,
end_angle = 235,
bg_colour1 = {{0, 0xffffff, 0.5}}, -- белый
},
{ -- термометр
name = "temperature",
arg = conky_parse('${exec sed -n 1p $HOME/.conky/barometr/temp}'),
max = 80,
radius = 110,
thickness = 9,
sectors = 1,
start_angle = 130,
end_angle = 230,
inverse_arc = true,
cap = "r",
bg_colour1 = {{0.0, 0x999999, 0.0},{0.5, 0x999999, 1.0},{1.0, 0x999999, 0.0}},
fg_colour1 = {{0.0, 0xff0000, 0.0},{0.5, 0xff0000, 1.0},{1.0, 0xff0000, 0.0}},
fg_colour2 = {{0.0, 0x6495ee, 0.0},{0.5, 0x6495ee, 1.0},{1.0, 0x6495ee, 0.0}},
bd_colour1 = {{0.0, 0x00FF00, 1.0},{0.5, 0x00FF0, 1.0},{1.0, 0x00FF00, 1.0}},
},
}
text_settings = { -- ВЫВОД ТЕКСТОВ
{ -- температура
text = "TEMPERATURE " .. conky_parse('${exec sed -n 1p $HOME/conky-openmeteo/Suisse/barographe/temp}') .. "'C",
font_name = "MonogramsToolbox", -- навание шрифта
font_size = 8, -- размер шрифта
bold = true,
inside = true, -- размещение текста против часовой стрелки
start_angle = 233,
end_angle = 135,
radius = 95,
},
{ -- шкала термометра
text = " -40-30-20-10 0 10 20 30 40",
font_name = "URW Chancery L",
font_size = 14,
bold = true,
inside = true,
start_angle = 240,
end_angle = 131,
radius = 125,
},
{ -- погода
text = "Tempete Pluie Variable Beau Tres sec",
font_name = "URW Chancery L",
font_size = 18,
bold = true,
start_angle = 245,
end_angle = 472,
radius = 118,
},
{ -- давление в мм ртутного столба
text = "PRESSION " .. conky_parse('${exec sed -n 1p $HOME/.conky/barometr/pre}') .. "mb",
font_name = "MonogramsToolbox",
font_size = 8,
bold = true,
start_angle = 300,
end_angle = 417,
radius = 90,
},
{ -- направление и скорость ветра
text = "VIT. " .. conky_parse('${exec sed -n 1p $HOME/.conky/barometr/vit}') .. "km/h",
font_name = "MonogramsToolbox",
font_size = 8,
bold = true,
start_angle = 75,
end_angle = 120,
radius = 90,
},
{ -- влажность
text = "HUMIDITE " .. conky_parse('${exec sed -n 1p $HOME/.conky/barometr/hum}') .. "%",
font_name = "MonogramsToolbox",
font_size = 8,
bold = true,
inside = true,
start_angle = 228,
end_angle = 140,
radius = 78,
},
{ -- облачность
text = "DIR. " .. conky_parse('${exec sed -n 1p $HOME/.conky/barometr/dir}'),
font_name = "MonogramsToolbox",
font_size = 8,
bold = true,
start_angle = 240,
end_angle = 275,
radius = 90,
},
}
image_settings = { -- вывод центрального изображения
{
name = os.getenv ('HOME')..'/.conky/barometr/images/wind_rose.png', -- путь к картинке
},
}
needle_settings = { -- вывод стрелок
{
name = "vent", -- направление ветра
arg = conky_parse('${exec sed -n 1p $HOME/.conky/barometr/dir}'),
max = 360,
length_of_arrows = 1.75, -- длина стрелки
width_of_arrows = 6, -- ширина стрелки
},
{ -- давление
name = "pression",
arg = conky_parse('${exec sed -n 1p $HOME/.conky/barometr/pre}'),
max = 80,
start_angle = 242,
end_angle = 480,
length_of_arrows = 2.75,
width_of_arrows = 3,
},
}
----------- END --------------
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
if tonumber(conky_parse('${updates}')) > 1 then
for i in pairs(weather_settings) do
draw_weather_graph(weather_settings[i])
end
for i in pairs(text_settings) do
draw_circle_text(text_settings[i])
end
for i in pairs(image_settings) do
draw_image(image_settings[i])
end
for i in pairs(needle_settings) do
draw_needle_graph(needle_settings[i])
end
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
end
-- -------------------------------------------------
-- функция вывода графики
function draw_weather_graph(t)
-- --------------------------------
-- функция перекодировки цвета
local function rgba_to_r_g_b_a(tcolour)
colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255.,
((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-- ----------------------------------
local function calc_delta(tcol1,tcol2)
--calculate deltas P R G B A to table_colour 1
for x = 1, #tcol1 do
tcol1[x].dA = 0
tcol1[x].dP = 0
tcol1[x].dR = 0
tcol1[x].dG = 0
tcol1[x].dB = 0
if tcol2~=nil and #tcol1 == #tcol2 then
local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
tcol1[x].dR = (r2-r1)/t.sectors
tcol1[x].dG = (g2-g1)/t.sectors
tcol1[x].dB = (b2-b1)/t.sectors
tcol1[x].dA = (a2-a1)/t.sectors
end
end
return tcol1
end
-- --------------------------------------------
local function draw_scale (x, y, radius, max)
local i = 0
local winkel = math.rad(3)
cairo_set_source_rgba(cr,1,1,1,1)
for i = 0, max/2 - 1, 1 do
cairo_set_line_width(cr,1)
cairo_move_to(cr, x -radius- math.sin(winkel*i)*radius, y-radius - math.cos(winkel*i)*radius)
cairo_line_to(cr, x-radius - math.sin(winkel*i)*(radius*0.9), y-radius-math.cos(winkel*i)*(radius*0.9))
cairo_stroke(cr)
end
end
-- -------------------------------------------
--check values
local function setup(t)
-- сохраняем данные и настройки
cairo_save(cr)
-- установки по умолчанию
if t.name == nil then t.name= "" end
if t.arg == nil then t.arg = "" end
if t.max == nil then t.max = 100 end
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.height == nil then t.height = conky_window.width end
if t.width == nil then t.width = conky_window.width end
if t.radius == nil then t.radius = (conky_window.width/2)*0.9 end
if t.start_angle == nil then t.start_angle=0 end
if t.end_angle == nil then t.end_angle = 360 end
if t.thickness == nil then t.thickness = 10 end
if t.sectors == nil then t.sectors = 10 end
if t.gap_sectors == nil then t.gap_sectors = 1 end
if t.fill_sector == nil then t.fill_sector = false end
if t.sectors == 1 then t.fill_sector = false end
if t.border_size == nil then t.border_size = 0 end
if t.cap == nil then t.cap = "p" end
-- цвет фона
if t.bg_colour1 == nil then
t.bg_colour1 = {{0, 0x00ffff, 0.1},{0.5, 0x00FFFF, 0.5},{1, 0x00FFFF, 0.1}}
end
-- цвет параметра
if t.fg_colour1 == nil then
t.fg_colour1 = {{0, 0x00FF00, 0.1},{0.5, 0x00FF00, 1},{1, 0x00FF00, 0.1}}
end
-- цвет окантовки
if t.bd_colour1 == nil then
t.bd_colour1 = {{0, 0xFFFF00, 0.5},{0.5, 0xFFFF00, 1},{1, 0xFFFF00, 0.5}}
end
-- проверяем соотношение ширины кольца и радиуса
if t.thickness > t.radius then t.thickness = t.radius*0.1 end
t.int_radius = t.radius - t.thickness
-- проверяем данные углов
if t.start_angle >= t.end_angle then
local tmp_angle = t.end_angle
t.end_angle = t.start_angle
t.start_angle = tmp_angle
-- print ("inversed angles")
if t.end_angle-t.start_angle > 360 and t.start_angle > 0 then
t.end_angle = 360 + t.start_angle
print ("reduce angles")
end
if t.end_angle + t.start_angle > 360 and t.start_angle <= 0 then
t.end_angle = 360 + t.start_angle
print ("reduce angles")
end
if t.int_radius < 0 then t.int_radius = 0 end
if t.int_radius > t.radius then
local tmp_radius = t.radius
t.radius = t.int_radius
t.int_radius = tmp_radius
print ("inversed radius")
end
if t.int_radius == t.radius then
t.int_radius = 0
print ("int radius set to 0")
end
end
-- проверка таблиц цвета
for i = 1, #t.bg_colour1 do
if #t.bg_colour1[i] ~= 3 then t.bg_colour1[i] = {1, 0xFFFFFF, 0.5} end
end
for i = 1, #t.fg_colour1 do
if #t.fg_colour1[i] ~= 3 then t.fg_colour1[i] = {1, 0xFF0000, 1} end
end
for i = 1, #t.bd_colour1 do
if #t.bd_colour1[i] ~= 3 then t.bd_colour1[i] = {1, 0xFFFF00, 1} end
end
if t.bg_colour2 ~= nil then
for i = 1, #t.bg_colour2 do
if #t.bg_colour2[i] ~= 3 then t.bg_colour2[i] = {1, 0xFFFFFF, 0.5} end
end
end
if t.fg_colour2 ~= nil then
for i = 1, #t.fg_colour2 do
if #t.fg_colour2[i] ~= 3 then t.fg_colour2[i] = {1, 0xFF0000, 1} end
end
end
if t.bd_colour2 ~= nil then
for i = 1, #t.bd_colour2 do
if #t.bd_colour2[i] ~= 3 then t.bd_colour2[i] = {1, 0xFFFF00, 1} end
end
end
t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
end
setup(t)
--initialize cairo context
cairo_save(cr)
cairo_translate(cr, t.x, t.y)
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
--get value
local value = 0
-- --------------------------------------------- обработка вывода температуры
if t.name == "temperature" then t.name = "" end
-- -------------------------------------------------------------------------
if t.name ~= "" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
--initialize sectors
--angle of a sector :
angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
--value of a sector :
valueA = t.max/t.sectors
--first angle of a sector :
lastAngle = t.start_angle*math.pi/180
local function draw_sector(type_arc,angle0,angle,valpc, idx)
--this function draws a portion of arc
--type of arc, angle0 = strating angle, angle= angle of sector,
--valpc = percentage inside the sector, idx = sctor number #
if type_arc=="bg" then --background
if valpc==1 then return end
tcolor=t.bg_colour1
elseif type_arc=="fg" then --foreground
if valpc==0 then return end
tcolor=t.fg_colour1
elseif type_arc=="bd" then --border
tcolor=t.bd_colour1
end
--angles equivalents to gap_sector
local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))
--angles of arcs
local ext_angle=(angle-ext_delta*2)*valpc
local int_angle=(angle-int_delta*2)*valpc
--define colours to use for this sector
if #tcolor==1 then
--plain color
local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
vG+tcolor[1].dG*idx,
vB+tcolor[1].dB*idx,
vA+tcolor[1].dA*idx )
else
--radient color
local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
for i=1, #tcolor do
local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
cairo_pattern_add_color_stop_rgba (pat,
vP+tcolor[i].dP*idx,
vR+tcolor[i].dR*idx,
vG+tcolor[i].dG*idx,
vB+tcolor[i].dB*idx,
vA+tcolor[i].dA*idx )
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end
--start drawing
cairo_save(cr)
--x axis is parrallel to start of sector
cairo_rotate(cr,angle0-math.pi/2)
local ri,re = t.int_radius ,t.radius
--point A
local angle_a
if t.cap == "p" then
angle_a = int_delta
if t.inverse_arc and type_arc ~="bg" then
angle_a = angle-int_angle-int_delta
end
if not(t.inverse_arc) and type_arc =="bg" then
angle_a = int_delta+int_angle
end
else --t.cap=="r"
angle_a = ext_delta
if t.inverse_arc and type_arc~="bg" then
angle_a = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_a = ext_delta+ext_angle
end
end
local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)
--point B
local angle_b = ext_delta
if t.cap == "p" then
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
else
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
end
local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)
-- EXTERNAL ARC B --> C
if t.inverse_arc then
if type_arc=="bg" then
b0,b1= ext_delta, angle-ext_delta-ext_angle
else
b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
end
else
if type_arc=="bg" then
b0,b1= ext_delta+ext_angle, angle-ext_delta
else
b0,b1= ext_delta, ext_angle+ext_delta
end
end
---POINT D
local angle_c
if t.cap == "p" then
angle_d = angle-int_delta
if t.inverse_arc and type_arc=="bg" then
angle_d = angle-int_delta-int_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d=int_delta+int_angle
end
else
angle_d = angle-ext_delta
if t.inverse_arc and type_arc=="bg" then
angle_d =angle-ext_delta-ext_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d = ext_angle+ext_delta
end
end
local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
-- INTERNAL ARC D --> A
if t.cap=="p" then
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-int_delta-int_angle,int_delta
else
d0,d1= angle-int_delta, angle- int_angle-int_delta
end
else
if type_arc=="bg" then
d0,d1= angle-int_delta, int_delta+int_angle
else
d0,d1= int_delta+int_angle, int_delta
end
end
else
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-ext_delta-ext_angle,ext_delta
else
d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
end
else
if type_arc=="bg" then
d0,d1= angle-ext_delta,ext_delta+ext_angle
else
d0,d1= ext_angle+ext_delta, ext_delta
end
end
end
--draw sector
cairo_move_to(cr,ax,ay)
cairo_line_to(cr,bx,by)
cairo_arc(cr,0,0,re,b0,b1)
cairo_line_to(cr,dx,dy)
cairo_arc_negative(cr,0,0,ri,d0,d1)
cairo_close_path (cr);
--stroke or fill sector
if type_arc=="bd" then
cairo_set_line_width(cr,t.border_size)
cairo_stroke(cr)
else
cairo_fill(cr)
end
cairo_restore(cr)
end
--draw sectors
local n0,n1,n2 = 1,t.sectors,1
if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
local index = 0
for i = n0,n1,n2 do
index = index +1
local valueZ=1
local cstA, cstB = (i-1),i
if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
if value>valueA *cstA and value<valueA*cstB then
if not t.fill_sector then
valueZ = (value-valueA*cstA)/valueA
end
else
if value<valueA*cstB then valueZ=0 end
end
local start_angle= lastAngle+(i-1)*angleA
if t.foreground ~= false then
draw_sector("fg",start_angle,angleA,valueZ, index)
end
if t.background ~= false then
draw_sector("bg",start_angle,angleA,valueZ, i)
end
if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
end
cairo_restore(cr)
end
--[[END OF RING-SECTORS WIDGET]]
-- -----------------------------------------------------------------------
-- [[ TEXT ]] --
-- функция добавления незначащих нулей
function addzero100(num)
if tonumber(num) == nil then return end --tonumber(num) == 0 end
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 rgb_to_r_g_b2(tcolour)
colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-- ----------------------------------
function calc_delta(tcol1,tcol2)
--calculate deltas P R G B A to table_colour 1
for x = 1, #tcol1 do
tcol1[x].dA = 0
tcol1[x].dP = 0
tcol1[x].dR = 0
tcol1[x].dG = 0
tcol1[x].dB = 0
if tcol2~=nil and #tcol1 == #tcol2 then
local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
tcol1[x].dR = (r2-r1)/t.sectors
tcol1[x].dG = (g2-g1)/t.sectors
tcol1[x].dB = (b2-b1)/t.sectors
tcol1[x].dA = (a2-a1)/t.sectors
end
end
return tcol1
end
-- --------------------------------------------
function draw_circle_text(t)
-- проверка вводимых параметров и установка параметров по умолчанию
if t.text == nil then t.text = "Conky c'est pour pour le moral !" end
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.radius == nil then t.radius = (conky_window.width/2)*0.9 end
if t.font_name == nil then t.font_name = "Free Sans" end
if t.font_size == nil then t.font_size = 14 end
if t.start_angle == nil then t.start_angle = 120 end
if t.end_angle == nil then t.end_angle = 240 end
if t.italic == nil then t.italic = false end
if t.oblique == nil then t.oblique = false end
if t.bold == nil then t.bold = false end
if t.inside == nil then inside = nil end
if t.align == nil then t.align = 0 end
local slant = CAIRO_FONT_SLANT_NORMAL
local weight =CAIRO_FONT_WEIGHT_NORMAL
if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
cairo_select_font_face(cr, t.font_name, slant,weight)
local inum = string.len(t.text)
if t.inside ~= nil then
deg = (t.start_angle - t.end_angle)/(inum - 1)
else
range = t.end_angle
deg = (t.end_angle - t.start_angle)/(inum-1)
end
degrads = 1*(math.pi/180)
local textcut = string.gsub(t.text, ".", "%1@@@")
texttable = string.split(textcut, "@@@")
for i = 1, inum do
ival = i
if t.inside ~= nil then
interval = (degrads*(t.start_angle - (deg*(i - 1)))) + t.align
interval2 = degrads*(t.start_angle - (deg*(i - 1)))
else
interval = (degrads*(t.start_angle + (deg*(i - 1)))) + t.align
interval2 = degrads*(t.start_angle + (deg*(i - 1)))
end
txs = 0 + t.radius*(math.sin(interval))
tys = 0 - t.radius*(math.cos(interval))
cairo_set_font_size (cr, t.font_size)
cairo_set_source_rgba(cr, 1, 1, 1, 1)
cairo_move_to (cr, txs + t.x, tys + t.y)
if t.inside ~= nil then
cairo_rotate (cr, interval2 + (180*math.pi/180))
else
cairo_rotate (cr, interval2)
end
cairo_show_text (cr, (texttable[i]))
if t.inside ~= nil then
cairo_rotate (cr, -interval2 - (180*math.pi/180))
else
cairo_rotate (cr, -interval2)
end
end
end
-- ---------------------------------
function draw_image(t)
-- --------------------------------
-- установки по умолчанию
if t.name == nil then t.name= "" end
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.height == nil then t.height = conky_window.width end
if t.width == nil then t.width = conky_window.width end
-- создаём имидж изображения
image_bg = cairo_image_surface_create_from_png (t.name)
-- забираем данные о ширине и высоте изображения из образа
w1 = cairo_image_surface_get_width (image_bg)
h1 = cairo_image_surface_get_height (image_bg)
-- выводим изображение
cairo_set_source_surface (cr, image_bg, t.x - w1/2, t.y - h1/2)
cairo_paint (cr)
cairo_surface_destroy (image_bg)
end
-- --------------------------------------------------
function draw_needle_graph (t)
-- установки по умолчанию
if t.name == nil then t.name= "time" end
if t.arg == nil then t.arg = "%S" end
if t.max == nil then t.max = 60 end
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.radius == nil then t.radius = 100 end
if t.start_angle == nil then t.start_angle = 0 end
if t.end_angle == nil then t.end_angle = 360 end
if t.width_of_arrows == nil then t.width_of_arrows = 2 end
if t.length_of_arrows == nil then t.length_of_arrows = 2.2 end
if t.name == "vent" then
if t.arg == "S" then t.arg = 180.0 end
if t.arg == "NNE" then t.arg = 202.5 end
if t.arg == "SO" then t.arg = 225.0 end
if t.arg == "ENE" then t.arg = 247.5 end
if t.arg == "O" then t.arg = 270.0 end
if t.arg == "ESE" then t.arg = 292.5 end
if t.arg == "NO" then t.arg = 315.0 end
if t.arg == "SSE" then t.arg = 337.5 end
if t.arg == "N" then t.arg = 360.0 end
if t.arg == "SSO" then t.arg = 22.5 end
if t.arg == "NE" then t.arg = 45.0 end
if t.arg == "OSO" then t.arg = 67.5 end
if t.arg == "E" then t.arg = 90.0 end
if t.arg == "ONO" then t.arg = 112.5 end
if t.arg == "SE" then t.arg = 135.0 end
if t.arg == "NNO" then t.arg = 157.5 end
end
value = tonumber(conky_parse(t.arg))
if value == nil then value = 0 end
-- начальный угол
local sa = t.start_angle * (math.pi / 180)
-- конечный угол
local ea = t.end_angle * (math.pi / 180)
-- расчет угла движения стрелки
gamma = math.pi/2-math.atan(t.width_of_arrows/(t.radius*t.length_of_arrows))
arc = ((ea - sa)/t.max)* value + sa
arc0=arc-gamma
arc1=arc+gamma
xx = t.x + t.radius*math.sin(arc)*t.length_of_arrows
yy = t.y - t.radius*math.cos(arc)*t.length_of_arrows
x0 = t.x + t.width_of_arrows*math.sin(arc0)
y0 = t.y - t.width_of_arrows*math.cos(arc0)
x1 = t.x + t.width_of_arrows*math.sin(arc1)
y1 = t.y - t.width_of_arrows*math.cos(arc1)
cairo_set_line_width(cr,1)
cairo_set_source_rgba(cr, 0, 0, 0, 0.5)
-- рисуем стрелку
-- dessiner une flèche
cairo_move_to (cr, x0, y0)
cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
cairo_arc(cr, t.x, t.y, t.width_of_arrows, arc1, arc0)
pat = cairo_pattern_create_radial (t.x, t.y, t.radius/10, t.x, t.y, t.radius*t.length_of_arrows)
if t.name == "vent" then
-- для ветра устанавливаем цвет синий переходящий в красный (не очень заметно)
--régler la couleur du vent de bleu à rouge (pas très visible)
cairo_pattern_add_color_stop_rgba (pat, 0.6, 0.4, 0.6, 0.9, 0.8) --bleu
cairo_pattern_add_color_stop_rgba (pat, 0.6, 1, 1, 0.8, 1) --rouge
else
-- для давления красный
-- pour la pression rouge
cairo_pattern_add_color_stop_rgba (pat, 0, 0.8, 0, 0, 0.8)
cairo_pattern_add_color_stop_rgba (pat, 1, 1, 0, 0, 1) -- rouge
end
cairo_set_source (cr, pat)
cairo_fill (cr)
cairo_pattern_destroy (pat)
end
--[[ Немного поясню, из чего состоит строка
cairo_pattern_add_color_stop_rgba (pat, 1, 1, 0, 0, 0.5)
цифры означают: 1- слой, 1-красный, 0-зеленый, 0-синий, 0.5-насыщенность
слой имеет значения от 0 до 1]]--
--[[[ Je vais expliquer un peu en quoi consiste la chaîne de caractères
cairo_pattern_add_color_stop_rgba (pat, 1, 1, 0, 0, 0.5)
les nombres signifient : 1-couche, 1-rouge, 0-vert, 0-bleu, 0,5-saturation
la couche a des valeurs de 0 à 1]]--.

@+
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
Tout ça donne ceci

@+
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

HerbertP Membre non connecté
-
- Voir le profil du membre HerbertP
- Inscrit le : 25/06/2015
- Groupes :

Le mien est beaucoup beaucoup plus simple, et purement utilitaire : voir, à la température des processeurs, s'il faut passer l'aspirateur dans les radiateurs :

Code TEXT :
# modif perso couleurs et position, plus rien à voir avec l'exemple original # ********************************************************************** # "CPU Panel (4-core)" theme for Conky by Tony George (teejee2008@gmail.com) # # Webpage: http://teejeetech.blogspot.in/ # ********************************************************************** background yes double_buffer yes alignment bottom_right border_width 1 cpu_avg_samples 2 default_color white default_outline_color white default_shade_color white draw_borders no draw_graph_borders yes draw_outline no draw_shades no gap_x 20 gap_y 55 net_avg_samples 2 no_buffers yes out_to_console no out_to_stderr no extra_newline no own_window yes own_window_type normal own_window_transparent no own_window_colour 000000 own_window_argb_visual yes own_window_argb_value 76 own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager minimum_size 330 120 stippled_borders 0 update_interval 1.0 uppercase no use_spacer none show_graph_scale no show_graph_range no use_xft yes xftalpha 0.1 xftfont Droid Sans:size=12 color0 CFD4D0 #ecume color1 ADA080 #sable clair color2 57604b #vert medit color3 555555 #grey TEXT ${color1}TEMPERATURES ${color2}Capteur ${color1} ${goto 90} Core1 ${goto 150} Core2 ${goto 210} Core3 ${goto 270} Core4 ${goto 330}NVIDIA ${color2}Valeur ${color1} ${goto 90} ${platform coretemp.0/hwmon/hwmon1 temp 1}° ${goto 150} ${platform coretemp.0/hwmon/hwmon1 temp 2}° ${goto 210} ${platform coretemp.0/hwmon/hwmon1 temp 3}° ${goto 270} ${platform coretemp.0/hwmon/hwmon1 temp 4}° ${color1}ACTIVITE PROCESSEURS ${color2}Processeur ${color1} ${goto 90} CPU1 ${goto 150} CPU2 ${goto 210} CPU3 ${goto 270} CPU4 ${goto 330}NVIDIA ${color2}Activité ${color1} ${goto 90} ${cpu cpu1}% ${goto 150} ${cpu cpu2}% ${goto 210} ${cpu cpu3}% ${goto 270} ${cpu cpu4}%
J'ai lu, et aussi vu, qu'il fallait utiliser des [[ et des ]] pour encadrer la partie TEXT et mettre des virgules en fin de lignes, or chez moi je n'ai ni l'un ni l'autre, et le conky fonctionne. C'est pour une compatibilité entre versions ?
J'ai eu un peu de mal à localiser les capteurs de température, j'ai trouvé la solution vers le milieu de cette discussion, merci à vous. Il faut encore que je fasse la même chose pour la NVidia, mais ça ne doit pas être sorcier.
Heureux de contribuer à mon humble niveau

Christophe - Probablement sur une autre planète
Mageia 9 - 64 bit - 4 * Intel Core i5-4460 CPU @ 3.20GHz - Mem 7,7 Gio - GeForce GTX 1050 Ti/PCIe/SSE2
Mageia 9 - 64 bit - 4 * Intel Core i5-4460 CPU @ 3.20GHz - Mem 7,7 Gio - GeForce GTX 1050 Ti/PCIe/SSE2

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :
Je suis intéressé par un conky mais moi je ne connais rien en programmation ...
J'ai pompé ceci :
Code TEXT :
Kernel: ${color white}$kernel #Utilisation moyenne des 2 cores #${color red}${cpugraph cpu0} ${color white}Core 1 $alignr Core 2 ${color red}${cpugraph cpu1 25,120} $alignr${cpugraph cpu2 25,120} ${color white} FREQUENCES % d'utilisation Frequence totale: ${color FF8000}${freq_g}Ghz ${color white}${cpu cpu0}% ${color red}${alignr}${cpubar cpu0 5,50} ${color white}Frequence (Core 1): ${color FF8000}${freq_g cpu1}Ghz ${color white}${cpu cpu1}% ${color red}${alignr}${cpubar cpu1 5,50} ${color white}Frequence (Core 2): ${color FF8000}${freq_g cpu2}Ghz ${color white}${cpu cpu2}% ${color red}${alignr}${cpubar cpu2 5,50} ... ${color white} MACHINE: ${color white}Vitesse ventilateur processeurs: ${color FF8000}${hwmon 0 fan 1} RPM ${color}Temperature CPU 1: ${color FF8000}${hwmon 0 temp 1}°C ${color}Temperature CPU 2: ${color FF8000}${hwmon 0 temp 2}°C ${color}Temperature carte graphique: ${color FF8000}${exec nvidia-settings -q GPUCoreTemp -t}°C ${color white}Temperature disque dur: ${color FF8000}${execi 10 hddtemp -n /dev/sda}°C ${color3}RESEAU: ${hr}${color2} ${color3}${alignc}Adresse Ip eth0 : ${color FF8000}${addr eth0}${color2} ${color3}Down:${color2} ${totaldown eth0}${goto 120}${downspeedf eth0}k/s ${color3}Up:${color2} ${totalup eth0}${goto 120}${upspeedf eth0}k/s ${downspeedgraph eth0 25,120 ffc11f 8b4b0b}$alignr${upspeedgraph eth0 25,120 ffc11f 8b4b0b} ${voffset -28}${goto 50}DOWN${goto 190}UP
Mais cela a besoin d'adaptations :
J'ai un processeur i3 3320 donc 2 cores 4 threads.
Est-ce que c'est bon où il faut modifier pour avoir 4 CPU aussi bien pour l'utilisation que pour la température? que dois-je mettre ?
Pour la carte graphique, j'ai un chipset intel et une carte graphique ATI.
Est-il possible d'avoir l'utilisation des 2 cartes graphiques ?
Que dois-je mettre pour avoir les températures des deux cartes graphiques ?
La partie réseau ne donne rien, je ne sais pas pourquoi.

Merci à ceux qui auront la patience de m'aider.
Édité par scroll44 Le 12/02/2025 à 22h52

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
Ouvre un terminal et lance ça pour voir
Code :
sensors
chez moi
Code :
loutch@RogStrix:~$ sensors
asus-isa-0000
Adapter: ISA adapter
cpu_fan: 2200 RPM
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +50.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +54.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +55.0°C (high = +100.0°C, crit = +100.0°C)
Core 2: +55.0°C (high = +100.0°C, crit = +100.0°C)
Core 3: +52.0°C (high = +100.0°C, crit = +100.0°C)
Core 4: +52.0°C (high = +100.0°C, crit = +100.0°C)
Core 5: +52.0°C (high = +100.0°C, crit = +100.0°C)
BAT0-acpi-0
Adapter: ACPI interface
in0: 15.68 V
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1: N/A
pch_cannonlake-virtual-0
Adapter: Virtual device
temp1: +45.0°C
nvme-pci-0200
Adapter: PCI adapter
Composite: +33.9°C (low = -0.1°C, high = +81.8°C)
(crit = +85.8°C)
acpitz-acpi-0
Adapter: ACPI interface
temp1: +44.0°C (crit = +103.0°C)
4 threads ne veut pas forcement dire 4 sondes.
@+
Édité par loutch Le 13/02/2025 à 09h19
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :
Code TEXT :
$ sensors coretemp-isa-0000 Adapter: ISA adapter Package id 0: +34.0°C (high = +85.0°C, crit = +105.0°C) Core 0: +34.0°C (high = +85.0°C, crit = +105.0°C) Core 1: +27.0°C (high = +85.0°C, crit = +105.0°C) acpitz-acpi-0 Adapter: ACPI interface temp1: +27.8°C temp2: +29.8°C amdgpu-pci-0100 Adapter: PCI adapter vddgfx: 725.00 mV fan1: 1985 RPM (min = 0 RPM, max = 3700 RPM) edge: +28.0°C (crit = +94.0°C, hyst = -273.1°C) PPT: 4.22 W (cap = 125.00 W)

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
Donc il li a bien que deux sondes donc on peut oublier cpu 3 et 4
Tu a une carte amd tout ceux qui se rapporte @ nvidia , a oublier. il faut que fasse des recherches suis en nvidia .
Aussi pour acpitz faire une recherche avec hwmon danc conki
Code :
${hwmon 0 temp 1}
en replaçant le 0 par 1 - 2 - ou 3 et voir si ça matche , pour t'aider regarde dans
/sys/class /hwmon tu aura plusieurs dossiers
Pour internet : eth0 ne fonctionne plus , il faut remplacer par le nom de l'interface.
clic sur l'icone internet dans ta barre puis sur information entre les parenthèses il y à le nom , chez moi "eno2" pour internet et wlo1 pour le wifi.
@+
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Le conky n'est pas de la programmation, je dirais plus du CSS, à priori ça se passe ici:
Code TEXT :
${color white}Frequence (Core 1): ${color FF8000}${freq_g cpu1}Ghz ${color white}${cpu cpu1}% ${color red}${alignr}${cpubar cpu1 5,50} ${color white}Frequence (Core 2): ${color FF8000}${freq_g cpu2}Ghz ${color white}${cpu cpu2}% ${color red}${alignr}${cpubar cpu2 5,50}
Je tenterais de recopier ses deux lignes en incrémentant les numéro des cpu à 3 et 4.
et pareil ici:
Code TEXT :
${color}Temperature CPU 1: ${color FF8000}${hwmon 0 temp 1}°C ${color}Temperature CPU 2: ${color FF8000}${hwmon 0 temp 2}°C
Le Conky ce n'est pas très compliqué, tu peux y aller par tâtonnement, c'est ce que j'avais fait, ça prends un peu de temps.

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :
J'ai bien avancé. Il me reste un problème avec cette ligne :
Code TEXT :
${color}Temperature carte graphique: ${color FF8000}${execi 10 sensors | grep amdgpu-pci-0100 | awk '{print $2:}'}
Je n'arrive pas à faire apparaître la température du GPU. Cela ce joue sur "awk '{print $2:}" je pense mais je n'y arrive pas.
Code TEXT :
$ sensors coretemp-isa-0000 Adapter: ISA adapter Package id 0: +34.0°C (high = +85.0°C, crit = +105.0°C) Core 0: +34.0°C (high = +85.0°C, crit = +105.0°C) Core 1: +27.0°C (high = +85.0°C, crit = +105.0°C) acpitz-acpi-0 Adapter: ACPI interface temp1: +27.8°C temp2: +29.8°C amdgpu-pci-0100 Adapter: PCI adapter vddgfx: 725.00 mV fan1: 1985 RPM (min = 0 RPM, max = 3700 RPM) edge: +28.0°C (crit = +94.0°C, hyst = -273.1°C) PPT: 4.22 W (cap = 125.00 W)

Même problème avec la Fréquence GPU :
Code TEXT :
${color white}Fréquence carte graphique: ${color FF8000} ${alignr}${execi 5 radeontop -d | grep 'GPU' | awk '{print $3}'}
De plus, je ne sais pas quelle information donne la fréquence GPU.

Si vous pouvez m'aider ...
Scroll44.
Édité par scroll44 Le 13/02/2025 à 14h07

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
avant d'aller plus reprend ton post et sur l'image cache ton adresse ip , on ne la montre jamais quelqu'un de mal-vaillant pourrais s'en servir
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :
Pour ce qui est des autres informations, il n'y a que radeontop qui démarre une application et donc ne donne pas une liste d'information. Il n'est donc pas possible d'en extraire les informations.
Ce n'est pas grave, la température du GPU me suffit.
Voilà le résultat :

Le fichier conky :
Code TEXT :
# doivent être installés : lm_sensors, conky, hddtemp background yes use_xft yes xftfont Sans:size=8 xftalpha 1 update_interval 1.0 total_run_times 0 own_window yes own_window_transparent yes own_window_argb_visual yes own_window_type normal own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager double_buffer yes minimum_size 250 800 maximum_width 250 text_buffer_size 4096 draw_shades yes draw_outline no draw_borders no draw_graph_borders yes default_color white default_shade_color black default_outline_color white alignment top_right gap_x 10 gap_y 10 no_buffers yes uppercase no cpu_avg_samples 2 override_utf8_locale yes #white color1 white #white color2 white #white color3 white #blue color4 white #red color5 white # Lua Load # #lua_load ~/.conky/ring.lua #lua_draw_hook_pre clock_rings TEXT Mageia Linux Kernel: ${color white}$kernel #Utilisation moyenne des 2 cores #${color red}${cpugraph cpu0} ${color white}Core 1 $alignr Core 2 ${color red}${cpugraph cpu1 25,120} $alignr${cpugraph cpu2 25,120} ${color white}Core 3 $alignr Core 4 ${color red}${cpugraph cpu3 25,120} $alignr${cpugraph cpu4 25,120} ${color white} FREQUENCES % d'utilisation Frequence totale: ${color FF8000}${freq_g}Ghz ${color white}${cpu cpu0}% ${color red}${alignr}${cpubar cpu0 5,50} ${color white}Frequence (Core 1): ${color FF8000}${freq_g cpu1}Ghz ${color white}${cpu cpu1}% ${color red}${alignr}${cpubar cpu1 5,50} ${color white}Frequence (Core 2): ${color FF8000}${freq_g cpu2}Ghz ${color white}${cpu cpu2}% ${color red}${alignr}${cpubar cpu2 5,50} ${color white}Frequence (Core 3): ${color FF8000}${freq_g cpu3}Ghz ${color white}${cpu cpu3}% ${color red}${alignr}${cpubar cpu3 5,50} ${color white}Frequence (Core 4): ${color FF8000}${freq_g cpu4}Ghz ${color white}${cpu cpu4}% ${color red}${alignr}${cpubar cpu4 5,50} ${color white} MEMOIRE: ${color3}RAM:${color2} $mem/$memmax ${goto 150}$memperc% ${goto 185}${color 00408A}${membar}${color2} ${color3}SWAP:${color2} ${swap} / ${swapmax} ${goto 150} ${swapperc}%${goto 185}${color 00408A}${swapbar} ${color white} MACHINE: ${color white}Vitesse ventilateur processeurs: ${color FF8000}${hwmon 0 fan 1} RPM ${color}Temperature CPU 1: ${color FF8000}${hwmon 0 temp 1}°C ${color}Temperature CPU 2: ${color FF8000}${hwmon 0 temp 2}°C ${color}Temperature carte graphique: ${color FF8000}${execi 10 sensors | grep edge | awk '{ print $2 }'} ${color white}Temperature disque dur: ${color FF8000}${execi 10 hddtemp -n /dev/sda}°C ${color3}RESEAU: ${hr}${color2} ${color3}${alignc}Adresse Ip enp3s0 : ${color FF8000}${addr enp3s0}${color2} ${color3}Down:${color2} ${totaldown enp3s0}${goto 120}${downspeedf enp3s0}k/s ${color3}Up:${color2} ${totalup enp3s0}${goto 120}${upspeedf enp3s0}k/s ${downspeedgraph enp3s0 25,120 ffc11f 8b4b0b}$alignr${upspeedgraph enp3s0 25,120 ffc11f 8b4b0b} ${voffset -28}${goto 50}DOWN${goto 190}UP #${font sans-serif:size=8,weight:bold}${color}IP${alignr}PORT #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 0}${alignr 1}${tcp_portmon 1 65535 rport 0} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 1}${alignr 1}${tcp_portmon 1 65535 rport 1} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 2}${alignr 1}${tcp_portmon 1 65535 rport 2} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 3}${alignr 1}${tcp_portmon 1 65535 rport 3} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 4}${alignr 1}${tcp_portmon 1 65535 rport 4} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 5}${alignr 1}${tcp_portmon 1 65535 rport 5} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 6}${alignr 1}${tcp_portmon 1 65535 rport 6} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 7}${alignr 1}${tcp_portmon 1 65535 rport 7} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 8}${alignr 1}${tcp_portmon 1 65535 rport 8} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 9}${alignr 1}${tcp_portmon 1 65535 rport 9} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}
Merci à tous !
Scroll44

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
En tâtonnant ça marche!
T'as le texte "down" et "up" qui se trouvent mal positionnés en bas

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Guygoye :Le conky n'est pas de la programmation, je dirais plus du CSS
Ah oui ? Ce serait quoi de la programmation, si ce n'est une suite l'instruction pour produire un résultat déterminé ?

Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

scroll44 Membre non connecté
-
- Voir le profil du membre scroll44
- Inscrit le : 24/09/2022
- Groupes :
Bien, après mettre tordu les neurones, j'ai trouvé la solution pour extraire les données de radeontop. J'ai donc maintenant la "charge GPU".
Je vous mets donc la version finale :

Le fichier conky :
Code TEXT :
# doivent être installés : lm_sensors, conky, hddtemp, radeontop # créer un fichier qui va s'appeler .conkyrc à placer dans votre Home # Pour démarrer le conky : ALT + F2 puis conky background yes use_xft yes xftfont Sans:size=8 xftalpha 1 update_interval 1.0 total_run_times 0 own_window yes own_window_transparent yes own_window_argb_visual yes own_window_type normal own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager double_buffer yes minimum_size 250 800 maximum_width 250 text_buffer_size 4096 draw_shades yes draw_outline no draw_borders no draw_graph_borders yes default_color white default_shade_color black default_outline_color white alignment top_right gap_x 10 gap_y 10 no_buffers yes uppercase no cpu_avg_samples 2 override_utf8_locale yes #white color1 white #white color2 white #white color3 white #blue color4 white #red color5 white # Lua Load # #lua_load ~/.conky/ring.lua #lua_draw_hook_pre clock_rings TEXT Mageia Linux Kernel: ${color white}$kernel #Utilisation moyenne des 2 cores #${color red}${cpugraph cpu0} ${color white}Core 1 $alignr Core 2 ${color red}${cpugraph cpu1 25,120} $alignr${cpugraph cpu2 25,120} ${color white}Core 3 $alignr Core 4 ${color red}${cpugraph cpu3 25,120} $alignr${cpugraph cpu4 25,120} ${color white} FREQUENCES % d'utilisation Frequence totale: ${color FF8000}${freq_g}Ghz ${color white}${cpu cpu0}% ${color red}${alignr}${cpubar cpu0 5,50} ${color white}Frequence (Core 1): ${color FF8000}${freq_g cpu1}Ghz ${color white}${cpu cpu1}% ${color red}${alignr}${cpubar cpu1 5,50} ${color white}Frequence (Core 2): ${color FF8000}${freq_g cpu2}Ghz ${color white}${cpu cpu2}% ${color red}${alignr}${cpubar cpu2 5,50} ${color white}Frequence (Core 3): ${color FF8000}${freq_g cpu3}Ghz ${color white}${cpu cpu3}% ${color red}${alignr}${cpubar cpu3 5,50} ${color white}Frequence (Core 4): ${color FF8000}${freq_g cpu4}Ghz ${color white}${cpu cpu4}% ${color red}${alignr}${cpubar cpu4 5,50} ${color}Charge GPU: ${color FF8000} : ${execi 1 radeontop -d - -l 1 | grep gpu | awk '{ print $5}'} ${color white} MEMOIRE: ${color3}RAM:${color2} $mem/$memmax ${goto 150}$memperc% ${goto 185}${color 00408A}${membar}${color2} ${color3}SWAP:${color2} ${swap} / ${swapmax} ${goto 150} ${swapperc}%${goto 185}${color 00408A}${swapbar} ${color white} MACHINE: ${color white}Vitesse ventilateur processeurs: ${color FF8000}${hwmon 0 fan 1} RPM ${color}Temperature CPU 1: ${color FF8000}${hwmon 0 temp 1}°C ${color}Temperature CPU 2: ${color FF8000}${hwmon 0 temp 2}°C ${color}Temperature carte graphique: ${color FF8000}${execi 10 sensors | grep edge | awk '{ print $2 }'} ${color white}Temperature disque dur: ${color FF8000}${execi 10 hddtemp -n /dev/sda}°C ${color3}RESEAU: ${hr}${color2} # ${color3}${alignc}Adresse Ip enp3s0 : ${color FF8000}${addr enp3s0}${color2} ${color3}Down:${color2} ${totaldown enp3s0}${goto 120}${downspeedf enp3s0}k/s ${color3}Up:${color2} ${totalup enp3s0}${goto 120}${upspeedf enp3s0}k/s ${downspeedgraph enp3s0 25,120 ffc11f 8b4b0b}$alignr${upspeedgraph enp3s0 25,120 ffc11f 8b4b0b} ${voffset -28}${goto 50}DOWN${goto 190}UP #${font sans-serif:size=8,weight:bold}${color}IP${alignr}PORT #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 0}${alignr 1}${tcp_portmon 1 65535 rport 0} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 1}${alignr 1}${tcp_portmon 1 65535 rport 1} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 2}${alignr 1}${tcp_portmon 1 65535 rport 2} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 3}${alignr 1}${tcp_portmon 1 65535 rport 3} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 4}${alignr 1}${tcp_portmon 1 65535 rport 4} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 5}${alignr 1}${tcp_portmon 1 65535 rport 5} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 6}${alignr 1}${tcp_portmon 1 65535 rport 6} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 7}${alignr 1}${tcp_portmon 1 65535 rport 7} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 8}${alignr 1}${tcp_portmon 1 65535 rport 8} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 9}${alignr 1}${tcp_portmon 1 65535 rport 9} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13} #${font sans-serif:size=8,weight:normal}${color1}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}
Guygoye :...
T'as le texte "down" et "up" qui se trouvent mal positionnés en bas
C'est fait volontairement !

PS : Cela faisait longtemps que j'avais pas mis mes mains dans du Shell !!!
Édité par scroll44 Le 14/02/2025 à 10h42

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Jybz :Ah oui ? Ce serait quoi de la programmation, si ce n'est une suite l'instruction pour produire un résultat déterminé ?

Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie