How emgeorrk/pulse works
Pulse is a native macOS menu-bar system monitor. The main workflow starts at the command entry point, probes available hardware, periodically samples sensors and computes metric snapshots, then presents pinned values and grouped details in the tray. Settings control sampling and display; optional capabilities include login launch and release notifications. The sensor package covers CPU, memory, network, disk, GPU, system, and battery readings, with dedicated HID/SMC temperature and IOReport power paths. Some wiring is documented only in the README or app excerpt; uncertain links are omitted.
Main entry points: monitor.go Sampling and rates · tray.go Tray interface · app.go App orchestration · registry.go Metric groups
Components 21
Startup and settings
- Pulse entry point
cmd/pulse/main.go - App orchestration
internal/app/app.go - Settings store
config/config.go
Monitoring and sensors
- Metric entities
internal/entity/metrics.go - Sampling and rates
internal/usecase/monitor.go - Temperature aggregates
internal/usecase/temps.go - System sensor readers
internal/sensors - Battery reader
internal/sensors/battery_darwin.go - SMC sensors
internal/sensors/smc_darwin.go - IOReport power
internal/sensors/ioreport_darwin.go
Menu bar presentation
- Tray interface
internal/controller/tray/tray.go - Metric groups
internal/controller/tray/registry.go - Temperature labels
internal/controller/tray/sensorlabel.go - Tray icons
internal/controller/tray/icons/icons.go - Metric formatting
pkg/format/format.go
Optional integrations
- Login launch
internal/autostart/autostart_darwin.go - Release checker
internal/updatecheck/checker.go - Public IP lookup
internal/sensors/publicip.go
Other components
- Mac user
- Release service
- IP lookup service
Connections 24
- Mac user → Pulse entry point: launches
README.md - Pulse entry point → App orchestration: selects run mode
cmd/pulse/main.go - App orchestration → Settings store: loads settings
internal/app/app.go - App orchestration → System sensor readers: probes hardware
internal/app/app.go - App orchestration → Sampling and rates: creates monitor
internal/app/app.go - App orchestration → Tray interface: starts interface
internal/app/app.go - Sampling and rates → Settings store: reads interval
internal/usecase/monitor.go - Sampling and rates → System sensor readers: samples readings
internal/usecase/monitor.go - Sampling and rates → Metric entities: builds snapshots
internal/usecase/monitor.go - Sampling and rates → Battery reader: reads battery
internal/usecase/monitor.go - Sampling and rates → SMC sensors: reads fan data
- Sampling and rates → IOReport power: reads power
- Sampling and rates → Temperature aggregates: aggregates temperatures
- Tray interface → Settings store: updates settings
internal/controller/tray/tray.go - Tray interface → Metric groups: builds metric groups
internal/controller/tray/tray.go - Metric groups → Metric formatting: formats values
internal/controller/tray/registry.go - Metric groups → Tray icons: selects icons
internal/controller/tray/registry.go - Tray interface → Login launch: configures login
internal/controller/tray/tray.go - Tray interface → Release checker: checks releases
internal/controller/tray/tray.go - Release checker → Release service: checks versions
- Sampling and rates → Public IP lookup: fetches address
internal/usecase/monitor.go - Public IP lookup → IP lookup service: looks up address
- Temperature labels → Temperature aggregates: classifies sensors
internal/controller/tray/sensorlabel.go - Tray interface → Metric entities: renders snapshots