Linux Tip: (hdd temp in conky)
I have had a problem for a while now. I wanted to display my hard drive temp's in conky.
To do this I used this command.
sudo hddtemp /dev/sda |
This worked great except for the fact that the conky instance I was using has a .7 second update interval. This made my hard drive light blink constantly and because of where my case was it was quite annoying when watching a movie or something. So to solve this I created a script that I could run in cron that would write the info I needed out to a txt file in my temp directory.
This was the command I used.
sudo hddtemp /dev/sda >> /tmp/hddtemp |
I also added hddtemp to my sudoer so it would not require a password.
The problem I had was the script would work fine if ran manually but when I let cron run it I got no output to the text file.
Well I finally tonight figured out why. You have to specify the location of the command in cron I guess. so this is what I did.
I ran this command
whereis hddtemp |
The output I got was
/usr/sbin/hddtemp
So I modified my cron script like this
/usr/sbin/hddtemp /dev/sda >> /tmp/hddtemp |
Now it works perfect. Every 10 minutes cron updates the text file and I can now see my hard drive temps on my desktop in conky. If you look in the picture my hard drive temps are displayed to the right at the bottom of "system health".
Share