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.
| Flag | Description |
|---|---|
--dry-run | Preview all actions without modifying the system |
--help | Show usage information and exit |
What It Does
- Preflight — locates the Apple SMC sysfs path (
applesmcorAPP0001:00), displays current temperatures and fan speed - Install mbpfan — installs from the AUR via
paruoryay(runs as the invoking user, not root) - Write config — creates
/etc/mbpfan.confwith the fan curve below - Configure thermald — writes
/etc/thermald/thermal-conf.xmllimiting thermald to Intel RAPL power capping only (no fan control) - Enable services — restarts
thermaldwith the new config, enables and startsmbpfan.service - Verify — displays fan speed, service status, and current temperatures
Fan Curve
| Temperature | Fan Speed | Behaviour |
|---|---|---|
| Below 55 °C | 2700 RPM | Near-silent idle |
| 55-70 °C | 2700-4500 RPM | Linear ramp (normal use) |
| 70-85 °C | 4500-6500 RPM | Aggressive ramp (heavy load) |
| Above 85 °C | 8000 RPM | Maximum (thermal protection) |
Hysteresis: fan speed does not reduce until the temperature drops 4 °C below the threshold (temp_change_factor = 4).
Files Modified
| Path | Purpose |
|---|---|
/etc/mbpfan.conf | Fan curve configuration |
/etc/thermald/thermal-conf.xml | RAPL-only thermald config (no fan zones) |
ACPI Path Detection
The script searches two locations for the Apple SMC fan interface:
/sys/devices/platform/applesmc*(standard path)/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 (
paruoryay) lm_sensors(for thesensorsverification command)
Source
View the full source on GitHub.