项目 / AdnanHodzic/auto-cpufreq

AdnanHodzic/auto-cpufreq

行业候选
语言 Python标签 cpuspeedpowerfrequencyturboboostgovernorlinuxautomatictooldaemonmonitormonitoringmanagementbatterylaptopclihacktoberfest数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

Automatic CPU speed & power optimizer for Linux

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Automatic CPU speed & power optimizer for Linux
7,873累计星
365Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景 能源 暂无可用场景

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
可运行 git clone https://github.com/AdnanHodzic/auto-cpufreq。
特点或设计要点
它监控CPU频率、使用率、温度、电池状态和系统负载,并据此管理频率缩放、governor与turbo boost,进行临时和持久CPU与电源优化。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-10-28 · 语言 Python · 贡献者 —
python

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,正文较长,已截断:保留前 20000 字符(原始 53,140 字节),完整内容见 GitHub 仓库。

# auto-cpufreq
[![Linux Build](https://github.com/AdnanHodzic/auto-cpufreq/actions/workflows/build-linux.yml/badge.svg?event=push)](https://github.com/AdnanHodzic/auto-cpufreq/actions/workflows/build-linux.yml)
[![Nix Flake](https://github.com/AdnanHodzic/auto-cpufreq/actions/workflows/build-nix.yaml/badge.svg?event=push)](https://github.com/AdnanHodzic/auto-cpufreq/actions/workflows/build-nix.yaml)

Automatic CPU speed & power optimizer for Linux. Actively monitors laptop battery state, CPU usage, CPU temperature, and system load, ultimately allowing you to improve battery life without making any compromises.

For tl;dr folks:

* Youtube: 
[From 10 day vacation project to 100k users: auto-cpufreq v3 story](https://www.youtube.com/watch?v=VKqNjczvI88)
* Blog post: [From 10 day vacation project to 100k users: auto-cpufreq v3 story](https://foolcontrol.org/?p=5114)

[![](https://img.youtube.com/vi/VKqNjczvI88/0.jpg)](https://www.youtube.com/watch?v=VKqNjczvI88)

* Youtube: [auto-cpufreq v2.0 release & demo of all available features and options](https://www.youtube.com/watch?v=SPGpkZ0AZVU)
* Blog post: [auto-cpufreq v2.0](https://foolcontrol.org/?p=4603)

[![](https://img.youtube.com/vi/SPGpkZ0AZVU/0.jpg)](https://www.youtube.com/watch?v=QkYRpVEEIlg)

* Youtube: [auto-cpufreq - tool demo](https://www.youtube.com/watch?v=QkYRpVEEIlg)
* Blog post: [auto-cpufreq – Automatic CPU speed & power optimizer for Linux](https://foolcontrol.org/?p=3124)

[![](https://img.youtube.com/vi/QkYRpVEEIlg/0.jpg)](https://www.youtube.com/watch?v=QkYRpVEEIlg)

If you're having a problem with auto-cpufreq, before ([submitting an issue](https://github.com/AdnanHodzic/auto-cpufreq/issues)), it is strongly recommended to use the **[auto-cpufreq-genAI-chatbot](https://foolcontrol.org/?p=4903)** to get an immediate answer to your question.

[![](https://img.youtube.com/vi/a-UcwAAXOoc/0.jpg)](https://www.youtube.com/watch?v=a-UcwAAXOoc)

Example of auto-cpufreq GUI (v3.2.0)

<img src="https://github.com/user-attachments/assets/739beb37-4026-4d53-962d-a6b42a8efd0d" width="480" alt="Example of auto-cpufreq GUI (v3.2.0)" />

Example of `auto-cpufreq --stats` CLI output (v3.2.0)

<img src="https://github.com/user-attachments/assets/92c2e935-2e2b-4b6d-b90b-2136730ec704" width="480" alt="Example of auto-cpufreq v3.2.0 CLI output"/>


## Looking for developers and co-maintainers

- If you would like to discuss anything regarding auto-cpufreq or its development, please join the [auto-cpufreq Discord server!](https://discord.gg/Sjauxtj6kH)
- auto-cpufreq is looking for [co-maintainers & open source developers to help shape the future of the project!](https://github.com/AdnanHodzic/auto-cpufreq/discussions/312)

## Index

- [Why do I need auto-cpufreq?](#why-do-i-need-auto-cpufreq)
  - [Supported architectures and devices](#supported-architectures-and-devices)
- [Features](#features)
- [Installing auto-cpufreq](#installing-auto-cpufreq)
  - [auto-cpufreq-installer](#auto-cpufreq-installer)
  - [Debian repositories (.deb package)](#debian-repositories-deb-package)
  - [Snap Store](#snap-store)
  - [AUR package (Arch based distributions)](#aur-package-arch-based-distributions)
  - [Gentoo Linux (GURU Repository)](#gentoo-linux-guru-repository)
  - [NixOS](#nixos)
  - [For developers](#installation-development-mode-only)
- [Post-installation](#post-installation)
- [Configuring auto-cpufreq](#configuring-auto-cpufreq)
  - [1: power_helper.py script (Snap package install only)](#1-power_helperpy-script-snap-package-install-only)
  - [2: `--force` governor override](#2---force-governor-override)
  - [3: `--turbo` mode override](#3---turbo-mode-override)
  - [4: auto-cpufreq config file](#4-auto-cpufreq-config-file)
    - [Example config file contents](#example-config-file-contents)
- [How to run auto-cpufreq](#how-to-run-auto-cpufreq)
- [auto-cpufreq modes and options](#auto-cpufreq-modes-and-options)
  - [monitor](#monitor)
  - [live](#live)
  - [GUI](#gui)
    - [GTK debug logging](#gtk-debug-logging)
  - [Optional terminal diagnostics](#optional-terminal-diagnostics)
  - [Collecting a complete troubleshooting report](#collecting-a-complete-troubleshooting-report)
  - [overriding governor](#overriding-governor)
  - [overriding turbo mode](#overriding-turbo-mode)
  - [Install - auto-cpufreq daemon](#install---auto-cpufreq-daemon)
  - [Update - auto-cpufreq update](#update---auto-cpufreq-update)
  - [Remove - auto-cpufreq daemon](#remove---auto-cpufreq-daemon)
  - [stats](#stats)
  - [bluetooth_boot_off](#bluetooth_boot_off)
  - [bluetooth_boot_on](#bluetooth_boot_on)
- [Intel HWP Dynamic Boost](#intel-hwp-dynamic-boost)
- [Platform Profiles](#platform-profiles)
- [Battery charging thresholds](#battery-charging-thresholds)
  - [Supported Devices](#supported-devices)
  - [Battery config](#battery-config)
  - [Ignoring power supplies](#ignoring-power-supplies)
- [Troubleshooting](#troubleshooting)
  - [AUR](#aur)
- [Discussion](#discussion)
- [Donate](#donate)
  - [Financial donation](#financial-donation)
    - [Become Github Sponsor](https://github.com/AdnanHodzic/auto-cpufreq/blob/master/README.md#become-github-sponsor)
    - [pump.fun](https://github.com/AdnanHodzic/auto-cpufreq/blob/master/README.md#pumpfun)
    - [BitCoin](#bitcoin)
    - [Paypal](#paypal)
  - [Code contribution](#code-contribution)

## Why do I need auto-cpufreq?

One of the problems with Linux today on laptops is that the CPU will run in an unoptimized manner which will negatively impact battery life. For example, the CPU may run using the "performance" governor with turbo boost enabled regardless of whether it's plugged into a power outlet or not.

These issues can be mitigated by using tools like [indicator-cpufreq](https://itsfoss.com/cpufreq-ubuntu/) or [cpufreq](https://github.com/konkor/cpufreq), but those still require manual action from your side which can be daunting and cumbersome.

Tools like [TLP](https://github.com/linrunner/TLP) (which I used for numerous years) can help extend battery life, but may also create their own set of problems, such as losing turbo boost.

Given all of the above, I needed a simple tool that would automatically make CPU frequency-related changes and save battery life, but let the Linux kernel do most of the heavy lifting. That's how auto-cpufreq was born.

Please note: auto-cpufreq aims to replace TLP in terms of functionality, so after you install auto-cpufreq _it's recommended to remove TLP_. Using both for the same functionality (i.e., to set CPU frequencies) will lead to unwanted results like overheating. Hence, only use [both tools in tandem](https://github.com/AdnanHodzic/auto-cpufreq/discussions/176) if you know what you're doing.

One tool/daemon that does not conflict with auto-cpufreq in any way, and is even recommended to have running alongside, is [thermald](https://wiki.debian.org/thermald).

#### Supported architectures and devices

Only devices with an Intel, AMD, or ARM CPU are supported. This tool was developed to improve performance and battery life on laptops, but running it on desktops/servers (to lower power consumption) should also be possible.

## Features

- Monitoring
  - Basic system information
  - CPU frequency (system total & per core)
  - CPU usage (system total & per core)
  - CPU temperature (total average & per core)
  - Battery state
  - System load
- CPU frequency scaling, governor, and [turbo boost](https://en.wikipedia.org/wiki/Intel_Turbo_Boost) management based on
  - Battery state
  - CPU usage (total & per core)
  - CPU temperature in combination with CPU utilization/load (to prevent overheating)
  - System load
- Automatic CPU & power optimization (temporary and persistent)
- Platform Profile monitoring and configuration, when exposed by the Linux platform driver
  - Current platform profile
  - Available profiles
  - Platform Profile provider(s)
  - Separate charger and battery configuration
- Settings battery charging thresholds (limited support)

## Installing auto-cpufreq

### auto-cpufreq-installer

The source installer automatically handles several major Linux distribution families, including Debian/Ubuntu (and derivatives such as Linux Mint), Fedora/RHEL, Arch-based distributions, openSUSE, Void Linux, and Solus. Other recognized derivatives can use the installation path of their declared base distribution.

Source installation requires a distribution-provided Python 3.9 or newer. Enterprise Linux 8 uses its Python 3.9 stream; newer Enterprise Linux releases use the distribution's default Python 3.

The installer automatically installs system dependencies and creates each source installation in a dedicated virtual environment under `/opt/auto-cpufreq/releases`. It verifies a new installation before atomically selecting it through `/opt/auto-cpufreq/current`; an incomplete installation does not replace the working one.

NixOS uses the native Nix integration described below instead of the source installer.

For a stable source installation, download the `.zip` or `.tar.gz` source archive for the desired version from [GitHub Releases](https://github.com/AdnanHodzic/auto-cpufreq/releases), extract it, enter the extracted directory, and run:

```bash
sudo bash ./auto-cpufreq-installer
```

Release archives published before this archive metadata support was added are not changed retroactively and may still require a Git checkout.

For the current development version, clone the Git repository instead:

```bash
git clone https://github.com/AdnanHodzic/auto-cpufreq.git
cd auto-cpufreq && sudo ./auto-cpufreq-installer
```

When replacing an existing source installation, remove its auto-cpufreq daemon first if the installer asks you to do so. Earlier versioned generations are retained until the source installation is removed.

### Debian repositories (.deb package)

auto-cpufreq has been added to [official Debian repositories](https://packages.debian.org/search?keywords=auto-cpufreq&searchon=names&suite=all&section=all), and will soon make its way to other derivatives like [Ubuntu](https://packages.ubuntu.com/search?keywords=auto-cpufreq&searchon=names&suite=all&section=all), Mint and et cetera. 

```
sudo apt install auto-cpufreq
```

The Debian package is currently being maintained by [emfox](https://github.com/emfox).


### Snap Store

*Please note: while all [auto-cpufreq >= v2.0 CLI functionality](https://www.youtube.com/watch?v=SPGpkZ0AZVU&t=295s) will work as intended, [the GUI won't be available on Snap package installs](https://storage.googleapis.com/foolcontrol-media/2023/10/auto-cpufreq-v2-snap-deprecation-notice.png) due to [Snap package confinement limitations](https://forum.snapcraft.io/t/pkexec-not-found-python-gtk-gnome-app/36579). Hence, please consider installing auto-cpufreq using [auto-cpufreq-installer](#auto-cpufreq-installer)*.

auto-cpufreq is available on the [Snap Store](https://snapcraft.io/auto-cpufreq) or via CLI:

```
sudo snap install auto-cpufreq
```

**Please note:**
- Make sure [snapd](https://snapcraft.io/docs/installing-snapd) is installed and `snap version` is >= 2.44 for `auto-cpufreq` to fully work due to [recent snapd changes](https://github.com/snapcore/snapd/pull/8127).

- Fedora users will [encounter the following error](https://twitter.com/killyourfm/status/1291697985236144130) due to `cgroups v2` [being in development](https://github.com/snapcore/snapd/pull/7825). This problem can be resolved by either running `sudo snap run auto-cpufreq` after the snap installation or by using the [auto-cpufreq-installer](#auto-cpufreq-installer) which doesn't have this issue.

### AUR package (Arch based distributions)

[![AUR package](https://repology.org/badge/version-for-repo/aur/auto-cpufreq.svg)](https://aur.archlinux.org/packages/auto-cpufreq)

The AUR [Release Package](https://aur.archlinux.org/packages/auto-cpufreq) is currently being maintained by [MusicalArtist12](https://github.com/MusicalArtist12), [liljaylj](https://github.com/liljaylj), and [parmjotsinghrobot](https://github.com/parmjotsinghrobot). 

**Notices**

- The [Git Package](https://aur.archlinux.org/packages/auto-cpufreq-git) is seperately maintained and was last updated on version 1.9.6. 
- The build process links to `/usr/share/` instead of `/usr/local/share/`
- The daemon installer provided does not work, instead start the daemon with 

``` 
# systemctl enable --now auto-cpufreq 
```
- The GNOME Power Profiles daemon is [automatically disabled by auto-cpufreq-installer](https://github.com/AdnanHodzic/auto-cpufreq#1-power_helperpy-script-snap-package-install-only) due to it's conflict with auto-cpufreq.service. However, this doesn't happen with AUR installs, which can lead to problems (e.g., [#463](https://github.com/AdnanHodzic/auto-cpufreq/issues/463)) if not masked manually.
  - Open a terminal and run `sudo systemctl mask power-profiles-daemon.service` (then `enable` and `start` the auto-cpufreq.service if you haven't already).
- The TuneD daemon(enabled by default with Fedora 41) is [automatically disabled by auto-cpufreq-installer](https://github.com/AdnanHodzic/auto-cpufreq#1-power_helperpy-script-snap-package-install-only) due to it's conflict with auto-cpufreq.service.

### Gentoo Linux (GURU Repository)

New versions of auto-cpufreq were recently added to GURU, Gentoo's official community-maintained ebuild repository. The [ebuild](https://github.com/gentoo-mirror/guru/tree/master/sys-power/auto-cpufreq) is maintaned by [S41G0N](https://github.com/S41G0N) and other [GURU contributors](https://bugs.gentoo.org), who can respond in case of issues.

In order to build auto-cpufreq, it is necessary to add & sync GURU repository first. Adding ~amd64 keyword is also needed to unmask the package.

``` 
# echo "sys-power/auto-cpufreq ~amd64" >> /etc/portage/package.accept_keywords
# eselect repository enable guru
# emaint sync -r guru
# emerge --ask auto-cpufreq
```

**Notices**

- The build process links to `/usr/share/` instead of `/usr/local/share/`
- The build works on both systemd/OpenRC systems (both systemd and OpenRC will have a service called auto-cpufreq which can be started automatically)
- The daemon installer provided does work, but it is RECOMMENDED to install the daemon with:
``` 
# systemctl enable --now auto-cpufreq 
# rc-update add auto-cpufreq default && rc-service auto-cpufreq start
```

### NixOS

<details>
<summary>Flakes</summary>
<br>

This repo contains a flake that exposes a NixOS Module that manages and offers options for auto-cpufreq. To use it, add the flake as an input to your `flake.nix` file and enable the module:

```nix 
# flake.nix

{

    inputs = {
        # ---Snip---
        auto-cpufreq = {
            url = "github:AdnanHodzic/auto-cpufreq";
            inputs.nixpkgs.follows = "nixpkgs";
        };
        # ---Snip---
    }

    outputs = {nixpkgs, auto-cpufreq, ...} @ inputs: {
        nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
            specialArgs = { inherit inputs; };
            modules = [
                ./configuration.nix
                auto-cpufreq.nixosModules.default
            ];
        };
    } 
}
```
Then you can enable the program in your `configuration.nix` file:
```nix
# configuration.nix

{inputs, pkgs, ...}: {
    # ---Snip---
    programs.auto-cpufreq.enable = true;
    # optionally, you can configure your auto-cpufreq settings, if you have any
    programs.auto-cpufreq.settings = {
    charger = {
      governor = "performance";
      turbo = "auto";
    };

    battery = {
      governor = "powersave";
      turbo = "auto";
    };
  };
    # ---Snip---
}
```
</details>

<details>
<summary>Nixpkgs</summary>
<br>

There is a nixpkg available. Its version depends on the selected nixpkgs revision, while the flake input is pinned by `flake.lock`. You can install it in your `configuration.nix` and enable the system service:
```nix
# configuration.nix

# ---Snip---
environment.systemPackages = with pkgs; [
    auto-cpufreq
];

services.auto-cpufreq.enable = true;
# ---Snip---
```
</details>

### Installation (development mode only)

For development setup, the current module ownership map, and the
frontend and diagnostic architecture, consult [CONTRIBUTING.md](CONTRIBUTING.md).

- If you have `poetry` installed:
  ```bash
  git clone https://github.com/AdnanHodzic/auto-cpufreq.git
  cd auto-cpufreq
  poetry install
  poetry run auto-cpufreq --help
  ```

- To install with GUI support:
  ```bash
  poetry install --extras gui
  poetry run auto-cpufreq-gtk
  ```

- Alternatively, we can use an editable pip install for development purposes:
  ```bash
  git clone https://github.com/AdnanHodzic/auto-cpufreq.git
  cd auto-cpufreq
  # set up virtual environment (details removed for brevity)
  pip3 install -e .
  auto-cpufreq
  ```
- If the lock file is inconsistent, check that `pyproject.toml` and `poetry.lock` match; use `poetry update` only when you intend to update dependencies.

## Post-installation

After installation, `auto-cpufreq` is available as a binary. Refer to [auto-cpufreq modes and options](https://github.com/AdnanHodzic/auto-cpufreq#auto-cpufreq-modes-and-options) for detailed information on how to run and configure `auto-cpufreq`.

## Configuring auto-cpufreq

auto-cpufreq makes all decisions automatically based on various factors such as CPU usage, temperature, and system load. However, it's possible to perform additional configurations:

### 1: power_helper.py script (Snap package install **only**)

When installing auto-cpufreq via [auto-cpufreq-installer](#auto-cpufreq-installer), if it detects the [GNOME Power Profiles service](https://twitter.com/fooctrl/status/1467469508373884933) is running, it will automatically disable it. Otherwise, that daemon will cause conflicts and various other performance issues. 

However, when auto-cpufreq is installed as a Snap package it's running as part of a container with limited permissions, hence it's *highly recommended* to disable the GNOME Power Profiles daemon using the `power_helper.py` script.

**Please Note:**<br>
The [`power_helper.py`](https://github.com/AdnanHodzic/auto-cpufreq/blob/master/auto_cpufreq/power_helper.py) script is located within the auto-cpufreq repo at `auto_cpufreq/power_helper.py`. In order to access it, first clone
the repository:

`git clone https://github.com/AdnanHodzic/auto-cpufreq`

The helper requires the project's Python dependencies, including `psutil` and
`inotify-simple`. Install them in an isolated development environment rather
than modifying system Python with `--break-system-packages`. For example,
from the cloned repository with Poetry installed:

```bash
cd auto-cpufreq
poetry install
sudo "$(poetry env info --path)/bin/python" -m auto_cpufreq.power_helper --gnome_power_disable
```

For the list of options, use the same interpreter with `--help`.
`inotify-simple` 2.0.1 is a separate BSD-2-Clause-licensed dependency;
the auto-cpufreq project remains GPL-3.0-or-later.

### 2: `--force` governor override

By default, auto-cpufreq uses `balanced` mode which works best for many systems and situations.

However, you can override this behaviour by switching to `performance` or `powersave` mode manually. The `performance` mode results in higher default frequencies, but also higher energy use (battery consumption) and should only be used if maximum performance is needed. The `powersave` mode does the opposite and extends battery life to its maximum.

See [`--force` flag](#overriding-governor) for more info.

### 3: `--turbo` mode override

By default, auto-cpufreq handles CPU turbo mode automatically, enabling it under load and disabling it otherwise to balance performance and efficiency.

However, you can override this behavior by forcing CPU turbo's mode to `always` or `never`. Setting to `always` keeps turbo mode always enabled, allowing the CPU to reach its maximum frequency at the cost of higher energy use (battery consumption). `never`, on t
↑