[SOLVED]Anyone aware of Conky (cpu temperature)?

Forum rules
Before you post please read how to get help
Post Reply
Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

[SOLVED]Anyone aware of Conky (cpu temperature)?

Post by Valsodar » Mon Jul 30, 2018 3:01 pm

Is anyone aware of Conky? I'm trying to make it to show the CPU temperature of "Package id 0: 38.0 C". I found a command in the ubuntu forum which is

Code: Select all

 ${execi 1 sensors -u | grep -A 0 'temp2_input' | cut -c 15-19} C
but I don't want a graph and don't need the plus symbol in the temperature, so I changed it to

Code: Select all

${sensors | grep -A 0 'temp2_input' | cut -18-21} C
but all I get as output on the Conky window is this:

Code: Select all

${sensors} C
What am I doing wrong?
Last edited by Valsodar on Mon Jul 30, 2018 6:27 pm, edited 1 time in total.

User avatar
MintBean
Level 9
Level 9
Posts: 2969
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Anyone aware of Conky?

Post by MintBean » Mon Jul 30, 2018 3:22 pm

It should read '-c' after 'cut' as it does in the command you're copying.

User avatar
richyrich
Level 19
Level 19
Posts: 9027
Joined: Mon May 04, 2009 8:31 pm

Re: Anyone aware of Conky?

Post by richyrich » Mon Jul 30, 2018 3:23 pm

Sorry I cannot help with your dilema, but I wanted you to realize there is a Mint subforum that may give you some help . .

Compiz, Conky, Docks, & Widgets

Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Anyone aware of Conky?

Post by Valsodar » Mon Jul 30, 2018 3:31 pm

richyrich wrote:
Mon Jul 30, 2018 3:23 pm
Sorry I cannot help with your dilema, but I wanted you to realize there is a Mint subforum that may give you some help . .

Compiz, Conky, Docks, & Widgets
Thanks, I will know for the next time I need help with widgets. But for now a moderator could move the topic there, if they feel it's necessary.
MintBean wrote:
Mon Jul 30, 2018 3:22 pm
It should read '-c' after 'cut' as it does in the command you're copying.
I added the '-c' and refreshed the app but it still shows the same thing.

User avatar
MintBean
Level 9
Level 9
Posts: 2969
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Anyone aware of Conky?

Post by MintBean » Mon Jul 30, 2018 5:00 pm

Looks like your brackets are wrong too - curly and round aren't interchangeable.

echo $(sensors | grep -A 0 'Core 0' | cut -c 17-22)CThis works to print CPU core 0 temp in a command window. Shouldn't be too difficult to paste into Conky.

Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: Anyone aware of Conky?

Post by Valsodar » Mon Jul 30, 2018 6:26 pm

Actually I already found a way to have it show what I wanted and the way I wanted: ${hwmon 0 temp 1}°C
A big help for setting everything up was this website: http://conky.sourceforge.net/variables.html

Code: Select all

background yes
double_buffer yes

alignment top_right

border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no

gap_x 4
gap_y 4
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no

own_window yes
own_window_type desktop
own_window_transparent no
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 102
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

minimum_size 190 300
stippled_borders 0
update_interval 2.0
uppercase no
use_spacer none

show_graph_scale no
show_graph_range no

use_xft yes
xftalpha 0.1
xftfont Noto Sans:size=15
color0 FFFFFF 	#white
color1 FF0000	#red
color2 FFFF00	#yellow
color3 00BF00	#nVidia green
color4 00BFFF	#sky blue
color5 FF6700	#orange

TEXT
${color4}CPU Load ${color4}${alignr}${cpu cpu0}%
${color1}CPU Temperature ${color1}${alignr}${hwmon 0 temp 1}°C

${color5}RAM USED ${color5}${alignr}${mem} ${color0}/ ${color2}${memmax}
${color0}${membar 5,} ${color5}
${top_mem name 1} $alignr ${top_mem mem_res 1}
${top_mem name 2} $alignr ${top_mem mem_res 2}
${top_mem name 3} $alignr ${top_mem mem_res 3}

${color3}GPU ${color0}${alignr}
-------------------------------------------------
${color3}GPU Temp ${alignr}${color5}${nvidia temp} C
${color3}Fan Speed ${alignr}${color5}${execi 5 nvidia-settings -q [fan:0]/GPUCurrentFanSpeed -t} %
${color3}GPU Clock ${alignr}${color5}${nvidia gpufreq} MHz
${color3}Mem Clock ${alignr}${color5}${nvidia memfreq} MHz
${color3}Mem Used ${alignr}${color5}${execi 5 nvidia-settings -q [gpu:0]/UsedDedicatedGPUMemory -t} / ${exec nvidia-settings -q [gpu:0]/TotalDedicatedGPUMemory -t} MiB

${alignc}${color2}Filesystem used space
${color5}${alignc}${fs_used /mnt/} ${color0}/ ${color2}${fs_size}
Image

User avatar
all41
Level 13
Level 13
Posts: 4857
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: [SOLVED]Anyone aware of Conky (cpu temperature)?

Post by all41 » Mon Jul 30, 2018 6:35 pm

Hi Valsodar,
I see it depends on the system and the Mint version.
This is a statement from my conky.rc for Mint 19:
{execi 2 cat /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp2_input | cut -c1,2}C

So you have a resolution and that is good news.
Please mark your topic as solved by returning to your opening post at the top of this thread,
click the 'pencil' (edit) icon and mark the thread as [SOLVED] in the subject window to help others find your solution.
Proud to be a supporter and monthly contributor to Mint.

Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: [SOLVED]Anyone aware of Conky (cpu temperature)?

Post by Valsodar » Mon Jul 30, 2018 6:51 pm

I already marked it as solved immediately after I posted I found a solution.

User avatar
zcot
Level 2
Level 2
Posts: 71
Joined: Wed Oct 19, 2016 6:08 pm

Re: [SOLVED]Anyone aware of Conky (cpu temperature)?

Post by zcot » Tue Jul 31, 2018 9:53 pm

just for the information value...

The current conky wiki is here: https://github.com/brndnmtthws/conky/wiki

and as the developer mentions, the ${hwmon} option is the preferred method, as opposed to exec and using sensors and grep and cut, etc.

Valsodar
Level 3
Level 3
Posts: 142
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

Re: [SOLVED]Anyone aware of Conky (cpu temperature)?

Post by Valsodar » Thu Aug 30, 2018 3:43 pm

zcot wrote:
Tue Jul 31, 2018 9:53 pm
just for the information value...

The current conky wiki is here: https://github.com/brndnmtthws/conky/wiki

and as the developer mentions, the ${hwmon} option is the preferred method, as opposed to exec and using sensors and grep and cut, etc.
Today I discovered{hwmon 0 temp 2} shows the actual change of temperature, when the CPU is loaded by different tasks, while 'temp 1' somehow gets the temperature "stuck" at the same value for a long time and even if the temperature in the room is 18 degrees, the value remains at the high temperature you can see when outside is 40 degrees in the shade.
Unfortunately I couldn't find any options syntax or explanation of the difference between 'temp 1' and 'temp 2'.

User avatar
zcot
Level 2
Level 2
Posts: 71
Joined: Wed Oct 19, 2016 6:08 pm

Re: [SOLVED]Anyone aware of Conky (cpu temperature)?

Post by zcot » Thu Aug 30, 2018 9:49 pm

Valsodar wrote:
Thu Aug 30, 2018 3:43 pm
zcot wrote:
Tue Jul 31, 2018 9:53 pm
just for the information value...

The current conky wiki is here: https://github.com/brndnmtthws/conky/wiki

and as the developer mentions, the ${hwmon} option is the preferred method, as opposed to exec and using sensors and grep and cut, etc.
Today I discovered{hwmon 0 temp 2} shows the actual change of temperature, when the CPU is loaded by different tasks, while 'temp 1' somehow gets the temperature "stuck" at the same value for a long time and even if the temperature in the room is 18 degrees, the value remains at the high temperature you can see when outside is 40 degrees in the shade.
Unfortunately I couldn't find any options syntax or explanation of the difference between 'temp 1' and 'temp 2'.
hwmon # and temp # will be determined by the motherboard and cpu setup and kernel dealings. There's no specific documentation especially.

You can look in your filesystem at /sys/class/hwmon and see hwmon0, hwmon1, etc. directories. And inside each of those there is file named 'name'. That will give an indication of what that hwmon # directory is dealing with. If it says nouveau, it's gpu related, if it says for example k10temp then you know it's a specific model amd cpu(this is the one I have right now). There are various modules that could be in use depending on the hardware and kernel relationship to that hardware, and you have to find the interesting one. Also inside a hwmon# directory are sets of files named temp1_* and maybe also temp2_* and possibly more and those deal with whatever is available for that piece of hardware. To get deeper into that you could dig into the specifics of a kernel module here: https://www.kernel.org/doc/Documentation/hwmon/ and/or do other web searches such as: kernel module k10temp

on that k10temp for example it's not an actual temperature value, it's some composite number based on some scheme... so you end up reading the module info about it then coming up with a script adjustment to make a calculation to an actual temp. :shock:

You could end up with a variety of other motherboard temps or even other hardware temps.

And, If you can have the availability to check the cpu temp in the bios/uefi then it might help to cross-reference which indicator is what. :wink:

Post Reply

Return to “Compiz, Conky, Docks, & Widgets”