You are not logged in.

#1 2015-12-02 20:44:47

Registered: 2015-10-25
Posts: 18

Conky and system temperatures

This newbish conky editing guide is posted as much for my own future reference as yours. wink I don't see any other posts about hddtemp etc. on so this is a quick guide to setting up conky to show system monitoring information.

CPUs, GPUs, voltages and fans

The first step is to find out what information your hardware provides, and to backup your .conkyrc file! For the latter, type this:

cp .conkyrc .conkyrc-backup

For the former, continue on...

  1. Conky provides a $(hwmon) variable that can read some information, but because chips can report whatever information they want, this may not be useful. You can browse around in /sys/class/hwmon to see what's there (that's what conky reads).

    AFAIK, to simplify/consolidate all the sensor information, it's best to set up the sensors program. This was already installed on my BL box, but not configured. To configure, you type

    sudo sensors-detect

    It will ask your permission to probe in various ways for sensor information. Once it finishes, you can type


    to get all the readings from sensors it detected. The tricky part here is figuring out what the information given by the sensors in your hardware mean. For example, here's the sensors output for my system:

    Adapter: ISA adapter
    in0:          +0.85 V  (min =  +0.00 V, max =  +4.08 V)
    in1:          +1.49 V  (min =  +0.00 V, max =  +4.08 V)
    in2:          +3.34 V  (min =  +0.00 V, max =  +4.08 V)
    +5V:          +3.01 V  (min =  +0.00 V, max =  +4.08 V)
    in4:          +3.07 V  (min =  +0.00 V, max =  +4.08 V)
    in5:          +2.14 V  (min =  +0.00 V, max =  +4.08 V)
    in6:          +2.14 V  (min =  +0.00 V, max =  +4.08 V)
    5VSB:         +2.98 V  (min =  +0.00 V, max =  +4.08 V)
    Vbat:         +3.25 V  
    fan1:        2020 RPM  (min =   10 RPM)
    fan2:           0 RPM  (min =    0 RPM)
    fan3:           0 RPM  (min =    0 RPM)
    temp1:        +43.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
    temp2:        +43.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
    temp3:        +42.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = Intel PECI
    cpu0_vid:    +0.000 V
    intrusion0:  OK
    Adapter: PCI adapter
    APU temp:     +26.4°C  (high = +70.0°C)
    Adapter: PCI adapter
    Radeon temp:  +34.0°C  (crit = +120.0°C, hyst = +90.0°C)

    (Note: this is after i renamed the two identifying themselves as APU temp and Radeon temp, following instructions elsewhere. That step is not necessary.)

    You might find out additional information about what these readings mean by searching the reporting chip name (for example, from googling it8720-isa-0228 i discovered that the in0 reading is the Vcore, in1 is the Vdram, etc.). Once you have deciphered both what each reading represents, and if it has to be modified (maybe the number isn't an actual voltage, or the temperature reads 20 degrees low, for example), you can then display that information in conky as you like.

    In this case, if i use the ${hwmon temp} options from conky, what it returns are temp1, temp2 and temp3 from it8720-isa-0228, which i can tell from experimentation are NOT my GPU or CPU temps (when put under load these don't change quickly). The same source i mentioned above suggests that one of those temps is in fact the CPU casing temperature, but without a reference from the manufacturer it's very difficult to know for sure.

    In any case, there are two ways to access this sensor data in conky. You can specify the hdmon conky variable by indexing into the sensor chip and temperature probe, or you can parse the information directly from the output of sensors. These are covered in the respective two steps.

  2. You can do some comparison between the hwmon output and the sensors output to make sure you use the right data in conky. In my case,

    ${hwmon 0 temp 1}

    is the first temperature probe in the first sensor chip (it8720-isa-0228),

    ${hwmon 1 temp 1}

    is the temperature probe in the second sensor chip (k10temp-pci-00c3), so that's what i'd use to report my CPU temperature, and 

    ${hwmon 2 temp 1}

    is the temperature probe in the GPU. In other words, it seems to index starting at 0 into the sensor chip, in the same order as they are listed in sensors and starting at 1 into the temperature probes. YMMV. See this $(hwmon) link for more details.

  3. If instead for whatever reason you want to parse the output of the sensors command to get the information you want, you can adapt the following. To use the values given for my specific system by the k10temp-pci-00c3 and radeon-pci-0100 sensors (which, one might reasonably assume, are respectively the CPU and GPU temperatures) in conky, we need to parse out that data from the sensors output:

    ${execi 2 sensors | grep APU | cut -c 16-19}
    ${execi 2 sensors | grep Radeon | cut -c 16-19}

    This takes the output from sensors (again, the output on my system is listed above for reference) every 2 seconds, searches for a line containing 'APU' (or 'Radeon') and then trims it down to characters 16-19.

Hard drives

  1. You must first enable the daemon of the hddtemp program that will report to conky.

    sudo nano /etc/default/hddtemp

    Find the line that defines the variable RUN_DAEMON and change it from false to true:


    Ctrl-X and "y" to save and exit.

  2. Then you can modify your .conkyrc file in your home directory:
    Menu->Preferences->Conky->Edit Conkys->Default conkyrc

    geany ~/.conkyrc

    and add the conky variables for the hard drive temperatures


    The above will list the temperature for the first hard drive. If you have more than one, you need to specify the device for each:

    ${hddtemp /dev/sda}°C
    ${hddtemp /dev/sdb}°C

    If you want to see all the possibilities, run hddtemp from the console with a wildcard:

    sudo hddtemp /dev/sd?

Putting it all together: Conky code
I've made simple modifications to the default BL conky to display the load and frequency of my CPU cores and the temperatures as discussed above. This is the modified portion of the .conkyrc file:

CPU:${goto 60}Used${alignr}GHz
Avg${goto 60}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%${alignr}
# FYI the if/then mess in each of these is to keep the number position 
# from shifting back and forth if 1, 2 or 3 digits are necessary to display 
# the used percent.
Core1${goto 60}${if_match ${cpu cpu1}<10}  ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}%${alignr}${freq_g 1}
Core2${goto 60}${if_match ${cpu cpu2}<10}  ${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100} ${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}%${alignr}${freq_g 2}
Core3${goto 60}${if_match ${cpu cpu3}<10}  ${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100} ${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}%${alignr}${freq_g 3}
Core4${goto 60}${if_match ${cpu cpu4}<10}  ${cpu cpu4}\
${else}${if_match ${cpu cpu4}<100} ${cpu cpu4}\
${else}${cpu cpu4}${endif}${endif}%${alignr}${freq_g 4}

#Option 2 in instructions above
CPU${goto 60}A8-3820${alignr}${hwmon 1 temp 1}°C
GPU${goto 60}Radeon HD 6570${alignr}${hwmon 2 temp 1}°C
#Option 3 in instructions above (commented out because i use option 2 now; #3 does 
#  give 1 extra decimal precision though
#CPU${goto 60}A8-3820${alignr}${execi 2 sensors | grep APU | cut -c 16-19}°C
#GPU${goto 60}Radeon HD6570{alignr}${execi 2 sensors | grep Radeon | cut -c 16-19}°C
#Hdd temp listings
HD0${goto 60}WD10EACS-00ZJB0${alignr}${hddtemp /dev/sda}°C
HD1${goto 60}SDSSDXPS480G${alignr}${hddtemp /dev/sdb}°C


Last edited by Pouletic (2015-12-04 23:48:50)


#2 2015-12-02 22:14:52

Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: Conky and system temperatures

Awesome work! Is there anyway to have the ability to change the names from WD10EAC..etc... to a custom name?

"I have not failed, I have found 10,000 ways that will not work" -Edison


#3 2015-12-02 22:23:39

Registered: 2015-10-25
Posts: 18

Re: Conky and system temperatures

Horizon_Brave wrote:

Awesome work! Is there anyway to have the ability to change the names from WD10EAC..etc... to a custom name?

Thanks. As you can see in the .conkyrc code, those are just the names i assigned, based on the output of the hddtemp call from the command line. You can change any of the plain text in that partial .conkyrc i posted when you add it to yours... That means anything not inside a

${ }

, which is how conky variables are marked. Of course, you may need to modify what's inside the variables to use the right sources from your own hardware sensors. Hopefully this guide will help you figure that part out.

BTW, as soon as you save the .conkyrc file, you will see the conky reload and reflect the changes. I would suggest you make a backup before you start in case you break it. smile

Last edited by Pouletic (2015-12-02 22:38:08)


#4 2015-12-02 23:31:45

Registered: 2015-10-05
Posts: 148

Re: Conky and system temperatures

Pouletic wrote:
cut -c 16-19

...trims it down to characters 16-19.

I'm currently working on a new conky and this has been a big help.

Thank you.


#5 2015-12-03 03:24:24

From: Norman, Oklahoma-USA
Registered: 2015-09-29
Posts: 412

Re: Conky and system temperatures

@ Pouletic: I normally don't use a big conky, instead a ribbon or line conky for the minimalistic approach.  Decided to employ the script for multiple HDs temps and see what I get, worked nicely.  Thanks - zephyr

# conky configuration
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check for an up-to-date-list.
# For ideas about how to modify conky, please see:
# For help with conky, please see:
# Enjoy! :)

# Settings
background yes
use_xft yes
xftfont terminus:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
draw_borders no
#own_window_argb_visual yes
#own_window_type desktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window yes
#own_window_transparent yes
#own_window_class conky-semi
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_colour 000000
own_window_class Conky
double_buffer yes
minimum_size 260 260
maximum_width 260
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color 4c4c4c
default_shade_color black
default_outline_color 4c4c4c
alignment top_right
gap_x 05	
gap_y 85
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
${color 4c4c4c}${hr}
${color 5c5c5c}${font terminus:normal:size=9}BL $kernel $alignr $machine
${color 4c4c4c}${font terminus:normal:size=8}Host:$alignr$nodename
${color 4c4c4c}${font terminus:normal:size=8}Uptime:$alignr$uptime
${color 4c4c4c}${font terminus:normal:size=8}File System: $alignr${fs_type}

${color 4c4c4c}${font terminus:normal:size=9}Cpu: Amd AM3 / FX 8320 8 core 
${color 4c4c4c}${font terminus:normal:size=9}Mobo: Asus M5A97 / r2.0
${color 4c4c4c}${font terminus:normal:size=9}Graphics: Asus Amd / Ati-Radeon  HD 7770
${color 4c4c4c}${font terminus:normal:size=9}Audio: Asus Xonar DS pci 7.1 (oxygen HD-CMI8788)
${color 4c4c4c}${font terminus:normal:size=9}Keybd: Razer Blk Widow Ult 2014

${color 4c4c4c}${font terminus:normal:size=8}Cpu Avg Percent Total: ${color 4c4c4c}${cpu cpu0} % 
${color 4c4c4c}${cpugraph 25 ff0000 0000ff}
${color 4c4c4c}${font terminus:normal:size=8}${color 4c4c4c}CPU TEMP: ${color 5c5c5c}${exec sensors | grep -n 'temp1' | sed -n 2p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'} 
${color 4c4c4c}${font terminus:normal:size=8}PROCESSORS ${hr}${font}${color 4c4c4c}
Core1: ${cpu cpu1}% $alignr ${exec awk '/cpu MHz/{i++}i==1{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu1 6,150}
Core2: ${cpu cpu2}% $alignr ${exec awk '/cpu MHz/{i++}i==2{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu2 6,150}
Core3: ${cpu cpu3}% $alignr ${exec awk '/cpu MHz/{i++}i==3{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu3 6,150}
Core4: ${cpu cpu4}% $alignr ${exec awk '/cpu MHz/{i++}i==4{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu4 6,150}
Core5: ${cpu cpu5}% $alignr ${exec awk '/cpu MHz/{i++}i==5{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu5 6,150}
Core6: ${cpu cpu6}% $alignr ${exec awk '/cpu MHz/{i++}i==6{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu6 6,150}
Core7: ${cpu cpu7}% $alignr ${exec awk '/cpu MHz/{i++}i==7{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu7 6,150}
Core8: ${cpu cpu8}% $alignr ${exec awk '/cpu MHz/{i++}i==8{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignc ${cpubar cpu8 6,150}

${color 4c4c4c}${font terminus:normal:size=9}MEMORY 
${color 4c4c4c}${font terminus:normal:size=8}RAM ${color 4c4c4c}$alignc $mem / $memmax $alignr $memperc %
${color 4c4c4c}${font terminus:normal:size=8}$membar

${color 4c4c4c}${font terminus:normal:size=9}HDD P4 1TB ${color 5c5c5c}BL 4.2 / fluxbox  
${color 4c4c4c}${font terminus:normal:size=8}HDD TEMP P4: ${color 5c5c5c}${hddtemp /dev/sde} P0°C${hddtemp /dev/sda} P1°C${hddtemp /dev/sdb} P2°C${hddtemp /dev/sdc} P3°C${hddtemp /dev/sdd}°C
${color 4c4c4c}${font terminus:normal:size=8}/home $alignc ${fs_used /home} / ${fs_size /home} $alignr ${fs_used_perc /home}%
${color 4c4c4c}${fs_bar /home}
${color 4c4c4c}${font terminus:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
${color 4c4c4c}${fs_bar /}
${color 4c4c4c}SWAP $alignc ${swap} / ${swapmax} $alignr ${swapperc}%
${color 4c4c4c}${swapbar}

${color 4c4c4c}${font terminus:normal:size=8}TOP PROCESSES 
${color 4c4c4c}${font terminus:normal:size=8}${top_mem name 1}${color 4c4c4c}${alignr}${top mem 1} %
${color 4c4c4c}${font terminus:normal:size=8}${top_mem name 2}${color 4c4c4c}${alignr}${top mem 2} %
${color 4c4c4c}${font terminus:normal:size=8}${top_mem name 3}${color 4c4c4c}${alignr}${top mem 3} %
${color 4c4c4c}${font terminus:normal:size=8}${top_mem name 4}${color 4c4c4c}${alignr}${top mem 4} %
${color 4c4c4c}${font terminus:normal:size=8}${top_mem name 5}${color 4c4c4c}${alignr}${top mem 5} %

${color 4c4c4c}${font terminus:normal:size=8}NETWORK-eth0-
${color 4c4c4c}DOWN: ${color 4c4c4c}${downspeed eth0} k/s	         ${color 4c4c4c}   UP:${color 4c4c4c}${upspeed eth0} k/s
${color 4c4c4c}${downspeedgraph eth0 20,145 ff0000 0000ff}	  ${color 4c4c4c}${upspeedgraph eth0 20,140 0000ff ff0000}
${color 4c4c4c}TOTAL: ${color 4c4c4c}${totaldown eth0}	         ${color 4c4c4c}   TOTAL:${color 4c4c4c}${totalup eth0}

Last edited by zephyr (2015-12-03 04:55:50)


#6 2015-12-03 09:56:10

From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,527

Re: Conky and system temperatures

Thank you for this! Many of us are interested in keeping an eye on temperatures.

Pouletic wrote:

If you find that those hwmon temp values are in fact what you want to display, you can do so like this:

${hwmon temp 1}

(or temp 2, etc., see this $(hwmon) link for details).
   Otherwise, you'll have to parse the output of the sensors command to get the information you want.

I'm not a conky expert, but before you go to grep or sed you can access other monitors by setting a number before temp. (See here.) My 'sensors' returns this (edited):

Adapter: ISA adapter
Core 0:       +23.0°C  (high = +89.0°C, crit = +105.0°C)
Core 2:       +22.0°C  (high = +89.0°C, crit = +105.0°C)

Adapter: PCI adapter
temp1:        +39.0°C  (high = +100.0°C, crit = +110.0°C)

Adapter: ISA adapter
temp1:        +30.0°C  (high = +255.0°C, hyst = +251.0°C)
temp2:        +28.0°C  (high = +255.0°C, hyst = +251.0°C)
temp3:        +27.0°C  (high = +255.0°C, hyst = +253.0°C)

and I use this

core 0:$alignr${hwmon 0 temp 2}°C
core 2:$alignr${hwmon 0 temp 4}°C
nouveau:$alignr${hwmon 1 temp 1}°C
f71889fg 1:$alignr${hwmon 2 temp 1}°C
f71889fg 2:$alignr${hwmon 2 temp 2}°C
f71889fg 3:$alignr${hwmon 2 temp 3}°C

So hwmon 0 corresponds to ISA, hwmon 1 to nouveau and hwmon 2 to f71889fg. What number to put next isn't obvious - Core 0 is hwmon 0 temp2, and Core 2 is hwmon 0 temp 4. I just tried all the combinations I could think of and compared conky's display with the output of 'sensors' till it sort of made sense...

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop


#7 2015-12-03 10:25:36

From: Norman, Oklahoma-USA
Registered: 2015-09-29
Posts: 412

Re: Conky and system temperatures

@johnraff: Thank you for your input as well, I'm not an expert either and do tinker around occasionally just usually to see what happens. I find the scrips interesting and appreciate the suggestions. -zephyr


#8 2015-12-04 23:19:23

Registered: 2015-10-25
Posts: 18

Re: Conky and system temperatures

johnraff wrote:

Thank you for this! Many of us are interested in keeping an eye on temperatures.
I'm not a conky expert, but before you go to grep or sed you can access other monitors by setting a number before temp. (See here.)

Thanks. I'm not sure why i never noticed you can index the sensor chip that way. Cool. The execi way does get me one extra numeral of precision, but it's probably more processor intensive, so i'll go with the built-in conky variables.

I'll update the guide.


#9 2015-12-05 00:34:04

Registered: 2015-09-29
Posts: 857

Re: Conky and system temperatures

Cool stuff.  I've had placeholders under conky marked Under Construction since #! for such info.  Thanks to the OP and everyone else's input.


#10 2015-12-16 18:59:13

Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,028

Re: Conky and system temperatures

The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.


#11 2016-02-29 10:02:10

New Member
Registered: 2015-12-29
Posts: 3

Re: Conky and system temperatures

Thank you for great article. It helped me so much!


#12 2016-02-29 10:33:04

Registered: 2015-12-16
Posts: 738

Re: Conky and system temperatures

Would be nice to be able to dynamically add/remove these entries when adding/removing devices.


#13 2016-03-01 19:11:11

Registered: 2015-11-08
Posts: 152

Re: Conky and system temperatures

Nice work!


#14 2016-12-12 18:40:56

Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,028

Re: Conky and system temperatures

If you are wondering what some of those cryptic "sensors" are for ... 'inxi' can help.

And alias: sensen

alias sensen='sensors && echo '=-=-=-=-=-=-=' && inxi -s'
 12 Dec 16 @ 15:37:51 ~
  $ sensen
Adapter: Virtual device
temp1:        +30.0°C  (crit = +110.0°C)

Adapter: ISA adapter
+3.3V:        +3.49 V  
in1:          +1.25 V  
in2:          +1.50 V  
in3:          +0.86 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
3VSB:         +3.39 V  
Vbat:         +3.02 V  
fan1:        2732 RPM
fan2:           0 RPM  ALARM
fan3:           0 RPM  ALARM
temp1:        +49.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +255.0°C, hyst = +251.0°C)  sensor = transistor
temp2:        +47.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)  sensor = thermistor
temp3:       +127.0°C  (high = +70.0°C, hyst = +68.0°C)  ALARM (CRIT)
                       (crit = +85.0°C, hyst = +83.0°C)  sensor = transistor

Adapter: PCI adapter
temp1:        +39.5°C  (high = +70.0°C)

Sensors:   System Temperatures: cpu: 47.0C mobo: 40.0C gpu: 59C
           Fan Speeds (in rpm): cpu: 2732 fan-2: 0 fan-3: 0
 12 Dec 16 @ 15:37:55 ~

Now you can match-up the output values in sensors with the hardware in inxi.  smile

ie:  My CPU temp:

CPU ${platform f71882fg.2560 temp 2}°

The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.


Board footer

Powered by FluxBB