Skip to content

feat: SMC writer gating, F*Md-less fans, helper install & dev helper build#58

Merged
naufaldi merged 1 commit intomainfrom
feat/smc-helper-and-fan-mode
Apr 2, 2026
Merged

feat: SMC writer gating, F*Md-less fans, helper install & dev helper build#58
naufaldi merged 1 commit intomainfrom
feat/smc-helper-and-fan-mode

Conversation

@naufaldi
Copy link
Copy Markdown
Owner

@naufaldi naufaldi commented Apr 2, 2026

Summary

  • Direct SMC writer: Only instantiate SmcWriter when the process effective UID is root; otherwise skip direct I/O and fall through to the privileged helper socket path.
  • Apple Silicon without F*Md: Detect fan mode key presence; when absent, skip forced-mode / system handoff and write F*Tg directly; set_fan_auto becomes a no-op for those fans. Adds unit tests and an ignored hardware smoke test.
  • Helper install: Extract build_helper_install_shell_commands; fix LaunchDaemon flow (launchctl enable, kickstart, safer bootout).
  • Dev workflow: pnpm dev:prepare-helper builds fanguard-helper; beforeDevCommand runs it before Vite so the helper exists during tauri dev.

Verification

  • cd src-tauri && cargo test — all tests passed (2 ignored hardware-dependent).

Notes

  • origin was switched from HTTPS to git@github.com:naufaldi/mac-fan-ctrl.git for push (HTTPS auth was unavailable in this environment). Switch back if you prefer HTTPS.

Made with Cursor

- Only attempt direct SmcWriter when running as root; otherwise prefer helper socket.
- When F*Md is absent (some Apple Silicon), skip forced-mode handoff and write F*Tg directly; restore auto is a no-op.
- Refactor helper install shell script: launchctl enable/kickstart, safer bootout.
- Add dev:prepare-helper and run it before Vite in Tauri dev so the helper binary exists.

Made-with: Cursor
@naufaldi naufaldi merged commit d5165b1 into main Apr 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant