1
0
Fork
You've already forked afreq.sh
0
Automatic CPU speed & power optimizer for Linux, alternative to auto-cpufreq
  • Shell 81.8%
  • Roff 13.3%
  • Makefile 4.9%
Find a file
eylles 7060465b86
Further improvement
Turns out removing the usage of grep was easy
2026年05月20日 18:52:28 -06:00
examples Further improvement 2026年05月20日 18:52:28 -06:00
.editorconfig change indent size 2025年02月14日 21:33:11 -06:00
.gitignore Actually build manpage 2026年01月28日 20:57:28 -06:00
acpufreq.init Clean up init script 2026年05月19日 15:32:22 -06:00
acpufreq.is Remove --make-pidfile from start case 2025年08月21日 21:06:46 -06:00
acpufreq.sysd change: correct makefile and services 2022年10月16日 18:25:00 -06:00
afreq.1.in Remove kernel tunable optimizations 2026年05月20日 04:02:08 -06:00
afreq.sh Remove kernel tunable optimizations 2026年05月20日 04:02:08 -06:00
afreqconfig Remove kernel tunable optimizations 2026年05月20日 04:02:08 -06:00
config.mk Improve Makefile 2026年05月04日 13:31:20 -06:00
LICENSE change: license 2022年10月18日 18:07:52 -06:00
Makefile Update manpage 2026年05月04日 22:02:13 -06:00
on_ac_power Add on_ac_power 2025年09月21日 01:05:47 -06:00
perfmod.sh Add explicit license identifiers to scripts 2026年05月02日 17:55:31 -06:00
readme.md Fix gitlab link 2026年05月04日 22:10:34 -06:00
version.mk Bump Version 2026年05月04日 22:11:12 -06:00

afreq.sh

A simple daemon for setting cpu frequency governor



Donate using Liberapay Donate using Liberapay

Inspired by auto-cpufreq, afreq.sh is a minimal daemon built on posix shell and core utils, it is intended to be extensible, lean and have the least amount of dependencies possible.

As of now afreq depends only on:

  • core utils (grep, sleep, tail, awk, head, realpath, cat) however a sleep command that supports float values is needed
  • built ins (printf, command)
  • posix shell interpreter (dash, bash, busybox ash)
  • procps (vmstat, pgrep)

installation

Install everything:

sudo make install-all

this will provide:

component default location description
afreq /usr/local/sbin/afreq the actual daemon doing the work
afreq.1 /usr/local/man/man1/afreq.1 the documentation manual for the daemon
afreqconfig /usr/local/share/doc/afreq/afreqconfig example configuration file
examples/wireless-power-management.sh /usr/local/share/doc/afreq/wireless-power-management.sh example run hook
perfmod /usr/local/sbin/perfmod thin wrapper to force performance governor when a program runs
acpufreq /etc/init.d/acpufreq sysvinit initscript
acpufreq.service /etc/systemd/system/acpufreq.service systemd unit

install config

Edit the config.mk file to tweak installation options.

SysV init script

This repo provides 2 sysvinit init scripts, a hand written one and one that uses Debian's init-d-script framework that provides a Debian and LSB compliant init.d script that may be preferred on some environments, you can choose with the config.mk file.

Usage

sysvinit

The makefile should put the script in /etc/init.d/acpufreq by default, after that a simple sudo update-rc.d acpufreq defaults should be enough to activate it for the next boot

The service script supports the standard actions.

A simple sudo service acpufreq start will initiate the daemon.

systemd

The makefile should put the unit in /etc/systemd/system/acpufreq.service by default, all you need is run sudo systemctl enable acpufreq to activate the service for the next boot.

Initiate the service with sudo systemctl start acpufreq

configuration

Altho the default settings used internally by the daemon ought to work for most setups you can do tweak them to your liking or usecase, the installation provides an example config file and the manpage contains information about the available settings and their possible values.