Do you have a link for the special fonts used in your conky, or which package might contain them?
You can also zip up various files into a zip file and attach those here, though I think they are limited to about 300 KiB.
My Conky ... feel free to adapt/change and use it
Re: My Conky ... feel free to adapt/change and use it
I have those from OP, and wanted to test the conky before I moved forward. Life is in the way ATM...
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: My Conky ... feel free to adapt/change and use it
There is a mistake here. Prize for the first to find it!jeanpaulberes wrote: ↑Fri Dec 21, 2018 5:50 am My Conky .. feel free to use it ...
-------------Code: Select all
# By Jean Paul BERES # My adapted/changed Conky # 18 Dec. 2018 double_buffer yes update_interval 2 background yes own_window yes # own_window_type desktop own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #own_window_type override own_window_argb_visual yes own_window_argb_value 75 out_to_console no own_window_transparent no own_window_class conky-semi use_xft yes xftfont cure:size=10 #use_xft yes #xftfont Sansation:size=9 xftfont Rounded Elegance:size=10 xftalpha 0 update_interval 2 cpu_avg_samples 2 net_avg_samples 2 double_buffer yes maximum_width 320 draw_shades no draw_outline no draw_borders no draw_graph_borders no stippled_borders 1 border_width 0 default_color white default_shade_color white default_outline_color white alignment top_right use_spacer left no_buffers yes uppercase no color0 white color2 white color3 1793d0 pad_percents 2 top_name_width 7 minimum_size 320 700 gap_x 10 gap_y 30 lua_load allcombined.lua own_window_colour 000000 TEXT #-----------------------System information----------------------- ${offset 5}${font Good Times:size=12}${color Tan1}SYSTEM INFORMATION ${color}${hr 2}${font} ${font}${color1}${offset 9}${execi 3600 cat /etc/mx-version} #${goto 80}${color #34BE5B}${font Ubuntu-Title:size=11}Manjaro${font}${color} | xfce 4.13 ${goto 10}Kernel: $kernel $machine ${goto 10}${time %a %d %b %Y - %H:%M} #-----------------------CPU----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}CPU ${color}${hr 2}${font} ${font}${color}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq} ${color lightgrey}Temperature:${hwmon 1 temp 1}°C # CPU0 Avg.${goto 50} : ${cpu cpu0}% ${lua gradbar {100, 135, "${cpu cpu0}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 1} MHz # CPU1 CPU-1${goto 50} : ${cpu cpu1}% ${lua gradbar {100, 150, "${cpu cpu1}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 2} MHz # CPU2 CPU-2${goto 50} : ${cpu cpu2}% ${lua gradbar {100, 165, "${cpu cpu2}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 3} MHz # CPU3 CPU-3${goto 50} : ${cpu cpu3}% ${lua gradbar {100, 180, "${cpu cpu3}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 4} MHz # CPU4 CPU-4${goto 50} : ${cpu cpu4}% ${lua gradbar {100, 195, "${cpu cpu4}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 5} MHz #-----------------------Memory Load----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font} ${color}RAM Available${color}${alignr}$memmax ${voffset -6} ${lua gradbar {6, 310, "${memperc}", 200, 310, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}} ${color}$mem used${alignr}${memperc}% used #-----------------------Processes & Load information----------------------- ${voffset +1} ${offset 10}${font Good Times:size=12}${color Tan1}PROCESSES & LOAD ${color}${hr 2}${font} ${offset 5}${voffset 5}${color}Avg. Load: ${loadavg 1} #${running_processes} ${running_threads} ${processes} ${hr 1}${font} ${color lightgrey}${font Futurist Fixed-width:size=10:bold}${color7}${offset 5}PROCESS CPU${alignr} MEMORY ${offset -5}PID ${voffset -10}${color0}${hr 1}${font}${color}${font monofur:size=11} ${voffset -3}# ${offset 5}${top name 1} ${alignr}${top cpu 1}% ${top mem_res 1} ${alignr}${offset -5}${top pid 1} ${offset 5}${top name 2} ${alignr}${top cpu 2}% ${top mem_res 2} ${alignr}${offset -5}${top pid 2} ${offset 5}${top name 3} ${alignr}${top cpu 3}% ${top mem_res 3} ${alignr}${offset -5}${top pid 3} ${offset 5}${top name 4} ${alignr}${top cpu 4}% ${top mem_res 4} ${alignr}${offset -5}${top pid 4} ${offset 5}${top name 5} ${alignr}${top cpu 5}% ${top mem_res 5} ${alignr}${offset -5}${top pid 5} #-----------------------Network----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}NETWORK ${color}${hr 2}${font} ${voffset -1} ${if_up wlan0}${goto 10}Wireless: ${color3} wlan0${color}${goto 160} ${hr 1} ${voffset -1} ${goto 14}${color2}Up: ${color3}${upspeed wlan0}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed wlan0}${color0} ${goto 14}${color2}Sent:${color1} ${color2}${totalup wlan0}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown wlan0} ${goto 14}${upspeedgraph wlan0 50,140 000000 FFBF00}${goto 180}${downspeedgraph wlan0 50,140 000000 00FF00}$ ${voffset -1}${endif}${if_up eth0}${goto 10}Ethernet: ${color3} eth0${color}${goto 160} IP local:${color3}${addr eth0} ${hr 1}# By Jean Paul BERES # My adapted/changed Conky # 18 Dec. 2018 double_buffer yes update_interval 2 background yes own_window yes # own_window_type desktop own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager #own_window_type override own_window_argb_visual yes own_window_argb_value 75 out_to_console no own_window_transparent no own_window_class conky-semi use_xft yes xftfont cure:size=10 #use_xft yes #xftfont Sansation:size=9 xftfont Rounded Elegance:size=10 xftalpha 0 update_interval 2 cpu_avg_samples 2 net_avg_samples 2 double_buffer yes maximum_width 320 draw_shades no draw_outline no draw_borders no draw_graph_borders no stippled_borders 1 border_width 0 default_color white default_shade_color white default_outline_color white alignment top_right use_spacer left no_buffers yes uppercase no color0 white color2 white color3 1793d0 pad_percents 2 top_name_width 7 minimum_size 320 700 gap_x 10 gap_y 30 lua_load allcombined.lua own_window_colour 000000 TEXT #-----------------------System information----------------------- ${offset 5}${font Good Times:size=12}${color Tan1}SYSTEM INFORMATION ${color}${hr 2}${font} ${font}${color1}${offset 9}${execi 3600 cat /etc/mx-version} #${goto 80}${color #34BE5B}${font Ubuntu-Title:size=11}Manjaro${font}${color} | xfce 4.13 ${goto 10}Kernel: $kernel $machine ${goto 10}${time %a %d %b %Y - %H:%M} #-----------------------CPU----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}CPU ${color}${hr 2}${font} ${font}${color}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq} ${color lightgrey}Temperature:${hwmon 1 temp 1}°C # CPU0 Avg.${goto 50} : ${cpu cpu0}% ${lua gradbar {100, 135, "${cpu cpu0}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 1} MHz # CPU1 CPU-1${goto 50} : ${cpu cpu1}% ${lua gradbar {100, 150, "${cpu cpu1}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 2} MHz # CPU2 CPU-2${goto 50} : ${cpu cpu2}% ${lua gradbar {100, 165, "${cpu cpu2}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 3} MHz # CPU3 CPU-3${goto 50} : ${cpu cpu3}% ${lua gradbar {100, 180, "${cpu cpu3}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 4} MHz # CPU4 CPU-4${goto 50} : ${cpu cpu4}% ${lua gradbar {100, 195, "${cpu cpu4}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq 5} MHz #-----------------------Memory Load----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font} ${color}RAM Available${color}${alignr}$memmax ${voffset -6} ${lua gradbar {6, 310, "${memperc}", 200, 310, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}} ${color}$mem used${alignr}${memperc}% used #-----------------------Processes & Load information----------------------- ${voffset +1} ${offset 10}${font Good Times:size=12}${color Tan1}PROCESSES & LOAD ${color}${hr 2}${font} ${offset 5}${voffset 5}${color}Avg. Load: ${loadavg 1} #${running_processes} ${running_threads} ${processes} ${hr 1}${font} ${color lightgrey}${font Futurist Fixed-width:size=10:bold}${color7}${offset 5}PROCESS CPU${alignr} MEMORY ${offset -5}PID ${voffset -10}${color0}${hr 1}${font}${color}${font monofur:size=11} ${voffset -3}# ${offset 5}${top name 1} ${alignr}${top cpu 1}% ${top mem_res 1} ${alignr}${offset -5}${top pid 1} ${offset 5}${top name 2} ${alignr}${top cpu 2}% ${top mem_res 2} ${alignr}${offset -5}${top pid 2} ${offset 5}${top name 3} ${alignr}${top cpu 3}% ${top mem_res 3} ${alignr}${offset -5}${top pid 3} ${offset 5}${top name 4} ${alignr}${top cpu 4}% ${top mem_res 4} ${alignr}${offset -5}${top pid 4} ${offset 5}${top name 5} ${alignr}${top cpu 5}% ${top mem_res 5} ${alignr}${offset -5}${top pid 5} #-----------------------Network----------------------- ${offset 10}${font Good Times:size=12}${color Tan1}NETWORK ${color}${hr 2}${font} ${voffset -1} ${if_up wlan0}${goto 10}Wireless: ${color3} wlan0${color}${goto 160} ${hr 1} ${voffset -1} ${goto 14}${color2}Up: ${color3}${upspeed wlan0}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed wlan0}${color0} ${goto 14}${color2}Sent:${color1} ${color2}${totalup wlan0}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown wlan0} ${goto 14}${upspeedgraph wlan0 50,140 000000 FFBF00}${goto 180}${downspeedgraph wlan0 50,140 000000 00FF00}$ ${voffset -1}${endif}${if_up eth0}${goto 10}Ethernet: ${color3} eth0${color}${goto 160} IP local:${color3}${addr eth0} ${hr 1} ${voffset -1} ${goto 14}${color2}Up: ${color3}${upspeed eth0}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed eth0}${color0} ${goto 14}${color2}Sent:${color1} ${color2}${totalup eth0}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown eth0} ${goto 14}${upspeedgraph eth0 50,140 000000 FFBF00}${goto 180}${downspeedgraph eth0 50,140 000000 00FF00}$ ${voffset -1}${endif}
...
Re: My Conky ... feel free to adapt/change and use it
@sunrat
Your just a two timer. Prize Please
Your just a two timer. Prize Please
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 .
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)
- jeanpaulberes
- Posts: 36
- Joined: Wed Dec 19, 2018 11:56 am
Re: My Conky ... feel free to adapt/change and use it
It works with lua, and I didn't post the lua here for it ... but for those asking :
<---
Code: Select all
--[[ by mrpeachy - changed by Jean Paul BERES
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
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=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
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 imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
+++
Mod note: Please put long code text-output between code-tags: [code] text goes here [/code] .
To insert code-tags press </>-icon above the editor window.
Re: My Conky ... feel free to adapt/change and use it
@sunrat, what is the price?sunrat wrote:There is a mistake here. Prize for the first to find it!
Conky should use two fonts above TEXT (Cure and Rounded+Elegance) and the user must have 4 cores, otherwise he won't start.
I took the liberty of cleaning up and redesigning the code.
Everything is tested in a VM. The fonts are necessary:
-Rounded+Elegance
-Good+Times
-Futurist+Fixed-widht
-monofur (stood at the bottom)
I left Cure out.
The Lua script works.
If you like, you can test it and report here.
Please note:
My guest system has only two cores and their temperature cannot be displayed. Therefore these lines are commented out (#). If you have a real machine with the corresponding cores and lm-sensors, the lua-graphs can move. We can easily correct this.
and now, have fun!
conkyrc
Code: Select all
# By Jean Paul BERES
# My adapted/changed Conky
# 18 Dec. 2018
update_interval 2
background yes
own_window yes
own_window_hints undecorated,below,skip_taskbar,skip_pager #sticky,
own_window_type normal
own_window_transparent yes
#own_window_colour 000000
#own_window_argb_visual yes
#own_window_argb_value 75
#own_window_class conky-semi
out_to_console no
use_xft yes
#xftfont cure:size=10
#xftfont Sansation:size=9
xftfont Rounded Elegance:size=10
xftalpha 0
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
use_spacer left
no_buffers yes
uppercase no
minimum_size 320 0
#maximum_width 320
gap_x 10
gap_y 10
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
stippled_borders 1
border_width 0
default_color white
default_shade_color white
default_outline_color white
alignment top_right
color0 white
color2 white
color3 1793d0
pad_percents 2
top_name_width 7
if_up_strictness adress
#--LUA--#
lua_load ~/.conky/beres/allcombined.lua
TEXT
#-----------------------System information-----------------------
${offset 5}${font Good Times:size=12}${color Tan1}SYSTEM INFORMATION ${color}${hr 2}${font}
${execi 86400 cat /etc/mx-version}
Kernel: $kernel $machine
${time %a %d %b %Y - %H:%M}
#-----------------------CPU-----------------------
${font Good Times:size=12}${color Tan1}CPU ${color}${hr 2}${font}
${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq}
#${color lightgrey}Temperature:${hwmon 1 temp 1}°C
${voffset 15}Avg.${goto 50} : ${cpu cpu0}% ${lua gradbar {100, 135, "${cpu cpu0}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq cpu0} MHz
CPU-1${goto 50} : ${cpu cpu1}% ${lua gradbar {100, 150, "${cpu cpu1}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq cpu1} MHz
CPU-2${goto 50} : ${cpu cpu2}% ${lua gradbar {100, 165, "${cpu cpu2}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq cpu2} MHz
#CPU-3${goto 50} : ${cpu cpu3}% ${lua gradbar {100, 180, "${cpu cpu3}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq cpu3} MHz
#CPU-4${goto 50} : ${cpu cpu4}% ${lua gradbar {100, 195, "${cpu cpu4}", 100, 40, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 230}${color}${freq cpu4} MHz
#-----------------------Memory Load-----------------------
${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
RAM Available ${color}${alignr}${memmax}
${lua gradbar {6, 230, "${memperc}", 200, 310, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${voffset 5}${mem used}${alignr}${memperc}% used
#-----------------------Processes & Load information-----------------------
${font Good Times:size=12}${color Tan1}PROCESSES & LOAD ${color}${hr 2}${font}
Avg. Load: ${loadavg 1}
#${running_processes} ${running_threads} ${processes}
${hr 1}${font}
${color lightgrey}${font Futurist Fixed-width:size=10:bold}PROCESS CPU MEMORY ${alignr 10}PID
${color0}${hr 1}${font monofur:size=11}
${top name 1} ${alignr}${top cpu 1}% ${top mem_res 1} ${alignr}${top pid 1}
${top name 2} ${alignr}${top cpu 2}% ${top mem_res 2} ${alignr}${top pid 2}
${top name 3} ${alignr}${top cpu 3}% ${top mem_res 3} ${alignr}${top pid 3}
${top name 4} ${alignr}${top cpu 4}% ${top mem_res 4} ${alignr}${top pid 4}
${top name 5} ${alignr}${top cpu 5}% ${top mem_res 5} ${alignr}${top pid 5}
#-----------------------Network-----------------------
${font Good Times:size=12}${color Tan1}NETWORK ${color}${hr 2}${font}
${if_up wlan0}${goto 10}Wireless: ${color3} wlan0${color}
${hr 1}
${goto 14}${color2}Up: ${color3}${upspeed wlan0}${alignr}${goto 180}${color2}Down: ${color3}${downspeed wlan0}
${goto 14}${color2}Sent: ${color2}${totalup wlan0}${alignr}${goto 180}${color2}Received: ${color2}${totaldown wlan0}
${goto 14}${upspeedgraph wlan0 25,140 000000 FFBF00}${goto 180}${downspeedgraph wlan0 25,140 000000 00FF00}
${endif}${if_up eth0}${goto 10}Ethernet: ${color3} eth0 ${color2}${goto 160} IP local:${alignr}${color3}${addr eth0}${color2}
${hr 1}
${goto 14}${color2}Up: ${color3}${upspeed eth0}${alignr}${goto 180}${color2}Down: ${color3}${downspeed eth0}
${goto 14}${color2}Sent: ${color2}${totalup eth0}${alignr}${goto 180}${color2}Received: ${color2}${totaldown eth0}
${goto 14}${upspeedgraph eth0 25,140 000000 FFBF00}${goto 180}${downspeedgraph eth0 25,140 000000 00FF00}
${endif}