conky - hddtemp always displays 50c - stretch - mate

Kernels & Hardware, configuring network, installing services

conky - hddtemp always displays 50c - stretch - mate

Postby q76as8 » 2018-07-20 08:21

My hddtemp line reads:

HDD Temp: ${execi 2 hddtemp /dev/sda | cut -c 31-32}°C

This always displays:

HDD Temp: 50°C

No matter what the temperature actually is.

--------------------------------------------------------------------

When I use the cli, it reads properly:

#hddtemp /dev/sda
/dev/sda: Samsung SSD 850 EVO 500G B �@: 37°C
q76as8
 
Posts: 3
Joined: 2018-07-20 08:13

Re: conky - hddtemp always displays 50c - stretch - mate

Postby bw123 » 2018-07-20 13:49

50 is the 31-32 characters in the output... try 46-47?

Code: Select all
$ echo /dev/sda: Samsung SSD 850 EVO 500G B .�.@: 37°C | cut -c 31-32
50
$ man cut
$ echo /dev/sda: Samsung SSD 850 EVO 500G B .�.@: 37°C | cut -c 46-47
37
User avatar
bw123
 
Posts: 3184
Joined: 2011-05-09 06:02
Location: TN_USA

Re: conky - hddtemp always displays 50c - stretch - mate

Postby q76as8 » 2018-07-23 10:14

This works in the cli; but the temp field just goes blank in the conky window.
q76as8
 
Posts: 3
Joined: 2018-07-20 08:13

Re: conky - hddtemp always displays 50c - stretch - mate

Postby Dai_trying » 2018-07-23 15:15

hdtemp requires root privileges and cannot be run by conky without a tweak, you can allow this package to run for your user if you are using the sudo package by adding the following to your etc/sudoers file, replace the "<your user name>" with your actual user name. You will need to reboot for this to take effect.

Code: Select all
<your user name> ALL = (root) NOPASSWD: /usr/sbin/hddtemp


And change your conky line to
Code: Select all
HDD Temp: ${execi 2 sudo /usr/sbin/hddtemp /dev/sda | cut -c 46-47}°C
Dai_trying
 
Posts: 503
Joined: 2016-01-07 12:25


Return to System configuration

Who is online

Users browsing this forum: SavoyRoad, w4kh and 3 guests

fashionable