Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

fan — ThinkPad Fan Control Utility

A lightweight Bash script to manually control the fan speed of Lenovo ThinkPads via the thinkpad_acpi kernel module interface. It provides an intuitive, man-page style CLI wrapper around /proc/acpi/ibm/fan.

Features

  • Automatic Mode: Instantly switch back to internal BIOS/firmware fan curves.
  • Full-Speed Mode: Disengage the fan restrictions to run at absolute physical maximum speed (useful to prevent thermal throttling during heavy compilation or rendering tasks).
  • Manual Levels: Set fixed fan steps from level 1 (quietest) to level 7 (maximum regular speed).
  • Status Dashboard: Instantly clears the screen and prints the current RPM, level, and operational mode.

Prerequisites & Kernel Configuration

Before using this script, you must ensure that the thinkpad_acpi kernel module is configured to allow manual fan control. By default, the Linux kernel restricts user-space writes to the fan interface.

1. Enable Fan Control

Create or edit a configuration file inside /etc/modprobe.d/ (e.g., thinkpad_acpi.conf) and add the following option:

options thinkpad_acpi fan_control=1

Or run this single command to apply it instantly:

echo "options thinkpad_acpi fan_control=1" | sudo tee /etc/modprobe.d/thinkpad_acpi.conf && sudo modprobe -r thinkpad_acpi && sudo modprobe thinkpad_acpi  

2. Verify the Interface

Ensure that the ACPI fan interface is visible and writable:

ls -l /proc/acpi/ibm/fan  

Installation

To install fan system-wide so it can be executed from anywhere:

  1. Save the script content to a file named fan.

  2. Make it executable:

    chmod +x fan  
  3. Move it to a directory in your system $PATH (e.g., /usr/local/bin/):

    sudo mv fan /usr/local/bin/  

Usage & Options

The script requires root privileges (sudo) to write directly to the hardware interface.


SYNTAX  
    fan [OPTION]  
  
OPTIONS  
    -a, --auto  
        Resets the fan to automatic mode (BIOS control). Recommended after intensive tasks.  
  
    -f, --full  
        Activates full-speed mode (disengaged). The fan spins at its maximum physical speed.  
        Prevents thermal throttling during demanding CPU tasks.  
  
    -s, --status  
        Displays the current fan status (mode, current speed, level).  
  
    -l, --level <1-7>  
        Sets a fixed fan level from 1 (lowest setting) to 7 (highest regular setting).  
  
    -h, --help  
        Displays the built-in man-page.  
  

### Examples

- Check the current RPM and speed level:  
    Bash  
    fan -s  
      
    
- Set the fan to full throttle for heavy workloads:  
    Bash  
    fan -f  
      
    
- Return control to the system BIOS:  
    Bash  
    fan -a  
      
    
- Set a precise speed level (e.g., Level 4):  
    Bash  
    fan -l 4  
      
    

Troubleshooting

Error: The interface '/proc/acpi/ibm/fan' was not found

This occurs if you are not running the script on a supported IBM/Lenovo ThinkPad, or if the thinkpad_acpi kernel module is missing entirely from your active kernel configuration.

Permission Denied / Changes not applying

The script internal commands utilize sudo tee to modify /proc/acpi/ibm/fan. Ensure your current user has valid sudo permissions, or run the utility directly as root.

About

A lightweight Bash script to manually control the fan speed of Lenovo ThinkPads via the thinkpad_acpi kernel module interface. It provides an intuitive, man-page style CLI wrapper around /proc/acpi/ibm/fan.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages