Show cpu core temp in conky

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Snafu
Level 2
Level 2
Posts: 65
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Show cpu core temp in conky

Post 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?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
When all else fails follow the instructions
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Show cpu core temp in conky

Post 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 ...
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
User avatar
Snafu
Level 2
Level 2
Posts: 65
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Re: Show cpu core temp in conky

Post 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.
Last edited by Snafu on Mon Jul 16, 2018 10:25 pm, edited 1 time in total.
When all else fails follow the instructions
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Show cpu core temp in conky

Post 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.
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
User avatar
Snafu
Level 2
Level 2
Posts: 65
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Re: Show cpu core temp in conky

Post 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}
]]
When all else fails follow the instructions
User avatar
trytip
Level 14
Level 14
Posts: 5366
Joined: Tue Jul 05, 2016 1:20 pm

Re: Show cpu core temp in conky

Post 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
Image
User avatar
Snafu
Level 2
Level 2
Posts: 65
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Re: Show cpu core temp in conky

Post 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
When all else fails follow the instructions
User avatar
trytip
Level 14
Level 14
Posts: 5366
Joined: Tue Jul 05, 2016 1:20 pm

Re: Show cpu core temp in conky

Post 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?
Image
User avatar
Snafu
Level 2
Level 2
Posts: 65
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Re: Show cpu core temp in conky

Post 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
When all else fails follow the instructions
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Show cpu core temp in conky

Post 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}
]]
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Show cpu core temp in conky

Post 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/
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
User avatar
zcot
Level 9
Level 9
Posts: 2833
Joined: Wed Oct 19, 2016 6:08 pm

Re: Show cpu core temp in conky

Post 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:
User avatar
Prsman
Level 4
Level 4
Posts: 398
Joined: Tue Nov 17, 2015 3:15 pm

Re: Show cpu core temp in conky

Post by Prsman »

I also wanted to get my conky to show CPU temp. I tried the script posted here and it did not work. So I played around with it
and still could not get it to work. Off to the 'net I go and found this posted by a Arch linux user. Worked right away on my old
AMD cpu computer.

Code: Select all

Temp: ${color lightgrey}${execi 1200 echo $(($(cat /sys/bus/pci/drivers/k8temp/0000\:00\:18.3/temp1_input) / 1000)) deg. C}
User avatar
cpedretti
Level 3
Level 3
Posts: 199
Joined: Tue Mar 10, 2020 12:06 am

Re: Show cpu core temp in conky

Post by cpedretti »

Here my conky configuration to view gpu and cpu temp:

Code: Select all

${font Arial:bold:size=10}${color #3b71a1}TEMP ${color #3b71a1}${hr 2}
$font${color DimGray}${color DimGray}GPU $alignr ${hwmon 0 temp 1}°C
$font${color DimGray}CPU $alignr ${hwmon 1 temp 2}°C

Output:

Image
AMD Ryzen 7 3700X - 32GB DDR4 RGB White - RTX4060TI O8GB White- SSD NVME Crucial P5 500GB - Mobo Gigabyte AORUS ELITE B550 V2 - PSU Corsair RM750 White - Case Corsair 5000D Airflow White 7 fans AF120 ARGB - AIO Corsair H100I Cappelix 240 White
Locked

Return to “Compiz, Conky, Docks & Widgets”