my combined MEGA version of siamhie's MX-Multicore -- need help

Message
Author
User avatar
asqwerth
Developer
Posts: 7922
Joined: Sun May 27, 2007 5:37 am

my combined MEGA version of siamhie's MX-Multicore -- need help

#1 Post by asqwerth »

This is in reference to @siamhie 's MX-Multicore conky, which is an expanded set of conkies adapted from MX-MySysInfo in $HOME/.conky/MX-MyConky folder. [see viewtopic.php?p=806077#p806077 for siamhie's set of conkies].

The original MySysInfo conky merely displayed the average CPU load of all cores in a single progress bar. Siamhie made his version to display 16 progress bars, one for each of the 16 cores in his computer.

He then went on the make separate conkies for users with 2, 4, 6, 8, 12, 16, 20 or 24 cores respectively. You just picked which conky in his set applied to your system.

I wanted to see if I could combine all the separate conkies into a single one, using the if_match..... else.....endif syntax to address each of the different cpu scenarios.

My first trial conky only addressed 16 and 4 core scenarios, since my machines were all 4 cores and I had siamhie's 16-core conky to place where to position the many progress bars needed. This appeared to work on my system in the sense that my conky showed up with 4 progress bars, and ignored the 16-core scenario.
When Siamhie added more conkies to his multicore collection to work with other numbers of cores, I copied them over and added more scenarios to my mega conky.

However, I have encountered a problem for which I need help.

This is the mega conky that addresses scenarios for 2, 4, 6, 8, 10, 12, 16 cores.

Code: Select all

conky.config = {
-- My adapted/changed Conky
-- 18 Dec. 2018

double_buffer = true,
update_interval = 1,
background = true,
own_window = true,
own_window_type = 'normal',  --'override',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 50,
out_to_console = false,

own_window_transparent = false,
own_window_class = 'conky',
use_xft = true,
font = 'cure:size=12',
xftalpha = 0,
update_interval = 1,
cpu_avg_samples = 1,
net_avg_samples = 1,
double_buffer = true,
maximum_width = 320,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
stippled_borders = 1,
border_width = 0,
default_color = 'white',
default_shade_color = 'white',
default_outline_color = 'white',

alignment = 'top_right',
gap_x = 5,
gap_y = 5,

use_spacer = 'left',
no_buffers = true,
uppercase = false,
color0 = 'white',
color1 = 'green',
color2 = 'white',
color3 = '1793d0',
pad_percents = 2,
top_name_width = 7,
minimum_width = 320, minimum_height = 610,

lua_load = 'allcombined.lua',
own_window_colour = '000000',


-- if_up_strictness link:  up | link | address
   if_up_strictness = 'address',

-- network templates
   template0 = 'wlan0',
   template1 = 'wlan1',
   template2 = 'eth0',
   template3 = 'eth1',

-- time template
   template7 = '%a %d %b %Y - %H:%M:%S',

};

-- fluxbox adjustment

return_code = os.execute('pidof -q fluxbox')
if _VERSION == 'Lua 5.1' and math.floor(return_code/256) == 0 or
   _VERSION ~= 'Lua 5.1' and return_code then
   conky.config.own_window_transparent = true
   conky.config.own_window_argb_visual = false
end

conky.text = [[
#-----------------------System-----------------------------------
${offset 5}${font Good Times:size=12}${color Tan1}SYSTEM INFORMATION ${color}${hr 2}${font}
${font}${color}${offset 6}${execi 86400 cat /etc/mx-version}
${goto 10}Kernel: $kernel $machine
${goto 10}${if_match "pmfix${time %p}" == "pmfix"}${time $template7}${else}${time %a %d %b %Y - %H:%M}${endif}

#-----------------------CPU-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}CPU ${color}${hr 2}${font}
${alignc}${font}${color}${execi 86400 grep -m1 -oP '^model name\s+:\s\K(.*)' /proc/cpuinfo}
${alignc}${color lightgrey}Temperature: ${if_existing /sys/class/hwmon/hwmon3/temp1_input}${eval ${hwmon 3 temp 1}}${else}${if_existing /sys/class/hwmon/hwmon1/temp1_input}${eval ${hwmon 1 temp 1}}${endif}${endif}°C
# if CPU 16 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 16} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz
${voffset 10}CPU9 ${goto 80} ${cpu cpu9}% ${lua gradbar {4, 500, "${cpu cpu9}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 9} MHz
${voffset 10}CPU10 ${goto 80} ${cpu cpu10}% ${lua gradbar {4, 533, "${cpu cpu10}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 10} MHz
${voffset 10}CPU11 ${goto 80} ${cpu cpu11}% ${lua gradbar {4, 566, "${cpu cpu11}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 11} MHz
${voffset 10}CPU12 ${goto 80} ${cpu cpu12}% ${lua gradbar {4, 599, "${cpu cpu12}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 12} MHz
${voffset 10}CPU13 ${goto 80} ${cpu cpu13}% ${lua gradbar {4, 632, "${cpu cpu13}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 13} MHz
${voffset 10}CPU14 ${goto 80} ${cpu cpu14}% ${lua gradbar {4, 665, "${cpu cpu14}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 14} MHz
${voffset 10}CPU15 ${goto 80} ${cpu cpu15}% ${lua gradbar {4, 698, "${cpu cpu15}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 15} MHz
${voffset 10}CPU16 ${goto 80} ${cpu cpu16}% ${lua gradbar {4, 731, "${cpu cpu16}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 16} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 827, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
# if CPU 12 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 12} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz
${voffset 10}CPU9 ${goto 80} ${cpu cpu9}% ${lua gradbar {4, 500, "${cpu cpu9}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 9} MHz
${voffset 10}CPU10 ${goto 80} ${cpu cpu10}% ${lua gradbar {4, 533, "${cpu cpu10}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 10} MHz
${voffset 10}CPU11 ${goto 80} ${cpu cpu11}% ${lua gradbar {4, 566, "${cpu cpu11}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 11} MHz
${voffset 10}CPU12 ${goto 80} ${cpu cpu12}% ${lua gradbar {4, 599, "${cpu cpu12}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 12} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 695, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used 
${else}\
# if CPU 10 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 10} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz
${voffset 10}CPU9 ${goto 80} ${cpu cpu9}% ${lua gradbar {4, 500, "${cpu cpu9}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 9} MHz
${voffset 10}CPU10 ${goto 80} ${cpu cpu10}% ${lua gradbar {4, 533, "${cpu cpu10}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 10} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 628, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
# if CPU 8 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 8} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 563, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
# if CPU 6 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 6} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 497, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
#if CPU 4 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 4} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 430, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
#if CPU 2 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 2}  ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 365, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${endif}${endif}${endif}${endif}${endif}${endif}${endif}\
 
#-----------------------Processes----------------------
${offset 10}${font Good Times:size=12}${color Tan1}PROCESSES ${color}${hr 2}${font}
#${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 $template0}\
${goto 10}Wireless:${color3} $template0${color}${goto 145}IP local: ${color3}${addr $template0}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template0}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template0}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template0}${color1}${alignr}${goto 180}${color2}Received: ${color}${color2}${totaldown $template0}
${goto 14}${upspeedgraph $template0  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template0 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template1}\
${goto 10}Wireless: ${color3} $template1${color}${goto 160}     IP local: ${color3}${addr $template1}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template1}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template1}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template1}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template1}
${goto 14}${upspeedgraph $template1  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template1 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template2}\
${goto 10}Ethernet: ${color3} $template2${color}${goto 160}     IP local: ${color3}${addr $template2}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template2}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template2}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template2}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template2}
${goto 14}${upspeedgraph $template2  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template2 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template3}\
${goto 10}Ethernet: ${color3} $template3${color}${goto 160}     IP local: ${color3}${addr $template3}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template3}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template3}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template3}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template3}
${goto 14}${upspeedgraph $template3  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template3 25,140 000000 00FF00}
${voffset -1}\
${endif}
]];
When I run this on my 4-core machine, the CPU and Memory section of the conky appear to be ok, but the network section shows wlan0 and some weird output in the "Down" data even though I'm on wired ethernet eth0.
ksnip_20250207-185411.png
So then I simply delete the lines dealing with the 16-core scenario from the conky, plus one of the ${endif}, and straightaway, the network correctly displays my eth0 ethernet details again.

Code: Select all

conky.config = {
-- My adapted/changed Conky
-- 18 Dec. 2018

double_buffer = true,
update_interval = 1,
background = true,
own_window = true,
own_window_type = 'normal',  --'override',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 50,
out_to_console = false,

own_window_transparent = false,
own_window_class = 'conky',
use_xft = true,
font = 'cure:size=12',
xftalpha = 0,
update_interval = 1,
cpu_avg_samples = 1,
net_avg_samples = 1,
double_buffer = true,
maximum_width = 320,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
stippled_borders = 1,
border_width = 0,
default_color = 'white',
default_shade_color = 'white',
default_outline_color = 'white',

alignment = 'top_right',
gap_x = 5,
gap_y = 5,

use_spacer = 'left',
no_buffers = true,
uppercase = false,
color0 = 'white',
color1 = 'green',
color2 = 'white',
color3 = '1793d0',
pad_percents = 2,
top_name_width = 7,
minimum_width = 320, minimum_height = 610,

lua_load = 'allcombined.lua',
own_window_colour = '000000',


-- if_up_strictness link:  up | link | address
   if_up_strictness = 'address',

-- network templates
   template0 = 'wlan0',
   template1 = 'wlan1',
   template2 = 'eth0',
   template3 = 'eth1',

-- time template
   template7 = '%a %d %b %Y - %H:%M:%S',

};

-- fluxbox adjustment

return_code = os.execute('pidof -q fluxbox')
if _VERSION == 'Lua 5.1' and math.floor(return_code/256) == 0 or
   _VERSION ~= 'Lua 5.1' and return_code then
   conky.config.own_window_transparent = true
   conky.config.own_window_argb_visual = false
end

conky.text = [[
#-----------------------System-----------------------------------
${offset 5}${font Good Times:size=12}${color Tan1}SYSTEM INFORMATION ${color}${hr 2}${font}
${font}${color}${offset 6}${execi 86400 cat /etc/mx-version}
${goto 10}Kernel: $kernel $machine
${goto 10}${if_match "pmfix${time %p}" == "pmfix"}${time $template7}${else}${time %a %d %b %Y - %H:%M}${endif}

#-----------------------CPU-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}CPU ${color}${hr 2}${font}
${alignc}${font}${color}${execi 86400 grep -m1 -oP '^model name\s+:\s\K(.*)' /proc/cpuinfo}
${alignc}${color lightgrey}Temperature: ${if_existing /sys/class/hwmon/hwmon3/temp1_input}${eval ${hwmon 3 temp 1}}${else}${if_existing /sys/class/hwmon/hwmon1/temp1_input}${eval ${hwmon 1 temp 1}}${endif}${endif}°C
# if CPU 12 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 12} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz
${voffset 10}CPU9 ${goto 80} ${cpu cpu9}% ${lua gradbar {4, 500, "${cpu cpu9}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 9} MHz
${voffset 10}CPU10 ${goto 80} ${cpu cpu10}% ${lua gradbar {4, 533, "${cpu cpu10}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 10} MHz
${voffset 10}CPU11 ${goto 80} ${cpu cpu11}% ${lua gradbar {4, 566, "${cpu cpu11}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 11} MHz
${voffset 10}CPU12 ${goto 80} ${cpu cpu12}% ${lua gradbar {4, 599, "${cpu cpu12}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 12} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 695, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used 
${else}\
# if CPU 10 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 10} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz
${voffset 10}CPU9 ${goto 80} ${cpu cpu9}% ${lua gradbar {4, 500, "${cpu cpu9}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 9} MHz
${voffset 10}CPU10 ${goto 80} ${cpu cpu10}% ${lua gradbar {4, 533, "${cpu cpu10}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 10} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 628, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
# if CPU 8 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 8} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz
${voffset 10}CPU7 ${goto 80} ${cpu cpu7}% ${lua gradbar {4, 436, "${cpu cpu7}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 7} MHz
${voffset 10}CPU8 ${goto 80} ${cpu cpu8}% ${lua gradbar {4, 468, "${cpu cpu8}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 8} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 563, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
# if CPU 6 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 6} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz
${voffset 10}CPU5 ${goto 80} ${cpu cpu5}% ${lua gradbar {4, 370, "${cpu cpu5}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 5} MHz
${voffset 10}CPU6 ${goto 80} ${cpu cpu6}% ${lua gradbar {4, 403, "${cpu cpu6}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 6} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 497, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
#if CPU 4 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 4} ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz
${voffset 10}CPU3 ${goto 80} ${cpu cpu3}% ${lua gradbar {4, 303, "${cpu cpu3}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 3} MHz
${voffset 10}CPU4 ${goto 80} ${cpu cpu4}% ${lua gradbar {4, 336, "${cpu cpu4}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 4} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 430, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${else}\
#if CPU 2 cores
${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 2}  ${alignc}CPU Core Loads
CPU1 ${goto 80} ${cpu cpu1}% ${lua gradbar {4, 238, "${cpu cpu1}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 1} MHz
${voffset 10}CPU2 ${goto 80} ${cpu cpu2}% ${lua gradbar {4, 270, "${cpu cpu2}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}${goto 249}${color}${freq 2} MHz

#-----------------------Memory Load-----------------------
${offset 10}${font Good Times:size=12}${color Tan1}MEMORY ${color}${hr 2}${font}
${color}RAM Available${color}${alignr}$memmax ${lua gradbar {4, 365, "${memperc}", 100, 110, 2, 10, 1, 0xFFFFFF, 0.25, 0x00FF00, 1, 0xFFFF00, 1, 0xFF0000, 1}}
${color}$mem used${alignr}${memperc}% used
${endif}${endif}${endif}${endif}${endif}${endif}\
 
#-----------------------Processes----------------------
${offset 10}${font Good Times:size=12}${color Tan1}PROCESSES ${color}${hr 2}${font}
#${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 $template0}\
${goto 10}Wireless:${color3} $template0${color}${goto 145}IP local: ${color3}${addr $template0}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template0}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template0}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template0}${color1}${alignr}${goto 180}${color2}Received: ${color}${color2}${totaldown $template0}
${goto 14}${upspeedgraph $template0  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template0 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template1}\
${goto 10}Wireless: ${color3} $template1${color}${goto 160}     IP local: ${color3}${addr $template1}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template1}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template1}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template1}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template1}
${goto 14}${upspeedgraph $template1  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template1 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template2}\
${goto 10}Ethernet: ${color3} $template2${color}${goto 160}     IP local: ${color3}${addr $template2}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template2}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template2}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template2}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template2}
${goto 14}${upspeedgraph $template2  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template2 25,140 000000 00FF00}
${voffset -1}\
${endif}\
${if_up $template3}\
${goto 10}Ethernet: ${color3} $template3${color}${goto 160}     IP local: ${color3}${addr $template3}
${hr 1}
${voffset -1}
${goto 14}${color2}Up: ${color3}${upspeed $template3}${color1}${alignr}${goto 180}${color2}Down:${color1} ${color3}${downspeed $template3}${color0}
${goto 14}${color2}Sent:${color1} ${color2}${totalup $template3}${color1}${alignr}${goto 180}${color2}Received:${color}${color2}${totaldown $template3}
${goto 14}${upspeedgraph $template3  25,140 000000 FFBF00}${goto 180}${downspeedgraph $template3 25,140 000000 00FF00}
${voffset -1}\
${endif}
]];
So I now have 2 questions I am seeking help on:

1. am I right in suspecting that there is a limit to the number of if... else scenarios I can fit into a conky?

2. can someone help me with crafting a if_match argument to cover the situations where cpu number is neither 2,4,6,8,10 or 12 cores, so I can add a fallback scenario to simply show the average load of all cpu cores when a machine does not have the number of cores I've covered in the scenarios. If there is a limit on the number of if match scenarios I can fit in, then lots of system cpu setups cannot be covered in a single conky.

The operative command I'm using in the conky is

Code: Select all

${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 12}
or equals to whatever number of cores is addressed in a scenario.

is there a way to craft an argument where if_match etc etc != [all those numbers 2, 4, 6, 8, 10, 12] all within one scenario?
You do not have the required permissions to view the files attached to this post.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
siamhie
Global Moderator
Posts: 3337
Joined: Fri Aug 20, 2021 5:45 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#2 Post by siamhie »

asqwerth wrote: Fri Feb 07, 2025 6:13 am
When I run this on my 4-core machine, the CPU and Memory section of the conky appear to be ok, but the network section shows wlan0 and some weird output in the "Down" data even though I'm on wired ethernet eth0.
ksnip_20250207-185411.png

The Down section looks to have the code wrong. The ${go}t statement should be ${goto #}
snip.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
asqwerth
Developer
Posts: 7922
Joined: Sun May 27, 2007 5:37 am

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#3 Post by asqwerth »

siamhie wrote: Fri Feb 07, 2025 8:03 am
asqwerth wrote: Fri Feb 07, 2025 6:13 am
When I run this on my 4-core machine, the CPU and Memory section of the conky appear to be ok, but the network section shows wlan0 and some weird output in the "Down" data even though I'm on wired ethernet eth0.
ksnip_20250207-185411.png

The Down section looks to have the code wrong. The ${go}t statement should be ${goto #}

snip.png
The exact same conky code works the minute I remove one of the cpu core scenarios [in this case I removed the 16-core if_match section]. I didn't touch the network code at all. It just works or doesn't, depending on how many if_match scenarios I include in the CPU Cores section.

This is the same conky, just with those 16-core lines removed. It correctly shows the ethernet details, and the "Down" details.
ksnip_20250207-232325.png
You do not have the required permissions to view the files attached to this post.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
siamhie
Global Moderator
Posts: 3337
Joined: Fri Aug 20, 2021 5:45 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#4 Post by siamhie »

asqwerth wrote: Fri Feb 07, 2025 10:22 am
The exact same conky code works the minute I remove one of the cpu core scenarios [in this case I removed the 16-core if_match section]. I didn't touch the network code at all. It just works or doesn't, depending on how many if_match scenarios I include in the CPU Cores section.

This is the same conky, just with those 16-core lines removed. It correctly shows the ethernet details, and the "Down" details.

So it works when you have this statement

Code: Select all

${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 12}

but doesn't work with this statement

Code: Select all

${if_match ${execi 86400 grep -m1 -oP '^cpu cores\s+:\s\K(.*)' /proc/cpuinfo} == 16}
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
asqwerth
Developer
Posts: 7922
Joined: Sun May 27, 2007 5:37 am

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#5 Post by asqwerth »

@siamhie

the conky's network portion starts to work properly when I remove lines 88 to 111 from the first conky config in post 1, which are the lines for the 16-core scenario that will display 16 cpu progress bars and the properly positioned memperc bar after the 16 cpu bars.

I'm left with the 2nd conky config in post 1 after those lines are deleted.

In both cases, the network section of the conky config is NOT changed at all.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
siamhie
Global Moderator
Posts: 3337
Joined: Fri Aug 20, 2021 5:45 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#6 Post by siamhie »

@asqwerth I'm going to rewrite a new template for you to play around with.

Currently the categories listed in the text section look like this:

Code: Select all

#-----------------------System--------------------
#-----------------------CPU-----------------------
#-----------------------Memory Load---------------
#-----------------------Processes-----------------
#-----------------------Network-------------------
If I move the CPU to the bottom, it should not interfere with the other sections.

Code: Select all

#-----------------------System--------------------
#-----------------------Network-------------------
#-----------------------Memory Load---------------
#-----------------------Processes-----------------
#-----------------------CPU-----------------------

Just how many CPU's do you want it to show?
(I can write it up to 32 but with that many, it would require it's own conky... :rofl: )

Image
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
CharlesV
Global Moderator
Posts: 7313
Joined: Sun Jul 07, 2019 5:11 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#7 Post by CharlesV »

asqwerth wrote: Fri Feb 07, 2025 7:17 pm @siamhie

the conky's network portion starts to work properly when I remove lines 88 to 111 from the first conky config in post 1, which are the lines for the 16-core scenario that will display 16 cpu progress bars and the properly positioned memperc bar after the 16 cpu bars.

I'm left with the 2nd conky config in post 1 after those lines are deleted.

In both cases, the network section of the conky config is NOT changed at all.
I was playing around with this - both the first scripts and then your latest and could not for the life of me see what was going on. However, if you are interested I rearranged a bunch of stuff and made it, what I would consider, much easier to maintain.

Things I changed:
1) I reverted to the system I use, which is having only one load memory area.
2) I reversed the cpu testing, starting at 2 and end at 16.
3) I changed all == to >= in the CPU check and if and end only (ie no elseif )
4) I break down each 2, 4, 6, 8, 10 12 & 16 code blocks to ONLY use displays in those CPU's.
__ Exp: >= 2 only shows CPU1 and CPU2
____ >=4 only shows CPU3 and CPU4
5) Modified the allcombined. lua to include a "position function" move the Memorry Graph according to how many cpu's.

I am *not* saying this is more efficient, but it works on my machines, appears to be the same cpu loads, and to my eye it seems far easier to read.

I also have a version of this where the CPU graph is on the same line as the CPU# and mhz (cause... when I get all my cores a working.. I dont even SEE the network piece on my resolution ;p )

If your interested I will post it.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
asqwerth
Developer
Posts: 7922
Joined: Sun May 27, 2007 5:37 am

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#8 Post by asqwerth »

Yes, please. I would like to see how different minds approach this issue.

But there's no rush. I'll be busy next 8 weeks and won't have time to play with this.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
CharlesV
Global Moderator
Posts: 7313
Joined: Sun Jul 07, 2019 5:11 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#9 Post by CharlesV »

Cool.. I shall double check my code and post it very soon
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
CharlesV
Global Moderator
Posts: 7313
Joined: Sun Jul 07, 2019 5:11 pm

Re: my combined MEGA version of siamhie's MX-Multicore -- need help

#10 Post by CharlesV »

OK, so here are my mods to the MEGA version. (asgarth1 ) Instructions in the tar, as well as how I test them etc. and a screen shot of it.
asgarth1_250208cv.tar
Image


And then my TallBar which is the only way I can see 16 cores on screen :)
CV-TallBar_250210.tar

Image
You do not have the required permissions to view the files attached to this post.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

Post Reply

Return to “Community Submissions”