conky: Update and more files
[shutils.git] / dotfiles / conky / tempinfo.sh
diff --git a/dotfiles/conky/tempinfo.sh b/dotfiles/conky/tempinfo.sh
new file mode 100755 (executable)
index 0000000..5c94afb
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/dash
+#
+# Stefan Huber <shuber2@gmail.com>
+# Displays some temperature info
+
+
+if [ -f /proc/acpi/ibm/thermal ]
+then
+       info=`cat /proc/acpi/ibm/thermal | sed "s/^.*://" `
+
+       #1  ??, THM0, strongly reacts on heat at the cooling gills. reacts on cpu
+       #2  DVD: reacts on heat at the dvd drive
+       #3  express card: 31°C  REACTS ON HEAT ON PC-CARD SLOT
+       #4  agp, gets active when switched to discrete graphics, reacts on load
+       #5  disappears when bat0 is plugged off --> ~50°C always
+       #6  thinkwiki thinks this is for bat1
+       #7  disappears when bat0 is plugged off --> ~val of bat temp through smapi
+       #8  thinkwiki thinks this is for bat1   
+       #9  hdd: 33°C  REACTS ON HEAD AT THE HARD DISC AREA 
+       #10 igp, reacts on gtkperf
+       #11 heatsink? slowly reacts on heat at cooling gill. slowly reacts on cpu
+
+       cpusocket=`echo $info | awk ' { print $1 } '`
+       dvd=`echo $info | awk ' { print $2 } '`
+       excard=`echo $info | awk ' { print $3 } '`
+       atigpu=`echo $info | awk ' { print $4 } '`
+       hdd=`echo $info | awk ' { print $9 } '`
+       intelgpu=`echo $info | awk ' { print $10 } '`
+       heatsink=`echo $info | awk ' { print $11 } '`
+
+       #No equivalent in $info!! Reacts more directly to load than thm0. Due
+       #to acpi info, this is cpu.
+       cpu=`cat /sys/devices/virtual/thermal/thermal_zone1/temp | awk ' { print $1/1000 } '`
+
+       echo -n "cpu:$cpu°C cpus:$cpusocket°C"
+
+       if [ $intelgpu != "-1" ]; then
+               echo -n " igp:$intelgpu°C"
+       fi
+
+       if [ $atigpu != "-1" ]; then
+               echo -n " agp:$atigpu°C"
+       fi
+
+       echo ""
+       echo "hs:$heatsink°C ec:$excard°C hdd:$hdd°C dvd:$dvd°C"
+else
+       cpu=`cat /sys/devices/virtual/thermal/thermal_zone0/temp | awk ' { print $1/1000 } '`
+       echo "cpu: $cpu°C"
+fi
+
+
+
+