Skip to content

metaphysica.ist

I know you’re too tired, and maybe too scared for a revolution – after all, the prevalent system is designed for having us believe we are helplessly unable to change it. Let us be honest: a revolution is on the horizon, and a revolution is needed. You know it, I know it. Without one, this form of greed inspired capitalism will not only remain, but grow a tiny bit more monstrous, ever so slightly more inhumane every day. We cannot allow for a system to dominate our lives, which rewards the worst instincts in us, and promotes the most unscrupulous of us to the top. This way, things will never get better – instead, they will become worse. If we do not overcome our (perceived) helplessness and tire, if we do not find the courage and strength to intervene, if we to do not do something – we will remain in the stranglehold of an asymmetrical financial system, and under the spell of a tiny fraction of extremely rich, powerful and influential people. There are alternatives – never believe anyone claiming there is none. The ideas are out there – they are right here, on this very site. I invite you to help yourself, and all those dear to you – and in the end, even the whole of humanity. For example, by spending five minutes with the intro article of this site you can see below. What could be more important, than take on the fight for a better tomorrow – for ourselves, our loved ones, our children? I'd like to ask you to move forward,, to join, I ask you to participate, and not remain dormant. Not remain helpless. Not remain uninformed and hence impotent. Simply by reading a few articles on this site, you may discover what is absolutely possible for a better future.

Menu
  • politics / economy
  • philosophy
  • recommendations
  • publications
  • movies
  • computer
  • about
  • all articles
Menu

Control the fan speed on a linux notebook (like my Asus UX31A).

Posted on May 28, 2013May 2, 2024 by amalius

There doesn’t seem to be a viable standard solution for the problem of controlling the fans’ speeds on most linux notebooks, including the version I have, the ASUS ux31a.

After some digging and hacking I came up with a “solution”. It’s not ideal and it might be dangerous when implemented incorrectly, but hey, it works.

Some of the work was done by an anonymous user on pastebin. He calls his hack “dirty”, and it certainly isn’t the standard way his program goes, but is there really such a thing as a dirty hack? Any hack that works is a good one, I think …

However, before you use this on your system, let me warn you:
If you are uncomfortable with a little tinkering, I recommend you don’t use any of the following. If you don’t have a clue what the programs described do, stay away. If you do anyway, and your new notebook goes up in flames, burns down your house and ruins your life, I’ll be the guy saying to you what I say now: YOU HAVE BEEN WARNED!

how to use:

First, download this code
compile it, run it and see if it works.

If it does, the following sh-script will read out the current temperature of your CPU and pass it on to the above program, setting the fan speed accordingly.

I have set minimum temperature for fan activity to 50 degrees Celsius, the max for a full blast to 70, and a minimum fan speed of 25 percent. Feel free to change the values as you like (for example, in the script below, set “$min” to 0, if you want the fan to completely stop at low temperatures).

You have to have “sensors” installed for the script to work.

Then go like this: copy the following script, save it and run it with “sudo sh [program path + program name]“. For having it run in the background, you may install “screen” (“sudo apt-get install screen”) and type “screen” and hit return before typing “sudo sh [program path + programname]”. Put the screen into background with “Ctrl+a+d” and the program will run in the background continuously.

If you want to stop the program: Resume the screen with “screen -r” (and see what it has done), and “ctrl+c” out of it. Type “exit” to close the screen (if any).

This is a little update on the script controlling the fan speed on my Asus ultrabook. With the original one, the fans are a little too jumpy for my taste, so I added in some element of “inertia”: the fan speed is now set according to the last two measurements of CPU-temperature instead of just the current one (which means less jumping up and down for the rpms of the fan). Also, the script logs what it does – if you do not want a log, simply edit the relevant lines (remove ” >> /var/log/fanc.log”). 

Here it is:


#!/bin/sh

## you need to specify where the compiled version of fancntrl.c is
## mine is in “/home/nathan/skripte” and is called “fanc”. Edit the lines with “/home/nathan/skripte/fanc” accordingly.
## also, you need to have sensors installed, test them with “sensors” in your bash
## if you don’t know what I am talking about, DO NOT USE this script!

dummy=0
xx=0
yy=0
zz=0
# minimum of fan activity in percent
min=25
# initial temperature, to be careful set to 60 (doesn’t need to be changed!)
temp2=60
ff=0
gg=0

echo “as long as not exited with ctrl-c, I will now control your fans ”
echo “depending on the current temperature prevailing …”
echo “if exited, don’t forget to set control back to auto!”
echo
sleep 2

while [ $dummy -lt 1 ]
do
temp=$(sensors | grep ‘Physical’ | cut -c18-19)
echo “temperature is $temp °C” >> /var/log/fanc.log
yy=$(($temp-50))
yy=$(($yy*5))
ff=$(($temp2-50))
ff=$(($ff*5))
yy=$((yy+ff))
yy=$((yy/2))
echo “the mean of the 2 last temp’s in percent of the critical distance between 50 and 70 degrees: $yy” >> /var/log/fanc.log

xx=$(($yy * 255 / 100))
zz=$(($min * 255 / 100))

echo “in ascii: $xx” >> /var/log/fanc.log
if [ $yy -gt 20 ]
then
if [ $xx -gt 254 ]
then
/home/nathan/skripte/fanc 255
echo “set fanspeed to maximum” >> /var/log/fanc.log
else
/home/nathan/skripte/fanc $xx
echo “set fanspeed to $yy percent” >> /var/log/fanc.log
fi
else
/home/nathan/skripte/fanc $zz
echo “set fanspeed to minimum ($min%)” >> /var/log/fanc.log
fi
echo
temp2=$temp
sleep 4
done


Post navigation

← Coming back after a year of not using the internet
Amerika, Deutschland und die NSA – Staatentypologien in einer Debatte →

3 thoughts on “Control the fan speed on a linux notebook (like my Asus UX31A).”

  1. blubbi says:
    August 9, 2014 at 10:01

    Update Link doesn’t work!

    Reply
  2. blubbi says:
    August 9, 2014 at 13:53

    Where can I find the updated version of this script?

    Reply
  3. amalius says:
    August 10, 2014 at 07:30

    update link works now …

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

recent posts

  • The world's biggest problem
  • Goedel's incompleteness theorem - in a nutshell
  • Tough times call for the strongman
  • Game theory, politics and morality: the prisoner’s dilemma
  • Radicalism and Authoritarianism on the rise
  • A philosophical analysis of economic/political competition
  • Germany vs USA: two educational and cultural philosophies
  • A plan for a democratic economy
  • History never stops
  • Paradoxa und Gödels Unvollständigkeitstheorem
  • Gegen die Arbeitsteiligkeit in der philosophie
  • Game theory, politics and morality: the prisoners dilemma
  • Parakonsistenz bei Platon und Hegel: die Dialektik des Anfangs

categories

  • all articles (34)
  • computer stuff (6)
  • movies (5)
  • philosophy (20)
  • Politics / Economy (13)
  • recommendations (1)
  • the plan (2)
  • the problems (6)
  • Uncategorized (2)

Donate

links

  • politics / economy
  • philosophy
  • recommendations
  • publications
  • movies
  • computer
  • about
  • all articles

search

© 2025 metaphysica.ist | Powered by Minimalist Blog WordPress Theme