Using Sensors (en)
From Conky PitStop
(Created page with "__NOTITLE__ =Using Sensors= Category:English Category:Programs (en) Category:Tips and tricks (en) {{i18n|en|Using Sensors}} Using Sensors in Conky This information co...") |
|||
Line 60: | Line 60: | ||
Happy conkying | Happy conkying | ||
- | Bruce | + | <br>Bruce |
Revision as of 12:30, 24 March 2011
Using Sensors
Language | English Français |
Using Sensors in Conky
This information comes from one of my Conky mentors: John.Michael.Kane
By sensors you need to install lm-sensors and then run in Terminal:
sudo sensors-detect
answering Yes (default) to all questions, even that last one that defaults to No
Now restart your session and in Terminal:
sensors
to show you what you can use in conky:
bruloo@bruloo:~$ sensors acpitz-virtual-0 Adapter: Virtual device temp1: +21.8°C (crit = +96.8°C) k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +48.0°C w83627thf-isa-0290 Adapter: ISA adapter VCore: +1.39 V (min = +0.70 V, max = +1.87 V) +12V: +12.28 V (min = +8.94 V, max = +0.24 V) ALARM +3.3V: +3.14 V (min = +1.47 V, max = +3.98 V) +5V: +4.83 V (min = +5.97 V, max = +4.59 V) ALARM -12V: -11.87 V (min = -13.10 V, max = -13.59 V) ALARM V5SB: +5.00 V (min = +0.24 V, max = +1.96 V) ALARM VBat: +2.94 V (min = +1.01 V, max = +3.09 V) fan1: 0 RPM (min = 168750 RPM, div = 2) ALARM CPU Fan: 24107 RPM (min = -1 RPM, div = 8 ) ALARM fan3: 4530 RPM (min = 9926 RPM, div = 2) ALARM M/B Temp: +44.0°C (high = +12.0°C, hyst = +8.0°C) ALARM sensor = thermistor CPU Temp: +47.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor temp3: +15.0°C (high = +80.0°C, hyst = +75.0°C) sensor = diode cpu0_vid: +0.000 V beep_enable:enabled bruloo@bruloo:~$
Looking at “Core0 Temp: +48.0°C” – we see that the 14th character/space is +, so lets start there:
Conky Code:
Core Temp: ${execi 8 sensors | grep -A 1 'Core0 Temp' | cut -c14-14 | sed '/^$/d'} Core Temp: ${execi 8 sensors | grep -A 1 'Core0 Temp' | cut -c15-16 | sed '/^$/d'} Core Temp: ${execi 8 sensors | grep -A 1 'Core0 Temp' | cut -c14-21 | sed '/^$/d'}Those three lines created the conky lines on the left.
Now as you see that first line with 14-14 in it only shows the + so by some simple math I see that 15-16 produces what I want. Others may want the “.0°C” so that last line will do that.
For me, I’ll use:
Core Temp: ${execi 8 sensors | grep -A 1 'Core0 Temp' | cut -c15-16 | sed '/^$/d'}°
to get that 49 you see, I don’t need the +, I doubt very much my Core Temp will ever be below 0, and since I don’t want the .0 or the C, I’ll just add the ° at the end of the line.
Happy conkying
Bruce