Created
December 4, 2012 15:01
-
-
Save dlion/4204883 to your computer and use it in GitHub Desktop.
Script per il controllo della carica e della temperatura della mia slackware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Script per il controllo della batteria e della temperatura | |
while : | |
do | |
BATT=$(acpitool -b | grep -Po ", (.*)\." | sed -e s/,\ //g | sed -e s/\\.//g) | |
TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input) | |
if [ $BATT -lt 5 ]; then | |
xmessage "La batteria e' sotto il 5% il pc verra' spento in 8 secondi" -center -timeout 8 | |
halt | |
fi | |
if [ $BATT -lt 15 ]; then | |
xmessage "Guarda che hai solo il 15% di batteria, fallo ricaricare oppure comincia a salvare tutto." -center -timeout 10 | |
fi | |
if [ $TEMP -gt 89000 ]; then | |
xmessage "La temperatura e' al limite, il pc verra' spento, raffreddalo!" -center -timeout 5 | |
halt | |
fi | |
if [ $TEMP -gt 80000 ]; then | |
xmessage "La temperatura e' molto alta, stai attento a non sforzarlo troppo che si scassa tutto." -center -timeout 10 | |
fi | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment