Skip to content

01-thermal-setup.sh

Installs and configures mbpfan for proper fan control on the MacBook Air 2020. Without this script, the default thermald configuration does not drive the Apple SMC fan correctly — the CPU can sustain 97-100 °C at near-minimum fan speed.

Usage

bash
sudo bash scripts/01-thermal-setup.sh [--dry-run] [--help]

Requires root. Run this immediately after installing CachyOS.

FlagDescription
--dry-runPreview all actions without modifying the system
--helpShow usage information and exit

What It Does

  1. Preflight — locates the Apple SMC sysfs path (applesmc or APP0001:00), displays current temperatures and fan speed
  2. Install mbpfan — installs from the AUR via paru or yay (runs as the invoking user, not root)
  3. Write config — creates /etc/mbpfan.conf with the fan curve below
  4. Configure thermald — writes /etc/thermald/thermal-conf.xml limiting thermald to Intel RAPL power capping only (no fan control)
  5. Enable services — restarts thermald with the new config, enables and starts mbpfan.service
  6. Verify — displays fan speed, service status, and current temperatures

Fan Curve

TemperatureFan SpeedBehaviour
Below 55 °C2700 RPMNear-silent idle
55-70 °C2700-4500 RPMLinear ramp (normal use)
70-85 °C4500-6500 RPMAggressive ramp (heavy load)
Above 85 °C8000 RPMMaximum (thermal protection)

Hysteresis: fan speed does not reduce until the temperature drops 4 °C below the threshold (temp_change_factor = 4).

Files Modified

PathPurpose
/etc/mbpfan.confFan curve configuration
/etc/thermald/thermal-conf.xmlRAPL-only thermald config (no fan zones)

ACPI Path Detection

The script searches two locations for the Apple SMC fan interface:

  1. /sys/devices/platform/applesmc* (standard path)
  2. /sys/devices/LNXSYSTM:00/.../APP0001:00 (ACPI namespace fallback)

If neither is found, mbpfan still works — it reads temperature via coretemp sensors and controls the fan through its own kernel interface.

Prerequisites

  • An AUR helper (paru or yay)
  • lm_sensors (for the sensors verification command)

Source

View the full source on GitHub.