Skip to content

Instantly share code, notes, and snippets.

@5nizza
Last active January 31, 2024 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5nizza/5bf1f76bd062bb9a75b4e504a9a13711 to your computer and use it in GitHub Desktop.
Save 5nizza/5bf1f76bd062bb9a75b4e504a9a13711 to your computer and use it in GitHub Desktop.
Thinkpad x1 yoga gen 7: thinkfan configuration

Set up thinkfan on Thinkpad x1 yoga gen 7

All the steps for setting up thinkfan on thinkpad x1 yoga gen 7:

  • install sensors (likely)

  • install thinkfan

  • create config file for driver (or whatever it is):

echo options thinkpad_acpi fan_control=1 experimental=1 > /etc/modprobe.d/thinkfan.conf

Note: having experimental=1 may be important or not (it is related to yoga having two fans instead of one).

  • load the module:
modprobe thinkpad_acpi
  • create config file /etc/thinkfan.conf for controlling the fan. Mine contains the following:
######################################################################
## thinkfan 0.9 example config file
## ================================
##
## ATTENTION: There is only very basic sanity checking on the configuration.
## That means you can set your temperature limits as insane as you like. You
## can do anything stupid, e.g. turn off your fan when your CPU reaches 70°C.
##
## That's why this program is called thinkfan: You gotta think for yourself.
##
#######################################################################
##
## This file shows how to use sensor-specific temperature limits.
## First of all, you need to specify temperature inputs. On a Thinkpad, you can
## just use:
##
tp_thermal /proc/acpi/ibm/thermal  # provides 8 temperature inputs

#
## Next we specify the fan we want to use. On a Thinkpad, this is:
#
tp_fan /proc/acpi/ibm/fan

#
## Then you need to specify the temperature limits for each of the sensors.
## A dot means that the corresponding sensor should be ignored. The length of the
## UPPER and LOWER limits must be the same as the number of temperatures. In this
## example, /proc/acpi/ibm/thermal contains 8 sensors, some of which are unused (hence the dots).
#

{ "level 0"   # the fan level
# ^-------^   This works for /proc/acpi/ibm/thermal.
#
#    Sensor count:
#    1  2  3  4  5  6  7  8
#    ======================
  (0  0  0  0  0  0  0  0)      # LOWER limit
  (53	.  .  .  .  .  .  .)      # UPPER limit
}


{ "level 1"
  (48 .  .  .  .  .  .  .)
  (60 .  .  .  .  .  .  .)
}

{ "level 2"
  (55 .  .  .  .  .  .  .)
  (65 .  .  .  .  .  .  .)
}

{ "level auto"
  (60 .  .  .  .  .  .  .)
  (99 .  .  .  .  .  .  .)
}

Note: if your goal is to postpone the fun from kicking in too early, you might get away with a simpler two-level separation: level 0 and level auto.

  • you can test if it works by running thinkfan -n

  • add thinkfan service to autostart:

sudo systemctl enable thinkfan
  • restart, and check if it started on boot by running:
sudo systemctl status thinkfan

#thinkpad #fan-control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment