Thinkfan is a software fan control
developed for Thinkpad branded Lenovo laptops running POSIX operating
systems. This post will walk the reader through installation of
Thinkfan on Arch systems, but much of the data will be useful on other
systems, espescially those which employ
This post will assume a small degree of familiarity with the Arch User Repository, and the various methods that one can use to pull software from it.
This post will also assume installation is taking place on a semi-modern Thinkpad branded laptop. Thinkfan will work with other manufacturers and models – but that’s outside the scope of this post. Older ThinkPads use many different temperature management schemas, many are not controllable by the user themselves.
There are two ways now to install Thinkfan. One uses
lm-sensors for the temperature interface, the other method uses
temperatures which are exposed by a special Thinkpad kernel module.
At the moment the hwmon method has a larger base of devices which it supports, so this guide shall follow that method.
- install lm_sensors from the offical Arch repositories.
sudo pacman -S lm_sensors
- We want to load the Thinkpad specific ACPI kernel module at boot
time while passing it an option that allows for user intervention
of fan controls.
sudo nano /etc/modprobe.d/thinkpad_acpi.confto open the
nanoeditor as root, writing to the
thinkpad_acpi.conffile. Inside this file, pass the kernel module and option :
options thinkpad_acpi fan_control=1. Ctrl-X and Y to save and quit.
- detect sensor outputs in system. Default answers to all prompts in
sudo sensors-detectUbuntu users should make sure to answer yes to installing the kernel module.
- insert the appropriate kernel module that sensors-detect found.
sudo modprobe -a <modulename>is the command used, but if you’re worried about that just restart. If you told
sensors-detect‘Yes’ when it asked if you wanted it to insert the kernel module, it’ll be loaded upon boot.
- test the output of the detected sensors with
sensors. If sane temperatures are being shown, everything is A-OK.
- install thinkfan from the AUR.
yaourt -S thinkfan(if you’re using yaourt or the AUR for this that is.) It’s supposed to automatically deal with the kernel modules that we manually input earlier, but it has been my experience that it does this poorly, if at all – that’s why we did it ahead of time.
- copy the example config over to the actual working directory.
sudo cp /usr/share/doc/thinkfan/examples/thinkfan.conf.simple /etc/thinkfan.conf
- using the find command, let’s find temperature outputs and make
note of them.
find /sys/devices -type f -name "temp*_input"
- place the temperature outputs into the
/etc/thinkfan.conffile as directed by the templating. Prefix any
- adjust the temperatures ranges as fit for your specific model.
thinkfan.conf file for my T420s looks something like this:
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp3_input hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp2_input (0, 0, 55) (1, 48, 60) (2, 50, 65) (3, 58, 68) (4, 60, 79) (5, 61, 70) (7, 65, 32767)
Test thinkfan first without daemonizing it by using
thinkfan -n to log to terminal loudly.
If all goes well, start the thinkfan systemd service.
sudo systemctl enable
sudo systemctl start thinkfan
Ubuntu users will
sudo service thinkfan enable, and may need to check out the
/etc/default/thinkfan file for flags which may need enabling.