Code: Select all
cat /proc/acpi/thermal_zone/THM/temperature
Code: Select all
cat /proc/acpi/thermal_zone/THM/temperature
Code: Select all
# cat /proc/acpi/thermal_zone/THM/temperature
Code: Select all
#!/bin/ash
# ~/my-applications/bin/AVGsysTEMP.sh
# musher0, July 25, 2015.
####
# variables
AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"
if [ "${LANG:0:2}" = "fr" ];then
MSG="La température moyenne de votre système est de $AVGsysTEMP° C."
else
MSG="The average temperature of your system is $AVGsysTEMP° C."
fi
CLR="bg SaddleBrown -bd NavajoWhite3 -fg snow"
# action
/usr/X11/bin/yaf-splash -margin 15 -bw 20 -$CLR -placement center -font "9x15B" -timeout 10 -outline 0 -text "$MSG"
Code: Select all
#!/bin/ash
# AVGTEMP.sh # for / pour pekwm
# musher0, July 25, 2015
####
MBINS="~/my-applications/bin"
AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"
AVGsysTEMP="$AVGsysTEMP C" # The sign for degrees does not carry.
echo "Dynamic {"
echo " Entry = \" Avg. Sys. Temp.: $AVGsysTEMP\" { Actions = \"Exec $MBINS/AVGsysTEMP.sh & \" }"
# Alternative to the line above if you don't want to call anything:
# echo " Entry = \" Avg. Sys. Temp.: $AVGsysTEMP\" { Actions = \"Exec &\" }"
echo " }"
####
# In pekwm menu, towards the top, after
#
# Menu config for pekwm
# Variables
# INCLUDE = "vars"
# RootMenu = "Pekwm" {
# Entry = "" { Actions = "Dynamic $PEK/date-heure-pekwm.sh & "}
# insert:
# Entry = "" { Actions = "Dynamic /root/.pekwm/AVGTEMP.sh &" }
# (...) (Rest of pekwm menu)
####
Code: Select all
#!/bin/ash
# $AEM/incorporer-date.sh # Incorporer date et heure aux (ae)aemenus
# Aussi la temp. du système.
# musher0, 25 juillet 2015.
####
[ ${LANG:0:2} = "fr" ] && JOUR="`date '+%a. %d %b.'`" || JOUR="`date '+%a. %b. %d'`";HR="`date '+%R'`";AN="`date '+%Y'`" # données
[ -f /tmp/drapeau-aepanel ] && JOUR="$JOUR $AN" || JOUR="$JOUR, $HR"
echo "cmd \"$JOUR\" /root/my-applications/bin/hic-et-nunc2.sh" > /tmp/date
AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"
AVGsysTEMP="$AVGsysTEMP° C"
echo "cmd \"Temp. sys. : $AVGsysTEMP\" \"\"" >> /tmp/date
Code: Select all
#!/bin/ash
# ~/my-applications/bin/AVGsysTEMP-2.sh
# musher0, July 25 & Aug. 12, 2015.
#### set -xe
# variables
sysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s }'`"
ChIpS="`sensors | grep temp | wc -l`"
AVGsysTEMP="`echo \"scale=1;$sysTEMP/$ChIpS\" | bc`"
if [ "${LANG:0:2}" = "fr" ];then
AVGsysTEMP="`echo $AVGsysTEMP | tr . ,`"
MSG="La température moyenne du système est de $AVGsysTEMP° C."
else
MSG="The average temperature of the system is $AVGsysTEMP° C."
fi
COLR="bg #435167 -bd "#8F44AB" -fg snow"
# action
/usr/X11/bin/yaf-splash -margin 15 -bw 8 -$COLR -placement center -font "9x15B" -timeout 7 -outline 0 -text "$MSG"
### 30 ### set +xe
Code: Select all
sensors | awk '$1 ~ /temp/ { s += $2 ;n++ } END { printf "\n\t\t\tAVG syst. temp.: " "%4.1f C\n\n", s/n }'