Monday, March 29, 2010

Setting ATI fan speed in linux shell script

ok. so you've landed here coz you are already a poor ATI user like me. All you wanted to do was set your fan speed in linux right?

following script uses aticonfig to print ur current GPU temperature and if you supply a parameter it'll set your fan speed.

save these lines to your profile file under
/home/username/.profile

and you can run from any shell window

> fans 70

to set ur fanspeed to 70%


#!/bin/bash
fans() {
    if [ $1 ] ; then
        aticonfig --adapter=0 --od-gettemperature | tail -n1 | awk '{print "Current temp: " $5}' ;
        aticonfig --pplib-cmd "set fanspeed 0 $1" ;
    else
        aticonfig --adapter=0 --od-gettemperature | tail -n1 | awk '{print "Current temp: " $5}' ;
        aticonfig --pplib-cmd "set fanspeed 0 auto" ;
    fi
}

No comments: