https://pastebin.com/kCkb3pbF
Config 2:
https://pastebin.com/dyAv5qpE
Image:

Code: Select all
${color6}Cpu Temp ${alignr}${color6}${execi 10 sensors | grep 'Core 0' | awk {'print $3'}}${color}
Code: Select all
sensors | grep 'Core 0' | awk {'print $3'}
Code: Select all
sensors | grep 'temp1' | awk {'print $2'}
Code: Select all
cut -c2-5
Code: Select all
sensors | grep 'Core 0' | awk {'print $3'} | cut -c2-5
Code: Select all
CTMP=$(sensors | grep 'Core 0' | awk {'print $3'} | cut -c2-5)
Code: Select all
CTMP=$(sensors | grep 'Core 0' | awk {'print $3'} | cut -c2-5); echo $CTMP;
celcius_temp * 9 / 5 + 32
Code: Select all
CTMP=$(sensors | grep 'Core 0' | awk {'print $3'} | cut -c2-5); echo "scale=1; ${CTMP} * 9 / 5 + 32" | bc
Code: Select all
${color6}Cpu Temp ${alignr}${color6}${execi 10 CTMP=$(sensors | grep 'Core 0' | awk {'print $3'} | cut -c2-5); echo "scale=1; ${CTMP} * 9 / 5 + 32" | bc}${color}
°F
for sure. Code: Select all
Up : $uptime
DNUP: ${color green}${downspeedf wlx74da383b4124} ${upspeedf wlx74da383b4124}KiB : ${color yellow}/SDA:${diskio sda} ${color}
CPU%: ${cpu cpu1}% ${cpu cpu2}% : CPUf: ${freq cpu1} ${freq cpu2}
CTMP: ${exec sensors -f | grep 'Core 0' | cut -c15-21 } ${exec sensors -f | grep 'Core 1' | cut -c15-21 }F
RAM : $mem/$memmax - $memperc% ${membar 6}
SWP : $swap/$swapmax - $swapperc% ${swapbar 6}
lol..Flemur wrote: ⤴Fri May 11, 2018 9:26 amCode: Select all
CTMP: ${exec sensors -f | grep 'Core 0' | cut -c15-21 } ${exec sensors -f | grep 'Core 1' | cut -c15-21 }F
sensors -f
. Who'da thunk it. And why not just cut the temp right out of it since it's always predictable output. Code: Select all
${color Tan1}CPU Usage:${color9}$alignr${cpubar 8,145} ${color9}$cpu%@${freq_g cpu}GHz
${color1}CPU 0 ${offset 9}${color9}${cpu cpu0}% (${execi 8 sensors | grep -A 1 'temp1' | cut -c16-19 | sed '/^$/d'}°C)
${color1}CPU 1 ${offset 9}${color9}${cpu cpu1}% (${execi 8 sensors | grep -A 1 'temp1' | cut -c16-19 | sed '/^$/d'}°C)
so in grepasinoro wrote: ⤴Fri May 11, 2018 10:22 amCode: Select all
${color1}CPU 0 ${offset 9}${color9}${cpu cpu0}% (${execi 8 sensors | grep -A 1 'temp1' | cut -c16-19 | sed '/^$/d'}°C)
-A 1
gives an extra line after it finds the 'temp1' line, then cut brings the right data from the correct line, but then sed removes the rest and the extra line? Is that correct?is it the same thing:-A, --after-context=NUM print NUM lines of trailing context
Code: Select all
${color1}CPU 0 ${offset 9}${color9}${cpu cpu0}% (${execi 8 sensors | grep 'temp1' | cut -c16-19}°C)
Code: Select all
${color1}CPU 0 ${offset 9}${color9}${cpu cpu0}% (${execi 8 CTMP=$(sensors | grep 'temp1' | cut -c16-19); echo -n ${CTMP}"°C / "; echo "scale=1; ${CTMP} * 9 / 5 + 32" | bc}°F)
I've always used hwmon, as that's how I first saw it, and exec seemed like something for advanced things.
"exec: Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch."
Makes sense, thankfully I have yet to run into a situation where hwmon or platform didn't work for me. Using exec sensors for something as simple as CPU temp seems to add complexity to a simple task, but whatever works, works...(hopefully)zcot wrote: ⤴Wed May 16, 2018 4:00 pmI've always used hwmon, as that's how I first saw it, and exec seemed like something for advanced things.
I would think hwmon would be a more efficient approach, although the data is potentially different on each system so each person has to know what to go looking for(or just randomly test devices 0, 1, etc. and for each possible sensor 0, 1, 2), to tweak each config. Maybe it seems easier just looking at the sensors output then finding how to grep it for the situation?
but, for that matter, the output from sensors is equally different on any system too, and you still end up tweaking the values.
The conky variables doc does say,"exec: Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch."
So, it's a good point, and in these cases it would also eliminate the grep, cut, and more, even aside from the more resources of using exec.