From 1f9b6ed16159018d1cea762981463e8ee340c062 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 31 Dec 2011 15:30:27 -0500 Subject: At xylon's suggestion, create tempmon, a temperature monitor, like batterymon. --- .gitignore | 1 + Makefile | 1 + tempmon.sh | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 tempmon.sh diff --git a/.gitignore b/.gitignore index 002ffda..7bc8d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ offlineimap-runner ord roll sysfiles +tempmon urldecode v-www-browser v-editor diff --git a/Makefile b/Makefile index 7365cbc..c64a96d 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ BINFILES = \ ord \ roll \ sysfiles \ + tempmon \ urldecode \ v-www-browser \ v-editor \ diff --git a/tempmon.sh b/tempmon.sh new file mode 100644 index 0000000..7fe99d9 --- /dev/null +++ b/tempmon.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +thresh=$1 +shift + +while true; do + num=`acpi -t|sed -nr 's/.*, ([0-9.]*) .*/\1/p` + num=${num:-0} + if (( "$num" > "$thresh" )); then + eval "$*" + else + sleep 1 + fi +done -- cgit v1.2.3