Code: Select all
--[[
2023 Bleys
]]
settings_table = {
{
name='cpu', arg='cpu1',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=6, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu2',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=24, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu3',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=42, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu4',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=60, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu5',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=78, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu6',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=96, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu7',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=114, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='cpu', arg='cpu8',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=132, y=250,
width=17, height=60,
bar=1, pos='vertical',
},
{
name='battery_percent', arg='BAT0',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=0.8,
hand_color=0x8B008B, hand_alpha=0.9,
x=10, y=759,
width=140, height=5,
bar=1,
},
{
name='memperc',
arg='',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0x1e90ff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=112, y=300, radius=30,
thickness=7,
start_angle=0, end_angle=270,
typ=1
},
{
name='swapperc',
arg='',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=112, y=300, radius=22,
thickness=7,
start_angle=0, end_angle=270,
typ=1
},
{
name='fs_used_perc',
arg='/home',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=40, y=300, radius=22,
thickness=7,
start_angle=0, end_angle=270,
typ=1
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0x1e90ff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=40, y=300, radius=30,
thickness=7,
start_angle=0, end_angle=270,
typ=1
},
{
name='hwmon k10temp', --find your own sensor for CPU Temperature in /sys/class/hwmon
arg='temp 1',
max=95,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=10, y=350,
thickness=5,
width=140, height=20,
start_angle=15, end_angle=345,
reverse=1, typ=1
},
{
name='hwmon hp', --find your own sensor for Fan in /sys/class/hwmon
arg='fan 1',
max=3500,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=10, y=380,
thickness=5,
width=140, height=20,
start_angle=15, end_angle=345,
reverse=1, typ=1
},
{
name='hwmon amdgpu', --find your own sensor for Vcore in /sys/class/hwmon
arg='in 1',
max=1.5,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=10, y=410,
thickness=5,
width=140, height=20,
start_angle=15, end_angle=345,
reverse=1, typ=1
},
{
name='hwmon nvme', --find your own sensor for SSD Temperature in /sys/class/hwmon
arg='temp 1',
max=90,
bg_color=0xffffff, bg_alpha=0.3,
fg_color=0xffffff, fg_alpha=1.0,
hand_color=0x8B008B, hand_alpha=0.9,
x=10, y=440,
thickness=5,
width=140, height=20,
start_angle=15, end_angle=345,
reverse=1, typ=1
},
}
require 'cairo'
require "imlib2"
require "math"
home_path = os.getenv ('HOME')
function rgb_to_rgba(color,alpha)
return ((color / 0x10000) % 0x100) / 255., ((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end
function draw_bg(cr,color,alpha,typ) -- zeichne Hintergrund Conky Fenster / draw Conky Area Background
local corner_r=0
local bg_color=color
local bg_alpha=alpha
local w=conky_window.width
local h=conky_window.height
cairo_set_source_rgba(cr,rgb_to_rgba(bg_color,bg_alpha))
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
if typ==1 then
cairo_fill(cr)
else
cairo_set_line_width(cr, 3)
cairo_stroke(cr)
end
end
function draw_elipse(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_color'], pt['bg_alpha'], pt['fg_color'], pt['fg_alpha']
local tick, tick_a=pt['hand_color'], pt['hand_alpha']
local dir=pt['reverse']
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)
local width=pt['width']
local height=pt['height']
-- background ring
cairo_save (cr)
cairo_translate (cr, xc + width / 2.0, yc + height / 2.0)
cairo_scale (cr, width / 2.0, height / 2.0)
cairo_arc (cr, 0.0, 0.0, 1.0, angle_0, angle_f)
cairo_restore (cr)
cairo_set_source_rgba(cr,rgb_to_rgba(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
cairo_stroke(cr)
-- indicator ring)
cairo_save (cr)
cairo_translate (cr, xc + width / 2.0, yc + height / 2.0)
cairo_scale (cr, width / 2.0, height / 2.0)
if dir==1 then
cairo_arc (cr, 0.0, 0.0, 1.0, angle_0, angle_0+t_arc)
else
cairo_arc (cr, 0.0, 0.0, 1.0,angle_f-t_arc,angle_f)
end
cairo_restore (cr)
cairo_set_source_rgba(cr,rgb_to_rgba(fgc,fga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
-- hand
cairo_save (cr)
cairo_translate (cr, xc + width / 2.0, yc + height / 2.0)
cairo_scale (cr, width / 2.0, height / 2.0)
if dir==1 then
cairo_arc (cr, 0.0, 0.0, 1.0, angle_0+t_arc-0.01, angle_0+t_arc)
else
cairo_arc (cr, 0.0, 0.0, 1.0,angle_f-t_arc,angle_f-t_arc+0.01)
end
cairo_restore (cr)
cairo_set_source_rgba(cr,rgb_to_rgba(tick,tick_a))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
end
function draw_bar(cr,pct,pt)
local bgc, bga, fgc, fga=pt['bg_color'], pt['bg_alpha'], pt['fg_color'], pt['fg_alpha']
local tick, tick_a=pt['hand_color'], pt['hand_alpha']
if pt['pos'] == "vertical" then
local h=pct*pt['height']
-- Background
cairo_rectangle(cr, pt['x'], pt['y'], pt['width'], -pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(bgc,bga))
cairo_fill(cr)
-- Indicator
cairo_rectangle(cr, pt['x'], pt['y'], pt['width'], -h)
cairo_set_source_rgba(cr,rgb_to_rgba(fgc,fga))
cairo_fill(cr)
-- hand
cairo_rectangle(cr, pt['x'], pt['y']-h, pt['width'], -2)
cairo_set_source_rgba(cr,rgb_to_rgba(tick,tick_a))
cairo_fill(cr)
elseif pt['dir'] == "reverse" then
local w=pct*pt['width']
-- Background
cairo_rectangle(cr, pt['x'], pt['y'], -pt['width'], pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(bgc,bga))
cairo_fill(cr)
-- Indicator
cairo_rectangle(cr, pt['x'], pt['y'], -w, pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(fgc,fga))
cairo_fill(cr)
-- hand
cairo_rectangle(cr, pt['x']-w, pt['y'], -2, pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(tick,tick_a))
cairo_fill(cr)
else
local w=pct*pt['width']
-- Background
cairo_rectangle(cr, pt['x'], pt['y'], pt['width'], pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(bgc,bga))
cairo_fill(cr)
-- Indicator
cairo_rectangle(cr, pt['x'], pt['y'], w, pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(fgc,fga))
cairo_fill(cr)
-- hand
cairo_rectangle(cr, pt['x']+w, pt['y'], 2, pt['height'])
cairo_set_source_rgba(cr,rgb_to_rgba(tick,tick_a))
cairo_fill(cr)
end
cairo_stroke (cr)
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_color'], pt['bg_alpha'], pt['fg_color'], pt['fg_alpha']
local tick, tick_a=pt['hand_color'], pt['hand_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)
local dir=pt['rev']
-- Draw background ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_rgba(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
-- Draw indicator ring
if dir==1 then
cairo_arc (cr, xc, yc, ring_r,angle_f-t_arc,angle_f)
else
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
end
cairo_set_source_rgba(cr,rgb_to_rgba(fgc,fga))
cairo_stroke(cr)
-- draw hand
if dir==1 then
cairo_arc(cr,xc,yc,ring_r,angle_f-t_arc,angle_f-t_arc+0.1)
else
cairo_arc(cr,xc,yc,ring_r,angle_0+t_arc-0.1,angle_0+t_arc)
end
cairo_set_source_rgba(cr,rgb_to_rgba(tick,tick_a))
cairo_stroke(cr)
end
function write_text(cr, x, y, text, f)
--write_text(cr, x, y, text, {})
--font attributes (Schriftattribute zuweisen oder default Werte annehmen)
local font=f.font or "Noto Sans"
local size=f.size or 10
local align=f.align or 'l'
local bold=f.bold or false
local ital=f.italic or false
local color=f.color or "0xffffff"
local slant=CAIRO_FONT_SLANT_NORMAL
if ital then slant=CAIRO_FONT_SLANT_ITALIC end
local weight=CAIRO_FONT_WEIGHT_NORMAL
if bold then weight=CAIRO_FONT_WEIGHT_BOLD end
--Text Size (Textgröße für die Plazierung bestimmen.)
local x_a=0
local y_a=0
local te = cairo_text_extents_t:create()
tolua.takeownership(te)
cairo_select_font_face (cr, font, slant, weight)
cairo_set_font_size (cr, size)
cairo_text_extents (cr, text, te)
--Text Position
if align=='c' then
x_a = -(te.width/2+te.x_bearing)
y_a = -(te.height/2+te.y_bearing)
end
if align=='r' then
x_a = -(te.width+te.x_bearing)
--y_a = -(te.height+te.y_bearing)
end
--Schadow 1 Pixel (Schatten für den Text um 1 Pixel versetzt)
cairo_set_source_rgba(cr, rgb_to_rgba(0x000000,1))
cairo_move_to (cr, x+1+x_a, y+1+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
-- Now Text on Top (nun den Text oben drauf)
cairo_set_source_rgba(cr, rgb_to_rgba(color,1))
cairo_move_to (cr, x+x_a, y+y_a)
cairo_show_text (cr, text)
cairo_stroke(cr)
end
function add_network_traffic(iface, up, down, nzeiger)
nzeiger=nzeiger+1
if nzeiger == samples + 1 then nzeiger = 0 end
up[nzeiger] =tonumber(conky_parse(string.format('${%s %s}', 'upspeedf' , iface)))
down[nzeiger]=tonumber(conky_parse(string.format('${%s %s}', 'downspeedf', iface)))
return up, down, nzeiger
end
function draw_network_chart(cr, iface, up, down, nzeiger, x, y, l, h)
cairo_set_line_width(cr, 1)
local _up, _down, _y
local _zeiger = nzeiger + 1
--Grundlinie zeichnen
cairo_set_source_rgba(cr, rgb_to_rgba(0xffffff, 0.2))
cairo_line_to(cr, x, y)
cairo_line_to(cr, x+l, y)
cairo_stroke(cr)
--Maxlinien zeichnen
cairo_set_source_rgba(cr, rgb_to_rgba(0xffffff, 0.6))
cairo_line_to(cr, x, y-h)
cairo_line_to(cr, x+l, y-h)
cairo_stroke(cr)
cairo_line_to(cr, x, y+h)
cairo_line_to(cr, x+l, y+h)
cairo_stroke(cr)
for i = 0, samples, 1
do
if _zeiger > samples then _zeiger = 0 end
if up[_zeiger] == nil then _up=0 else _up=up[_zeiger] end
if _up < 0.1 then _up = 0.1 end
if _up==0 then print(math.log10(_up*10)) end
_y = math.floor(math.log10(_up*10)/6*h)
_x = math.floor(l/samples*i)
cairo_set_source_rgba(cr, rgb_to_rgba(0x04b404, 1))
cairo_line_to(cr, x+_x, y-_y)
_zeiger = _zeiger + 1
end
cairo_stroke(cr)
_zeiger = nzeiger + 1
for i = 0, samples, 1
do
if _zeiger > samples then _zeiger = 0 end
if down[_zeiger] == nil then _down=0 else _down=down[_zeiger] end
if _down < 0.1 then _down = 0.1 end
_y = math.floor(math.log10(_down*10)/6*h)
_x = math.floor(l/samples*i)
cairo_set_source_rgba(cr, rgb_to_rgba(0x0101df, 1))
cairo_line_to(cr, x+_x, y+_y)
_zeiger = _zeiger + 1
end
cairo_stroke(cr)
end
function conky_main()
function mysplit (inputstr, sep)
if sep == nil then
sep = ","
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end
local function fDrawImage(cr,path,xx,yy,ww,hh,arc)
cairo_save (cr)
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)
cairo_translate (cr, xx, yy)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, ww/w_img, hh/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_surface_destroy (img)
collectgarbage ()
cairo_restore (cr)
end
local function setup(cr,pt)
local str=''
local value=0
local elp=pt['reverse']
str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)
value=tonumber(str)
if value == nil then value = 0 end
if value >= pt['max'] then value = pt['max'] end
pct=value/pt['max']
if pt['typ'] == 1 then
if elp==1 then
draw_elipse(cr,pct,pt)
else
draw_ring(cr,pct,pt)
end
else
draw_bar(cr,pct,pt)
end
end
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
wetter = mysplit (conky_parse('${execi 300 sh '..home_path..'/.conky/wetter.sh}')) --1-text, 2-temperatur, 3-wind, 4-luftfeuchtigkeit, 5-icon
if update_num>5 then
color=0x5a5a5a alpha=0.2 typ=1
draw_bg(cr,color,alpha,typ) -- Funktion Hintergrund Conky Bereich / Function Backgrounds Conky Area
color=0xffffff alpha=0.8 typ=2
for i in pairs(settings_table) do
setup(cr,settings_table[i])
end
-- Wetter
write_text(cr, 35,44,wetter[2].."°C", {font="Arial Black", bold=false, size=16, align="c"})
fDrawImage(cr,home_path..'/.conky/wettericons/'..wetter[5]..'.png',108,50,70,48) --(cr,path,xx,yy,ww,hh,arc)
write_text(cr, 76,26,wetter[1], {align="c", size=9}) --Text
write_text(cr, 10,85,'rF: '..wetter[4].."%", {align="l", size=9})
write_text(cr, 145,85,'Wind: '..wetter[3].."m/s", {align="r", size=9})
write_text(cr, 10,66," ", {font="FontAwesome", size=10, align="l"})
write_text(cr, 22,66,wetter[8], {font="Arial", bold=false, size=10, align="l"}) --zuletzt aktualisiert
write_text(cr, 10, 103, "A", {font="Weather", size=18, align="l"})
write_text(cr, 24, 100, wetter[6], {size=10, align="l"})
write_text(cr, 132, 100, wetter[7], {size=10, align="r"})
write_text(cr, 145, 103, "C", {font="Weather", size=18, align="r"})
-- Netzwerk
--Anzahl gespeicherter Netzwerktraffikwerte für up und down
samples = 300
local iface='wlp2s0'
local y=0
--up und downlink speed speichern
if not up then
up = {}
down = {}
nzeiger = -1
end
up, down, nzeiger=add_network_traffic(iface, up,down,nzeiger)
--draw_network_chart(cr, iface, up, down, nzeiger, x, y, l, h)
draw_network_chart(cr, iface, up, down, nzeiger, 22, 498, 128, 16)
-- Text - Standard: write_text(cr, x, y, 'text'), {font="Noto Sans", size=10, align="l", bold=false, italic=false, color="0xffffff"}))
write_text(cr, 82, 273, "RAM", {font="Dyuthi", color="0x1e90ff", size=10})
write_text(cr, 82, 282, "Swap", {font="Dyuthi", size=10})
write_text(cr, 122, 296, conky_parse('${memperc}').."%", {color="0x1e90ff", align="r"})
write_text(cr, 122, 307, conky_parse('${swapperc}').."%", {align="r"})
write_text(cr, 30, 296, conky_parse('${fs_used_perc /}').."%", {color="0x1e90ff"})
write_text(cr, 30, 307, conky_parse('${fs_used_perc /home}').."%", {})
write_text(cr, 10, 272, "Sys", {font="Dyuthi", color="0x1e90ff", size=10})
write_text(cr, 538, 51, conky_parse('${fs_used /}'), {color="0x1e90ff"})
write_text(cr, 10, 282, "Home", {font="Dyuthi", size=10})
write_text(cr, 538, 73, conky_parse('${fs_used /home}'),{})
write_text(cr, 75, 180, "Ryzen 5 7520U", {font="Dyuthi", size=14, align="c"})
write_text(cr, 75, 160, os.date("%a")..". "..os.date("%d").." "..os.date("%B").." "..os.date("%Y"), {font="Dyuthi", size=14, align="c"})
write_text(cr, 80, 350, "CPU", {font="Dyuthi", size=10, align="c", color="0x1e90ff"})
write_text(cr, 80, 380, "FAN", {font="Dyuthi", size=10, align="c", color="0x1e90ff"})
write_text(cr, 80, 410, "vddnb", {font="Dyuthi", size=10, align="c", color="0x1e90ff"})
write_text(cr, 80, 440, "SSD", {font="Dyuthi", size=10, align="c", color="0x1e90ff"})
write_text(cr, 80, 360, conky_parse('${hwmon k10temp temp 1}').."°C", {size=9, align="c"})
write_text(cr, 80, 390, conky_parse('${hwmon hp fan 1}'), {size=9, align="c"})
write_text(cr, 80, 420, conky_parse('${hwmon amdgpu in 1}').."V", {size=9, align="c"})
write_text(cr, 80, 450, conky_parse('${hwmon nvme temp 1 }').."°C", {size=9, align="c"})
write_text(cr, 80, 786, conky_parse('${execi 7200 lsb_release -ds}'), {font="Dyuthi", size=14, align="c"})
write_text(cr, 80, 798, conky_parse('${kernel}'), {font="Dyuthi", size=14, align="c"})
write_text(cr, 75, 473, "Uptime: "..conky_parse('${uptime_short}'), {align="c"})
write_text(cr, 10, 495, "⬆", {color="0x1e90ff"})
write_text(cr, 10, 507, "⬇", {color="0x1e90ff"})
write_text(cr, 10, 529, "⬇", {color="0x1e90ff"})
write_text(cr, 10, 540, "⬆", {color="0x1e90ff"})
write_text(cr, 66, 530, conky_parse('${downspeed wlp2s0}'), {align="r"})
write_text(cr, 70, 530, "Total:", {color="0x1e90ff"})
write_text(cr, 150, 530, conky_parse('${totaldown wlp2s0}'), {align="r"})
write_text(cr, 66, 541, conky_parse('${upspeed wlp2s0}'), {align="r"})
write_text(cr, 70, 541, "Total:", {color="0x1e90ff"})
write_text(cr, 150, 541, conky_parse('${totalup wlp2s0}'), {align="r"})
write_text(cr, 12, 555, "IP:", {color="0x1e90ff"})
write_text(cr, 80, 551, conky_parse('${execi 7200 curl https://ipinfo.io/ip}'), {align="c"})
write_text(cr, 10, 578, "Top CPU", {font="Dyuthi", italic=true, size=12, color="0x1e90ff"})
write_text(cr, 10, 591, conky_parse('${top name 1}'), {})
write_text(cr, 150, 591, conky_parse('${top cpu 1}')..'%', {align="r"})
write_text(cr, 10, 602, conky_parse('${top name 2}'), {})
write_text(cr, 150, 602, conky_parse('${top cpu 2}')..'%', {align="r"})
write_text(cr, 10, 613, conky_parse('${top name 3}'), {})
write_text(cr, 150, 613, conky_parse('${top cpu 3}')..'%', {align="r"})
write_text(cr, 10, 624, conky_parse('${top name 4}'), {})
write_text(cr, 150, 624, conky_parse('${top cpu 4}')..'%', {align="r"})
write_text(cr, 10, 634, conky_parse('${top name 5}'), {})
write_text(cr, 150, 635, conky_parse('${top cpu 5}')..'%', {align="r"})
write_text(cr, 10, 652, "Top MEM", {font="Dyuthi", size=12, color="0x1e90ff"})
write_text(cr, 10, 666, conky_parse('${top_mem name 1}'), {})
write_text(cr, 150, 666, conky_parse('${top_mem mem 1}')..'%', {align="r"})
write_text(cr, 10, 677, conky_parse('${top_mem name 2}'), {})
write_text(cr, 150, 677, conky_parse('${top_mem mem 2}')..'%', {align="r"})
write_text(cr, 10, 688, conky_parse('${top_mem name 3}'), {})
write_text(cr, 150, 688, conky_parse('${top_mem mem 3}')..'%', {align="r"})
write_text(cr, 10, 699, conky_parse('${top_mem name 4}'), {})
write_text(cr, 150, 699, conky_parse('${top_mem mem 4}')..'%', {align="r"})
write_text(cr, 10, 710, conky_parse('${top_mem name 5}'), {})
write_text(cr, 150, 710, conky_parse('${top_mem mem 5}')..'%', {align="r"})
write_text(cr, 10, 740, "Batterie: ", {})
write_text(cr, 150, 740, conky_parse('${battery BAT0}'), {align="r"})
write_text(cr, 10, 754, "Restzeit: ", {})
write_text(cr, 150, 754, conky_parse('${battery_time BAT0}'), {align="r"})
-- write_text(cr, 150, 736, conky_parse('${battery_short BAT0}')..'%', {align="r"})
write_text(cr, 76, 130, os.date("%H")..':'..os.date("%M"), {align="c", color="0x1e90ff", size=42, bold=true})
-- Lines (Linien)
cairo_rectangle(cr,10, 10, 135, 3)
cairo_set_source_rgba(cr,rgb_to_rgba(0xffffff,1.0))
cairo_fill(cr)
cairo_rectangle(cr,10, 810, 140, 3)
cairo_set_source_rgba(cr,rgb_to_rgba(0xffffff,1.0))
cairo_fill(cr)
cairo_rectangle(cr,10, 563, 140, 2)
cairo_set_source_rgba(cr,rgb_to_rgba(0xffffff,1.0))
cairo_rectangle(cr,10, 718, 140, 2)
cairo_set_source_rgba(cr,rgb_to_rgba(0xffffff,1.0))
cairo_rectangle(cr,10, 772, 140, 2)
cairo_set_source_rgba(cr,rgb_to_rgba(0xffffff,1.0))
cairo_fill(cr)
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end