8000 GitHub - abizer/wtop: Real-time power monitor for Apple Silicon Macs · GitHub
[go: up one dir, main page]

Skip to content
abizerPublic

About

Real-time power monitor for Apple Silicon Macs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

wtop

written by Claude Opus 4.6 via Claude Code

Inspired by Simon Willison's Vibe coding SwiftUI apps is a lot of fun

Real-time power monitor for Apple Silicon Macs. Native SwiftUI app that shows exactly where your watts are going — from the SoC components down to individual apps.

wtop screenshot

Install

Homebrew (recommended)

brew tap abizer/wtop https://github.com/abizer/wtop
brew trust abizer/wtop        # newer Homebrew asks you to trust third-party taps
brew install --cask abizer/wtop/wtop

This repository is its own tap (the cask is Casks/wtop.rb), which is why brew tap needs the URL. The cask downloads a pre-built .app, installs it to /Applications, strips the quarantine attribute, and sets up the privileged helper daemon (prompts for your password once).

Features

  • System power — total draw, battery discharge rate, adapter input
  • SoC breakdown — CPU, GPU, ANE, DRAM power via IOReport
  • Where the rest goes — display backlight, the rest of the chip, and whatever no sensor accounts for, so the breakdown adds up to the system total
  • Per-process energy — actual watts per app, not just CPU time, including each app's share of GPU power
  • CPU cores — per-core utilization for E-cluster and P-cluster
  • Temperatures — CPU, SSD, battery via SMC sensors
  • App grouping — Brave's 12 helper processes collapse into one row
  • Power history — 5-minute sparkline of system power
  • Thermal state — nominal/fair/serious/critical indicator
  • Battery projection — estimated time remaining at current draw

The app works without the privileged helper — system power, CPU/GPU/ANE/DRAM breakdown, core utilization, temperatures, and user-app energy are all available. The helper adds full visibility into system daemons (WindowServer, kernel_task, launchd, etc.) including their CPU time and energy consumption.

Controls

  • All / Apps / System — filter by user apps or system daemons
  • Sort — by Power, CPU, Memory, or Name
  • Search — filter processes by name
  • Refresh — 0.5s, 1s, 2s, or 5s intervals

How it works

wtop reads from five macOS subsystems, none of which require third-party dependencies:

What How
System power IOKit AppleSmartBattery registry
CPU/GPU/ANE/DRAM IOReport Energy Model channels via /usr/lib/libIOReport.dylib (CLPC energy counters on macOS 27, where the Energy Model freezes)
Per-process energy proc_pid_rusage with rusage_info_v6.ri_energy_nj
CPU core load Mach host_processor_info
Temperatures SMC keys via IOKit (little-endian flt on Apple Silicon)

The privileged helper runs on-demand — launchd starts it when the app opens an XPC connection, and it exits 30 seconds after the app closes. It never runs in the background.

Architecture

Sources/
  App/         SwiftUI app (runs as user)
  Helper/      Privileged daemon (root, on-demand via launchd + XPC)
  Shared/      XPC protocol, process-table reader and wire format (linked into both)

Without root, proc_pidinfo can't see system processes. The helper provides full process data for all PIDs over XPC when installed. Without it, us 6B40 er apps are still fully visible.

Install from source

This builds from source, installs the app to ~/Applications (Spotlight-searchable), and sets up a privileged helper daemon for full system process energy data.

git clone https://github.com/abizer/wtop
cd wtop
just install          # .app → ~/Applications
just install-helper   # privileged daemon (needs sudo)

Requires Swift 6.0+ and macOS 14+. Run the tests with just test.

Uninstall

brew uninstall --cask wtop

The cask's uninstall block handles launchctl cleanup and helper removal automatically.

If installed from source:

just uninstall

Requirements

  • Apple Silicon Mac (M1/M2/M3/M4)
  • macOS 14 Sonoma or later
  • Swift 6.0+ (for building from source)

License

MIT

Acknowledgments

Built with insights from mactop, macmon, and the Stats app's SMC implementation.

About

Real-time power monitor for Apple Silicon Macs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0