explaingit

hoobnn/fanfan

Analysis updated 2026-06-24

33SwiftAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

A macOS menu bar app that controls Mac fan speeds via a small privileged LaunchDaemon, keeping the UI unprivileged and talking to the SMC over a Unix socket.

Mindmap

mindmap
  root((fanfan))
    Inputs
      User fan speed
      IOKit temperature
    Outputs
      SMC writes
      Menu bar UI
    Use Cases
      Quiet a noisy Mac
      Force max cooling
      Return to auto fans
    Tech Stack
      Swift
      C
      LaunchDaemon
      IOKit
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Control Mac fan speeds from the menu bar instead of relying on firmware defaults

USE CASE 2

Study a clean split between an unprivileged Swift UI and a privileged C daemon

USE CASE 3

Install a fan controller on a noisy Apple Silicon Mac via Homebrew

USE CASE 4

Read live SMC temperatures through IOKit without needing root

What is it built with?

SwiftCmacOSIOKitLaunchDaemon

How does it compare?

hoobnn/fanfanbleeeet/termipetpylogmon/istart
Stars333331
LanguageSwiftSwiftSwift
Setup difficultyeasyeasymoderate
Complexity3/53/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Needs macOS 26 or newer and one admin password prompt on first launch to install the LaunchDaemon.

MIT license: use, modify, and redistribute freely including for commercial use, as long as you keep the copyright notice.

In plain English

fanfan is a small macOS menu bar app that lets the user control the fan speeds on their Mac. The repository is written in Swift and ships under the MIT license. The README notes it is a fork of solofan, with credit to the original team. The architecture is the interesting part. Writing fan speeds on macOS requires root because it pokes the System Management Controller. Rather than running the whole user interface as root, fanfan installs a small C LaunchDaemon called fanfan-smcd that owns the SMC handle. The app itself stays unprivileged. The two pieces talk over a Unix socket using only three commands: PING to check the daemon is alive, SET to write a fan speed, and AUTO to hand control back to the firmware default. Temperature readings go through IOKit directly from the app, since reading sensors does not need root. Installation is offered in three ways. The Homebrew route is brew tap hoobnn/tap followed by brew install --cask fanfan. A DMG is available on the GitHub releases page. There is also a curl-piped-to-bash install script at scripts/install.sh in the repository. The README says only one password prompt appears on first launch, which is the moment the LaunchDaemon is set up. The project requires macOS 26 or newer, and runs on both Apple Silicon and Intel Macs. Swift 6 is listed as the build language. The README is short overall and points to a Chinese translation at README.zh.md for users who prefer that. There are no instructions for building from source in the README, and no command-line interface is described. The app is presented as a menu-bar utility, with the daemon doing the privileged work behind it.

Copy-paste prompts

Prompt 1
Install fanfan through the Homebrew tap and verify the LaunchDaemon is running after the first password prompt.
Prompt 2
Walk me through fanfan's three-command Unix socket protocol and show me how to send PING by hand.
Prompt 3
Refactor fanfan to add a fourth socket command that reports the current SMC fan target.
Prompt 4
Help me port fanfan's privileged daemon pattern to a different macOS utility that needs root for a single syscall.

Frequently asked questions

What is fanfan?

A macOS menu bar app that controls Mac fan speeds via a small privileged LaunchDaemon, keeping the UI unprivileged and talking to the SMC over a Unix socket.

What language is fanfan written in?

Mainly Swift. The stack also includes Swift, C, macOS.

What license does fanfan use?

MIT license: use, modify, and redistribute freely including for commercial use, as long as you keep the copyright notice.

How hard is fanfan to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is fanfan for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.