Skip to content

A Python utility for precise fan control on HP OMEN laptops. Allows manual fan speed adjustments, custom temperature-speed curves, and boost mode for max cooling. Includes an automatic mode for temperature-based fan adjustments.

License

Notifications You must be signed in to change notification settings

ifsvivek/onlyfans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OnlyFans

OnlyFans is a Python utility for managing fan speeds on HP OMEN laptops, enabling users to manually adjust fan speeds, configure temperature-based speed curves, and manage fan boost settings. It also offers an automated service mode for temperature-dependent fan control.

Features

  • Manual Fan Speed Control: Set specific RPM values for each fan.
  • Temperature Curves: Customize fan speeds based on temperature thresholds.
  • Boost Mode: Toggle maximum fan speed for intensive cooling.
  • Automated Service: Optionally control fans based on real-time temperature readings.

Prerequisites

  • Python 3.x
  • Python libraries: click, tomlkit, click_aliases

Install the required libraries with pip:

sudo pip install click tomlkit click-aliases

Important

Ensure Secure Boot is disabled in your BIOS to enable communication with the laptop's Embedded Controller (EC) module.


Supported Devices

  • This utility is optimized for HP OMEN laptops with dual fans.
  • Unsupported Models: HP Victus and possibly other non-OMEN models.

Installation

  1. Clone the repository:

    git clone https://github.com/ifsvivek/onlyfans.git
    cd onlyfans
  2. Update the Script Path in fans.sh:

    Open fans.sh and set the path to omen-fan.py. For instance, if omen-fan.py is in ~/Documents/omen, your fans.sh should look like:

    #!/bin/bash
    exec gnome-terminal -- bash -c "
      cd ~/Documents/omen && \
      sudo bash -c 'python3 omen-fan.py e start'
    "
  3. Make fans.sh Executable:

    chmod +x fans.sh
  4. Create a Desktop Entry: (Optional)

    Create a desktop entry file named fans.desktop with the following content:

    [Desktop Entry]
    Version=1.0
    Name=OnlyFans
    Comment=Fan Control Utility
    Exec=/home/yourusername/onlyfans/fans.sh
    Icon=/home/yourusername/onlyfans/fans.png
    Terminal=false
    Type=Application
    NoDisplay=false
    

    Replace /home/yourusername/onlyfans/ with the actual path to the onlyfans directory on your system.

    Move the fans.desktop file to ~/.local/share/applications/:

    mv fans.desktop ~/.local/share/applications/

Usage

Starting the Service

To begin automatic fan control:

./fans.sh

This command opens a terminal window to start omen-fan.py with necessary permissions.


Command-Line Interface (CLI)

The utility offers a flexible CLI to manage fan settings. Below are available commands:

bios-control

Enable or disable BIOS-based fan control.

sudo python3 omen-fan.py bios-control [True|False]
  • True - BIOS controls the fans.
  • False - Manual control via this script.

boost

Toggle fan boost mode for maximum fan speed.

sudo python3 omen-fan.py boost [True|False]
  • True - Enables maximum speed.
  • False - Returns to normal fan speeds.

configure

Configure fan speed behavior based on temperature thresholds.

sudo python3 omen-fan.py configure --temp-curve "50,60,70,75,80,90" --speed-curve "50,60,80,100,100,100" --idle-speed 25 --poll-interval 1

Options:

  • --temp-curve: List of temperature thresholds (°C).
  • --speed-curve: Fan speeds for each temperature threshold.
  • --idle-speed: Speed below the lowest threshold.
  • --poll-interval: How often (in seconds) the temperature is checked.

Tip

Ensure temp-curve and speed-curve lists have equal values, with temperature values in ascending order.

To view current configuration:

sudo python3 omen-fan.py configure --view

service

Start or stop the fan control service.

sudo python3 omen-fan.py service [start|stop]
  • start: Launches fan control.
  • stop: Ends fan control.

info

Display current fan and service status.

sudo python3 omen-fan.py info

Outputs:

  • Service status
  • BIOS control status
  • Fan speeds
  • Boost mode status

set

Manually assign RPM values to each fan.

sudo python3 omen-fan.py set [fan1_speed] [fan2_speed]
  • fan1_speed: Speed for fan 1 (RPM).
  • fan2_speed: Speed for fan 2 (RPM).

Tip

RPM values should be within the hardware’s capabilities (e.g., 30 = 3000 RPM).

Example:

Set both fans to 3000 RPM:

sudo python3 omen-fan.py set 30

Set fan 1 to 3000 RPM and fan 2 to 4000 RPM:

sudo python3 omen-fan.py set 30 40

version

View the utility version.

python3 omen-fan.py version

Configuration

A config.toml file will be generated on first run, storing custom temperature and speed curves, idle speed, and polling intervals.


License

Licensed under the MIT License. See LICENSE for more details.


Disclaimer

This utility is built specifically for HP OMEN laptops. Usage on unsupported models may result in unintended behavior. The authors are not liable for damages from using this tool.

About

A Python utility for precise fan control on HP OMEN laptops. Allows manual fan speed adjustments, custom temperature-speed curves, and boost mode for max cooling. Includes an automatic mode for temperature-based fan adjustments.

Topics

Resources

License

Stars

Watchers

Forks