summaryrefslogtreecommitdiff
path: root/bin/st-temp
diff options
context:
space:
mode:
Diffstat (limited to 'bin/st-temp')
-rwxr-xr-xbin/st-temp18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/st-temp b/bin/st-temp
new file mode 100755
index 0000000..20d7a01
--- /dev/null
+++ b/bin/st-temp
@@ -0,0 +1,18 @@
+#!/bin/sh
+CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed 's/+//;s/\.0//g' )
+
+# freebsd
+#CORETEMPS=$(sysctl dev.cpu | grep temperature | awk '{print $2}' | sed s/.[0-9]C$//g)
+#
+#CORE_COUNT=0
+#SUM=0
+#
+#for temp in $CORETEMPS; do
+# SUM=$((SUM + temp))
+# CORE_COUNT=$((CORE_COUNT + 1))
+#done
+#
+#
+#CPUTEMP="$((SUM / CORE_COUNT)) C"
+
+echo $CPUTEMP