一款简洁优雅的 macOS CPU 监控应用,实时显示 CPU 占用率最高的进程。
A clean and elegant macOS CPU monitoring app that displays the highest CPU-consuming process in real-time.
| 悬浮窗 / Floating Window | 菜单 / Menu | 设置 / Settings |
|---|---|---|
![]() |
![]() |
![]() |
在 macOS 日常使用中,经常会有进程因内存泄漏或其他原因长时间占用 CPU,但我们往往无法及时发现,直到:
- CPU 温度过高
- 系统性能明显下降
- 电脑变得异常卡顿
这款小工具就是为了解决这个问题而生。它以简洁的悬浮窗形式,实时显示当前 CPU 占用最高的进程,让你能第一时间发现并处理问题。
On macOS, processes often consume excessive CPU due to memory leaks or other issues without our immediate awareness, leading to:
- High CPU temperatures
- Significant system performance degradation
- Sluggish computer response
This lightweight tool was created to solve this problem. With its simple floating window, it displays the highest CPU-consuming process in real-time, allowing you to detect and address issues immediately.
-
圆形悬浮窗 - 美观的玻璃拟态设计,实时显示 CPU 占用率
Circular Floating Window - Beautiful glassmorphism design showing real-time CPU usage
-
智能边缘吸附 - 自动吸附到屏幕边缘,支持多显示器
Smart Edge Snapping - Auto-snap to screen edges, multi-display support
-
位置记忆 - 自动保存窗口位置,重启后恢复
Position Memory - Automatically saves and restores window position
-
菜单栏图标 - 轻量级菜单栏显示,支持深色/浅色主题
Menu Bar Icon - Lightweight menu bar display with dark/light theme support
-
右键菜单 - 悬浮窗右键快速访问设置和退出
Context Menu - Right-click on floating window for quick settings and quit
-
自动隐藏 - 全屏应用时自动隐藏悬浮窗
Auto-hide - Automatically hide when any app enters fullscreen
-
阈值警告 - 可配置 CPU 警告阈值(绿色/黄色/红色状态指示)
Threshold Warning - Configurable CPU warning threshold (green/yellow/red status)
-
双击打开活动监视器 - 快速跳转到系统活动监视器
Double-click to open Activity Monitor - Quick access to system Activity Monitor
-
调试日志 - 可选的调试日志功能,方便排查问题
Debug Logging - Optional debug logging for troubleshooting
- macOS 13.0 (Ventura) 或更高版本
- macOS 13.0 (Ventura) or later
- 从 Releases 页面下载最新版本
- 将
CPUMonitor.app拖入/Applications文件夹 - 首次运行需要在 系统设置 → 隐私与安全 中允许打开
1. Download from Releases
2. Drag CPUMonitor.app to /Applications folder
3. First launch requires allowing in System Settings → Privacy & Security
# 克隆仓库 / Clone repository
git clone https://github.com/yourusername/CPUMonitor.git
cd CPUMonitor
# 构建 / Build
swift build
# 运行 / Run
swift run
# 或安装到应用程序文件夹 / Or install to Applications
cp -r .build/debug/CPUMonitor.app /Applications/- 拖动悬浮窗 - 按住鼠标左键拖动到任意位置
- 边缘吸附 - 将窗口拖到屏幕边缘会自动吸附
- 右键菜单 - 右键点击悬浮窗显示设置和退出选项
- 菜单栏 - 点击菜单栏图标显示更多选项
- 双击 - 双击悬浮窗打开活动监视器
Drag floating window - Hold left mouse button to drag anywhere
Edge snap - Drag window to screen edge to auto-snap
Context menu - Right-click floating window for settings and quit
Menu bar - Click menu bar icon for more options
Double-click - Double-click floating window to open Activity Monitor
- Swift 5.9
- SwiftUI - 用户界面 / User interface
- AppKit - macOS 原生功能(NSStatusBar、NSWindow 等)
- Combine - 响应式数据流 / Reactive data flow
- top 命令 - CPU 数据采集 / CPU data collection
CPUMonitor/
├── Sources/
│ ├── CPUMonitorApp.swift # 应用入口 / App entry
│ ├── CPUMonitor.swift # CPU 数据采集 / CPU monitoring
│ ├── FloatingWindowController.swift # 悬浮窗控制器
│ ├── FloatingView.swift # 悬浮窗视图 / Floating view
│ ├── StatusBarController.swift # 菜单栏控制器 / Menu bar
│ ├── SettingsView.swift # 设置面板 / Settings
│ ├── FullscreenDetector.swift # 全屏检测 / Fullscreen detection
│ └── AutoLaunchHelper.swift # 开机自启 / Auto-launch
├── Resources/
│ └── Assets.xcassets/ # 图标资源 / Icons
└── Package.swift # Swift Package 配置
本项目采用 MIT License 开源协议。
This project is licensed under the MIT License.
- CPU 数据采集基于 macOS
top命令,与系统活动监视器数据一致 - 玻璃拟态设计灵感来自 macOS 原生 HUD 风格
CPU data collection based on macOS top command, consistent with system Activity Monitor
Glassmorphism design inspired by native macOS HUD style


