Git Product home page Git Product logo

fanctl's Introduction

⚠️ Warning ⚠️

You use it at your own risk. Overheating can destroy your hardware.

💡 About

That's a small service to control fan speed. It reads temperature sensors and current power profile and maps them to fan level. Mapping is set by the configuration file. There is no user interface, and there is no plan to make one.

Main features:

  • Multiple fans and sensors.
  • Power profile support.
  • Delay before changing fan speed.

Originally created for Thinkpad T14 gen 4 (Intel). There is thinkfan, but it does not support power profiles.

There are other fan speed control tools.

Adding new drivers and other improvements are welcome.

⚙️ Supported drivers

For now it support only thinkpads, but it's not that hard to add new drivers.

💻 Thinkpad ACPI Fan

❗Fan control is disabled by default. You need to enable it.

echo "options thinkpad_acpi fan_control=1" | sudo tee -a /usr/lib/modprobe.d/thinkpad_acpi.conf
sudo modprobe thinkpad_acpi

Links

🌡️ Hwmon sensors

It should work on every device, but you need to find sensor name and label.

tail -n 1 $(ls /sys/class/hwmon/hwmon*/{name,temp*_label,temp*_input} | sort)

Links

🚀 Profile platform

There is a file /sys/firmware/acpi/platform_profile that contains current power profile. In KDE and GNOME you can control current profile from the user interface.

# To see available profiles
cat /sys/firmware/acpi/platform_profile_choices

Links

🧪 Configuration

There is conf/fanctl.yaml file with all available parameters and some explanation. You can use it to create your own config.

conf/thinkpad.yaml is an example I tested on T14.

Binary file has -d flag which enables debug logs. And -c flag to pass the config file path.

sudo fanctl -d -c ./conf/fanctl.yaml

📦 Install

Manual

Install latest version of go

cd ./fanctl
go build -o fanctl ./cmd/fanctl
sudo cp ./fanctl /usr/sbin/fanctl
sudo cp ./systemd/* /lib/systemd/system/
sudo cp ./conf/fanctl.yaml /etc/
# Change /etc/fanctl.yaml according to your hardware
sudo systemctl enable fanctl.service fanctl-wakeup.service
sudo systemctl start fanctl
# Check service status
sudo systemctl status fanctl

Deb package

Download deb package here and install.

sudo apt install ./fanctl*.deb
# Change /etc/fanctl.yaml according to your hardware
sudo systemctl enable fanctl.service fanctl-wakeup.service
sudo systemctl start fanctl
# Check service status
sudo systemctl status fanctl

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.