How to get core temperature of haswell i7 cores in i3status

i3status

Using i3status I believe you can change your configuration slightly so that it gets the CPU's core temperature directly from /sys by providing a path to its value. So change your rule to something like this:

order += "cpu_temperature 1"
# and more if you like...
# order += "cpu_temperature 2"

#...   
cpu_temperature 1 {
        format = "T: %degrees °C"
        path = "/sys/devices/platform/coretemp.0/temp1_input"
}

# cpu_temperature 2 {
#        format = "T: %degrees °C"
#        path = "/sys/devices/platform/coretemp.0/temp2_input"
# }

Here are 4 other ways to get your temp:

/proc

$ cat /proc/acpi/thermal_zone/THM0/temperature
temperature:             72 C

acpi

$ acpi -t
Thermal 0: ok, 64.0 degrees C

From the acpi man page:

   -t |  --thermal
             show thermal information

/sys

$ cat /sys/bus/acpi/devices/LNXTHERM\:01/thermal_zone/temp 
70000

lm_sensors

If you install the lmsensors package like so:

Fedora/CentOS/RHEL:

$ sudo yum install lm_sensors

Debian/Ubuntu:

$ sudo apt-get install lm-sensors

Detect your hardware:

$ sudo sensors-detect

You can also install the modules manually, for example:

$ sudo modprobe coretemp
$ modprobe i2c-i801

NOTE: The sensor-detect should detect your specific hardware, so you might need to modprobe <my driver> instead for the 2nd command above.

On my system I have the following i2c modules loaded:

$ lsmod | grep i2c
i2c_i801               11088  0 
i2c_algo_bit            5205  1 i915
i2c_core               27212  5 i2c_i801,i915,drm_kms_helper,drm,i2c_algo_bit

Now run the sensors app to query the resulting temperatures:

$ sudo sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +68.0°C  (crit = +100.0°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        3831 RPM
temp1:        +68.0°C  
temp2:         +0.0°C  
temp3:         +0.0°C  
temp4:         +0.0°C  
temp5:         +0.0°C  
temp6:         +0.0°C  
temp7:         +0.0°C  
temp8:         +0.0°C  

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +56.0°C  (high = +95.0°C, crit = +105.0°C)

coretemp-isa-0002
Adapter: ISA adapter
Core 2:       +57.0°C  (high = +95.0°C, crit = +105.0°C)

This is on my Thinkpad T410 which has i5 M560. Here's one of the cores:

$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 37
model name  : Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping    : 5
cpu MHz     : 1199.000
cache size  : 3072 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt aes lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5319.22
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: