Giter VIP home page Giter VIP logo

tpfancontrol-rs's Introduction

tpfancontrol-rs is a Linux TUI clone of troubadix's TPFanControl. It uses the sysfs interface exposed by the thinkpad_acpi kernel module to allow you to monitor and control the temperature and fan speeds of your Thinkpad.

Installation

  • To install from the Github repository directly, run:

     cargo install --git 'https://github.com/Arnavion/tpfancontrol-rs'

    This will compile the tpfancontrol binary and put it in ~/.cargo/bin/

  • Alternatively, clone this repo, then run:

     cargo build --release

    This will compile the tpfancontrol binary and put it in ./target/release/

Usage

  1. Ensure the thinkpad_acpi module has been loaded by the kernel.

    $ lsmod | grep '^thinkpad_acpi'
    
    thinkpad_acpi    122880 0
  2. Enable the fan_control=1 option for the module and reload the module.

    $ echo 'options thinkpad_acpi fan_control=1' | sudo tee /etc/modprobe.d/98-thinkpad_acpi.conf
    
    options thinkpad_acpi fan_control=1
    
    $ sudo modprobe -r thinkpad_acpi
    
    $ sudo modprobe thinkpad_acpi
    
    $ lsmod | grep '^thinkpad_acpi'
    
    thinkpad_acpi    122880 0

    If unloading the module fails, it's easiest and safest to just reboot.

  3. Copy the config.toml.example file in this repository to /etc/tpfancontrol/config.toml and edit it to match the sensors of your Thinkpad. This file contains custom names for the temperature sensors and a mapping of temperature to fan level.

    To discover the sensor numbers, find the hwmon node and enumerate the temp*_input files inside it. For example:

    $ grep -H 'thinkpad' /sys/class/hwmon/hwmon*/name
    
    /sys/class/hwmon/hwmon2/name:thinkpad
    
    $ ls -1 /sys/class/hwmon/hwmon2/temp*_input
    
    /sys/class/hwmon/hwmon2/temp1_input
    /sys/class/hwmon/hwmon2/temp2_input
    /sys/class/hwmon/hwmon2/temp3_input
    ...

    This means you have sensors numbered 1, 2, 3, and so on. Add them to the config file so tpfancontrol can monitor them. The names for the sensors are completely arbitrary and only used for display purposes, so you can name them whatever you like.

    (Note: It looks like some Thinkpads don't report any temperature sensors via the thinkpad_acpi module. See this issue for discussion.)

  4. Run the tpfancontrol binary that you compiled above.

    To allow the program to modify the fan speed, it must be run as root, such as with sudo. If the program is run as an unprivileged user, it cannot adjust the fan speed because the hwmon interface is only writable by root. In this case the program will not adjust the fan speed based on the temperature, and the manual controls for changing the fan speed will also be locked.

Notes

  • SMART mode does not have hysteresis. The fan speed will fluctuate when the temperature is near the boundary between two mappings. As a workaround, change your mapping so that the stable temperature of your Thinkpad is not near a boundary.

tpfancontrol-rs's People

Contributors

arnavion avatar smhmd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.