Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Native Fan Control

Linux-native fan control profiles for Dell/Alienware laptops that expose dell_smm and related hwmon interfaces.

This project gives you a practical replacement for profile-based fan control workflows (silent, balanced, performance, turbo/g-mode style) without requiring Windows software.

What This Project Does

  • Applies predefined and custom CPU/GPU fan profiles.
  • Supports BIOS auto mode fallback.
  • Exposes a status command for fan RPM, mode, and temperatures.
  • Provides a systemd service to apply a default profile on boot.
  • Includes optional sudoers policy for passwordless hotkeys only for this command.

Tech Stack

  • Language: Bash
  • Platform: Linux (tested on Fedora)
  • Runtime interfaces:
    • /sys/class/hwmon/* (kernel hwmon)
    • Dell interfaces: dell_smm, dell_ddv, alienware_wmi (kernel dependent)
  • Service manager: systemd
  • Privilege model: sudo + optional scoped NOPASSWD rule for one binary

Repository Layout

  • bin/fan-profile: main profile switch command
  • bin/fan-status: live sensor/mode status command
  • systemd/fan-profile.service: boot-time profile apply service
  • sudoers/fan-profile: optional least-privilege sudo policy
  • install.sh: installer for binaries + service

Compatibility

Expected to work on systems where kernel exposes Dell fan control nodes under hwmon, especially:

  • pwm1, pwm2
  • pwm1_enable, pwm2_enable
  • fan1_input, fan2_input

Verify availability:

for d in /sys/class/hwmon/hwmon*; do
	printf "== %s (%s)\n" "$d" "$(cat "$d/name" 2>/dev/null)"
	ls "$d" 2>/dev/null | grep -E 'pwm|fan[0-9]_input|temp[0-9]_input' || true
done

Installation

From project root:

sudo ./install.sh

Installer actions:

  • Installs fan-profile to /usr/local/bin/fan-profile
  • Installs fan-status to /usr/local/bin/fan-status
  • Installs service unit to /etc/systemd/system/fan-profile.service
  • Enables and starts fan-profile.service (default profile: balanced)

Usage

Predefined Profiles

sudo fan-profile silent
sudo fan-profile balanced
sudo fan-profile performance
sudo fan-profile gmode
sudo fan-profile auto

Custom Profile

sudo fan-profile custom 60 75

Meaning:

  • CPU fan target: 60%
  • GPU fan target: 75%

The script maps percentage to PWM (0..255) using:

pwm = floor(percent * 255 / 100)

Check Live Status

fan-status

You should see fan RPM, PWM values, mode (1=manual, 2=auto), and thermal readings.

systemd Behavior

Current service applies balanced on startup.

To change default boot profile, edit ExecStart in service file:

ExecStart=/usr/local/bin/fan-profile performance

Then reload:

sudo systemctl daemon-reload
sudo systemctl restart fan-profile.service

Optional: Passwordless Hotkeys (Scoped)

If you want desktop shortcuts or keybinds without password prompt, install the provided sudoers rule:

sudo install -Dm440 sudoers/fan-profile /etc/sudoers.d/fan-profile
sudo visudo -cf /etc/sudoers.d/fan-profile

Example keybind commands:

sudo -n /usr/local/bin/fan-profile silent
sudo -n /usr/local/bin/fan-profile balanced
sudo -n /usr/local/bin/fan-profile performance
sudo -n /usr/local/bin/fan-profile gmode

Security note: do not enable broad NOPASSWD: ALL.

Troubleshooting

fan-profile: command not found

  • Run installer: sudo ./install.sh
  • Or manually install binary to /usr/local/bin
  • Reopen shell and test: command -v fan-profile

Could not find dell_smm hwmon interface

  • Kernel might not expose dell_smm on your model/BIOS.
  • Check loaded modules and available hwmon names.
  • BIOS updates or kernel changes can alter support.

Manual mode gets overridden

  • Embedded controller/firmware may reclaim fan control.
  • Re-apply profile after suspend/resume if needed.

Safety Notes

  • Manual fan control can increase noise and wear.
  • Avoid low fan settings under heavy load.
  • Monitor temperatures after any profile change.
  • Use at your own risk.

Credits

Inspired by profile-based control workflows in fan-control utilities, implemented here with Linux-native tooling and kernel interfaces.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages