We can get now common average data for all CPUs and pass it into LUA, or we can get data for separate CPU e.g. cpu0, cpu1..... cpuN.
How Can we get for 4 CPUs( cpu0 cpu1 cpu2 cpu3) get (cpu0+cpu1)/2 or (cpu2+cpu3)/2
to get 2 averaged values from 4 CPU? (And how pass it to LUA)
You can do something like this in LUA script
local ct = {}
ct[1] = tonumber(conky_parse('${cpu cpu1}'))
ct[2] = tonumber(conky_parse('${cpu cpu2}'))
ct[3] = tonumber(conky_parse('${cpu cpu3}'))
ct[4] = tonumber(conky_parse('${cpu cpu4}'))
local avg1 = (ct[1] + ct[2])/2
local avg2 = (ct[3] + ct[4])/2
print('avg 1: ' .. avg1, ct[1], ct[2])
print('avg 2: ' .. avg2, ct[3], ct[4])
Just tried but no success - still thinking(arg or name seems has not suitable format), if it is interesting and if your please - mine simple config:
Here is the corrected file - and should work. I have changed a few things to dot notation. Also keep in mind the count starts with cpu1 while cpu0 is average of all your cpus. The data for cpu 3 and 4 is commented out as you just need data for 2 cpus.
Kindly close this issue if things are working as desired.
@Ygarr - I should also suggest that you use current version of conky - and not the legacy 1.9x variant. We are not using that and is quite impossible to support it.
@plikhari Thanks for the help. I think we're done here. Kindly closing this issue.
Most helpful comment
Here is the corrected file - and should work. I have changed a few things to dot notation. Also keep in mind the count starts with
cpu1whilecpu0is average of all your cpus. The data for cpu 3 and 4 is commented out as you just need data for 2 cpus.Kindly close this issue if things are working as desired.
clock_rings.lua.zip