Page 1 of 1

Show cpu core temp in conky

Posted: Mon Jul 16, 2018 7:30 pm
by Snafu
I've been trying to add cpu core temps to my conky, without success. I've read a dozen guides, most of which confuse me, without finding an answer. I have the command I need sorted,

Code: Select all

$ sensors|grep 'Core 0'|cut -c16-22
but don't know what to do with it. I need a "conky for dummies" guide.
How and where do I add that command so that the output will be displayed?

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 8:46 pm
by phd21
Hi Snafu,

I guess you ran into a snafu with Conky? I do not use Conky although it can be very cool.

Here are some good articles for you to look at: Once you get Conky to do what you want, share a screenshot for us.

My conky
http://martinsosic.com/linux/2015/07/06/my-conky.html

* Cool graph
How to detect processor correct temperature in conky - Ask Ubuntu
https://askubuntu.com/questions/235713/ ... e-in-conky

Show all the cpu cores in conky.
https://classicforum.manjaro.org/index. ... ic=30600.0

Conky and system temperatures / GUI & Applications / BunsenLabs Linux Forums
https://forums.bunsenlabs.org/viewtopic.php?id=789

Conky CPU temperature issue - SOLVED - Page 4 - MX Linux Forum
https://forum.mxlinux.org/viewtopic.php ... 7&start=30


Hope this helps ...

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:02 pm
by Snafu
thanks :).
https://forum.mxlinux.org/viewtopic.php ... was the info I needed.

Code: Select all

${color 66FFFF}core 1 temp   ${color}${hwmon 0 temp 2}C ${alignc 60}
${color 66FFFF}core 2 temp   ${color}${hwmon 0 temp 3}C ${alignc 60}
was the script that worked but it takes some tweaking to make it work.

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:20 pm
by phd21
Hi Snafu,

You are welcome...

Can you show us what your Conky looks like now? If you provide your Conky configuration, and your computer's specs (inxi -Fxzd), that may help others too.

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:41 pm
by Snafu
Image

Code: Select all

$ inxi Fxzd
CPU~Dual core Intel Core2 Duo E4600 (-MCP-) speed/max~1291/2403 MHz Kernel~4.15.0-24-generic x86_64 Up~3:43 Mem~1484.1/1984.1MB HDD~250.1GB(21.7% used) Procs~198 Client~Shell inxi~2.3.56  

Code: Select all

conky.config = {
    alignment = 'middle_left',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
	default_color = 'yellow',
    default_outline_color = 'white',
    default_shade_color = 'white',
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    use_xft = true,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 10,
    gap_y = 10,
    minimum_height = 5,
	minimum_width = 5,
    net_avg_samples = 2,
    buffer = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window_transparent = true,
    own_window_class = 'Conky',
    own_window_type = 'override',
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false
}

conky.text = [[
${color 33FF00} ${scroll 30 $sysname $kernel on $machine | }
$hr
${color 66FFFF}Uptime:$color $uptime
${color 66FFFF}Frequency (in MHz):$color $freq

${color 66FFFF}CPU Usage:   ${color FFFF00} $cpu% ${cpubar 5} 
${color 66FFFF}core 1 temp   ${color}${hwmon 0 temp 2}C ${alignc 60}
${color 66FFFF}core 2 temp   ${color}${hwmon 0 temp 3}C ${alignc 60}
$hr

${color 66FFFF}RAM Usage:${color FFFF00}$mem/$memmax - $memperc% ${membar 5}
${color 66FFFF}Swap Usage:${color FFFF00} $swap/$swapmax - $swapperc% ${swapbar 5}
$hr

${color 66FFFF}Processes:$color $processes  ${color 66FFFF}Running:$color $running_processes
$hr

${color 66FFFF}File systems:
  $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
${color 66FFFF}Networking:
Up:${color FFFF00} ${upspeed tun0} ${color 66FFFF} - Down:${color FFFF00} ${downspeed tun0}
$hr
${color 66FFFF}Name              PID   CPU%   MEM%
${color 33FF00} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color 33FF00} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color 33FF00} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color 33FF00} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
]]

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:45 pm
by trytip
51C is not your correct temperature it is a placebo output. run sensors to see what your temps are named did you run sudo sensors-detect

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:49 pm
by Snafu
51C is not your correct temperature it is a placebo output. run sensors to see what your temps are named did you run sudo sensors-detect
I ran

Code: Select all

sensors|grep 'Core 0'|cut -c16-22
in a terminal and the temps shown by the conky match the output from that command. It's mid winter here and the ambient temp is around 20C

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:54 pm
by trytip
it is rare i see both cores with same temperature , but if sensors gives you the same output then you have a good conky code. what is your sensors output?

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 10:57 pm
by Snafu

Code: Select all

sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +54.0°C  (high = +86.0°C, crit = +100.0°C)
Core 1:       +54.0°C  (high = +86.0°C, crit = +100.0°C)

The temps don't always read the same but they do follow each other up and down. I don't have much open other than this forum so the computer is almost idling

Re: Show cpu core temp in conky

Posted: Mon Jul 16, 2018 11:16 pm
by smurphos
Another conky and conkyrc for reference - this is loosely based on Pjotr's sample conkyrc- https://sites.google.com/site/easylinux ... forxubuntu

Image

Code: Select all

conky.config = {
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    own_window_transparent = false,
    own_window_argb_visual = true,
    own_window_argb_value = 51,
    own_window_hints = 'below',
    own_window_colour = 'black',
    own_window_title = 'NET',
    minimum_width = 320,
    double_buffer = true,
    gap_x = 20,
    gap_y = 50,
    alignment = 'top_right',
    use_xft = true,
    font = 'Roboto-Light:size=8',
    xftalpha = 1,
    override_utf8_locale = true,
    draw_shades = false,
    draw_outline = true,
    default_outline_color = 'black',
    uppercase = false,
    default_color = 'daeaf2',
    color1 = '23b29a',
    color2 = 'CC823F',
    draw_borders = false,
    stippled_borders = 0,
    border_inner_margin = 5,
    border_outer_margin = 0,
    border_width = 0,
    draw_graph_borders = false,
    background = false,
    use_spacer = 'left',
    text_buffer_size = 256,
    no_buffers = true,
    short_units = true,
    pad_percents = 2,
    temperature_unit = 'celsius',
    update_interval = 1,
    if_up_strictness = 'address'
}

conky.text = [[
${font Roboto-Medium:size=10}${color2}${alignc}${nodename}${font}

${color1}Kernel		${color}${kernel}-${machine}\
${color1}${alignr}Uptime		${alignr}${color}${uptime}
${color1}Battery charge		${color}${battery_percent BAT0}%\
${if_match ${battery_percent BAT0} < 100}\
${color1}${alignr}Battery life	${color}${battery_time BAT0}\
${endif}

${font Roboto-Medium:size=10}${color2}${alignc}CPU${font}

${color1}Core 1		${color}${freq_g 1}GHz	${alignr}${cpu cpu1}%  ${cpubar cpu1 5,100}
${color1}Core 2		${color}${freq_g 2}GHz	${alignr}${cpu cpu2}%  ${cpubar cpu2 5,100}
${color1}Core 3		${color}${freq_g 3}GHz	${alignr}${cpu cpu3}%  ${cpubar cpu3 5,100}
${color1}Core 4		${color}${freq_g 4}GHz	${alignr}${cpu cpu4}%  ${cpubar cpu4 5,100}
${color1}Load average		${color}${loadavg}\
${alignr}${color1}CPU temperature    ${color}${acpitemp}°C

${font Roboto-Medium:size=10}${color2}${alignc}RAM${font}

${color1}RAM used / max		${color}${mem} / ${memmax} ${alignr}${color}${memperc}%	${membar 5,100}
${color1}Swap used / max	${color}${swap} / ${swapmax} ${alignr}${color}${alignr}${swapperc}% ${swapbar 5,100}

${font Roboto-Medium:size=10}${color2}${alignc}Processes${font}

${color1}${top name 1}	${tab 50,0}${color}${top cpu 1}%			${color1}${top_mem name 1}${alignr}${color}${top_mem mem_res 1}
${color1}${top name 2}	${tab 50,0}${color}${top cpu 2}%			${color1}${top_mem name 2}${alignr}${color}${top_mem mem_res 2}
${color1}${top name 3}	${tab 50,0}${color}${top cpu 3}%			${color1}${top_mem name 3}${alignr}${color}${top_mem mem_res 3}
${color1}${top name 4}	${tab 50,0}${color}${top cpu 4}%			${color1}${top_mem name 4}${alignr}${color}${top_mem mem_res 4}
${color1}${top name 5}	${tab 50,0}${color}${top cpu 5}%			${color1}${top_mem name 5}${alignr}${color}${top_mem mem_res 5}

${font Roboto-Medium:size=10}${color2}${alignc}Storage${font}

${color1}Root${tab 30,0}${color}${fs_used /} / ${fs_size /} ${color}${alignr}${fs_used_perc /}% ${fs_bar 5,100 /}
${color1}Home${tab 30,0}${color}${fs_used /home} / ${fs_size /home} ${color}${alignr}${fs_used_perc /home}% ${fs_bar 5,100 /home}
${if_mounted /mnt/backup_drive}\
${color1}Backup${tab 30,0}${color}${fs_used /mnt/backup_drive} / ${fs_size /mnt/backup_drive} ${color}${alignr}${fs_used_perc /mnt/backup_drive}% ${fs_bar 5,100 /mnt/backup_drive}\
${else}\
${color1}Backup${tab 30,0}${color}Not Mounted\
${endif}
${if_mounted /home/steve/plex_server_drive}\
${color1}Plex${tab 30,0}${color}${fs_used /home/steve/plex_server_drive} / ${fs_size /home/steve/plex_server_drive} ${color}${alignr}${fs_used_perc /home/steve/plex_server_drive}% ${fs_bar 5,100 /home/steve/plex_server_drive}\
${else}\
${color1}Plex${tab 30,0}${color}Not Mounted\
${endif}
${if_mounted /home/steve/google_drive}\
${color1}G_Drive${tab 30,0}${color}${fs_used /home/steve/google_drive} / ${fs_size /home/steve/google_drive} ${color}${alignr}${fs_used_perc /home/steve/google_drive}% ${fs_bar 5,100 /home/steve/google_drive}\
${else}\
${color1}G_Drive${tab 30,0}${color}Not Mounted\
${endif}

${font Roboto-Medium:size=10}${alignc}${color2}Ethernet${font}

${if_up eno1}\
${color1}Bitrate		${tab 50,0}${color}${execi 3600 cat /sys/class/net/eno1/speed} Mb/s\
${alignr}${color1}IP Address		${color}${addr eno1}
${color1}Total down / up	${alignr}${color}${totaldown eno1}  ${color1}/  ${color}${totalup eno1}
${color1}Speed down / up	${alignr}${color}${downspeed eno1}  ${color1}/  ${color}${upspeed eno1}\
${else}\
${color1}No Ethernet Connection\
${endif}\

${font Roboto-Medium:size=10}${alignc}${color2}Wireless${font}

${if_up wlp1s0}\
${color1}SSID		${tab 50,0}${color}${wireless_essid wlp1s0}\
${alignr}${color1}IP Address	${color}${addr wlp1s0}
${color1}Bitrate/Quality${tab 50,0}${color}${wireless_bitrate wlp1s0}\
${alignr}${color}${wireless_link_qual_perc wlp1s0}%	${wireless_link_bar 5,100 wlp1s0}
${color1}Total down / up	${alignr}${color}${totaldown wlp1s0}  ${color1}/  ${color}${totalup wlp1s0}
${color1}Speed down / up	${alignr}${color}${downspeed wlp1s0}  ${color1}/  ${color}${upspeed wlp1s0}\
${else}\
${color1}No Wireless Connection\
${endif}
]]

Re: Show cpu core temp in conky

Posted: Sun Jul 22, 2018 6:56 pm
by phd21
Hi Snafu and anyone else,

Since I don't use Conky normally, I did not realize that there is also a "conky-manager" desktop gui front-end for this.

How to configure Conky with a GUI-based Conky config tool - Xmodulo
http://xmodulo.com/gui-based-conky-config-tool.html

How to Decorate Your Ubuntu Desktop Using "Conky" Tool
https://www.fossmint.com/conky-for-linux/

How To Install and Use Conky in Ubuntu Linux | It's FOSS
https://itsfoss.com/conky-gui-ubuntu-1304/

Re: Show cpu core temp in conky

Posted: Sun Jul 22, 2018 11:27 pm
by zcot
phd21 wrote:
Sun Jul 22, 2018 6:56 pm
... there is also a "conky-manager" desktop gui front-end for this.
also note, there is an updated version of conky-manager that honors the newer version of conky with it's newer lua-based config files. So conky-manager2 will load/edit/save the 1.10 configs also(which the original does not). Right now it's not a package in Ubuntu repository yet, but it's almost as easy to build/install/uninstall with a few terminal commands. See here: https://github.com/zcot/conky-manager2

btw, for historical reference about the original abandoned conky-manager package: https://github.com/teejee2008/conky-manager/pull/3

ps. some good looking configs there :wink: