Difference between revisions of "Code/fan-enable-extended"
 (Moved from ACPI fan control script)  | 
				m  | 
				||
| Line 32: | Line 32: | ||
          for temp in `sed s/temperatures:// < /proc/acpi/ibm/thermal`  |           for temp in `sed s/temperatures:// < /proc/acpi/ibm/thermal`  | ||
            do  |             do  | ||
| − |               test $temp -gt $SWITCHTEMP   | + |               test $temp -gt $SWITCHTEMP  | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Revision as of 02:57, 11 April 2007
- !/bin/sh
 
- fan control-script
 - based upon ibm-acpi 0.11 (experimental=1 !)
 - eliminates anoying "fan always on" in battery mode
 - works with hysteresis (DELTA) so that always-turn-on/turn-off is avoided
 - fan acivates at MAXTEMP and cools down CPU, GPU etc. to MAXTEMP-DELTA than the fan is turned off
 - furthermore detects if AC is on and gives back fan control to default behaviour than
 - one can change MAXTEMP and DELTA to individual values
 - but take care of your THINKPAD don`t melt it!
 - have fun!
 - mk 05.05.05
 
MAXTEMP=51 DELTA=4
SWITCHTEMP=$MAXTEMP
- make sure the script doesn't leave the fan off on error
 
trap "echo enable > /proc/acpi/ibm/fan" EXIT
while [ 1 ]; do
 for ac in `sed s/state:// < /proc/acpi/ac_adapter/AC/state`
   do
    if [ "$ac" = "off-line" ]; then
        fan=no
        for temp in `sed s/temperatures:// < /proc/acpi/ibm/thermal`
          do
            test $temp -gt $SWITCHTEMP