The Best Battery Monitorfor Mac

Intelligent mac battery monitoring tool that automatically prevents overcharging and deep discharge. Keep your MacBook battery healthy with smart automation.

Free & Open Source GitHub macOS 10.13+ One-Click Install

Mac Battery Monitor Features

Advanced battery monitor for Mac with automated protection and smart sleep counters

Charging Protection

Automatically sleeps your Mac when battery reaches 75% (customizable) to prevent overcharging damage and extend battery lifespan.

Deep Discharge Guard

Protects against battery damage by automatically sleeping when charge drops below 25% (customizable threshold).

Smart Sleep Counter

Forces sleep 3 times, then switches to gentle reminders. Auto-resets when battery returns to optimal range.

Native Notifications

Beautiful macOS notifications with sound alerts. Wake-up dialogs show detailed sleep statistics and battery info.

Launch on Boot

Configured as launchd service to start automatically on boot. Runs silently in background with minimal resource usage.

Detailed Logging

Complete logs of battery events, sleep times, and statistics for tracking battery health trends over time.

3
Max Sleep Times
30s
Check Interval
75%
Default High Limit
25%
Default Low Limit

Install Battery Monitor for Mac

Get your mac battery monitor running in less than a minute with our automated installer

📦

From GitHub

Clone the repository and run the installer:

git clone https://github.com/ninadingAI/battery-monitor.git
cd battery-monitor
chmod +x install.sh
./install.sh
💾

Direct Download

One-line install with curl:

# 方法1: 从GitHub Pages下载 (需要启用Pages)
curl -fsSL https://ninadingAI.github.io/macbatterymonitor.com/battery-monitor-install.sh -o install.sh && chmod +x install.sh && ./install.sh

# 方法2: 从GitHub Raw下载 (立即可用)
curl -fsSL https://raw.githubusercontent.com/ninadingAI/macbatterymonitor.com/main/battery-monitor-install.sh -o install.sh && chmod +x install.sh && ./install.sh

Or download the installer script directly:

Download installer (install.sh)

📋 下载后如何使用:

  1. 1. 打开终端 (Terminal)
  2. 2. 进入下载文件夹:cd ~/Downloads
  3. 3. 给脚本执行权限:chmod +x battery-monitor-install.sh
  4. 4. 运行安装:./battery-monitor-install.sh

💡 提示:安装过程中会要求输入密码来配置系统服务

Custom Configuration

Adjust battery thresholds to match your usage patterns

75%

Sleep when battery reaches this level while charging

25%

Sleep when battery drops below this level

3

After this many sleeps, only show reminders

Your Custom Settings

High Threshold
75%
Low Threshold
25%
Max Sleep Times
3

💡 Tip: The downloaded script is pre-configured with your settings. Just make it executable and run!

See It In Action

Watch how the smart battery monitor protects your MacBook automatically

Smart Protection Demo

1

Automatic Detection

Monitors battery level every 30 seconds in the background

2

Smart Notifications

Shows native macOS notifications with detailed information

3

Gentle Sleep

Protects battery by putting Mac to sleep when needed

📱

Live Demo

Experience the battery monitoring dashboard with real-time data

Battery Level 85%
Charging 2.5h remaining
Open Full Dashboard →

How to Use

Step-by-step guide to get your battery monitor running

Quick Install (Recommended)

Copy and paste this command in Terminal:

curl -fsSL https://raw.githubusercontent.com/ninadingAI/macbatterymonitor.com/main/battery-monitor-install.sh -o install.sh && chmod +x install.sh && ./install.sh

What it does:

  • • Downloads the installer script
  • • Makes it executable
  • • Runs the installation
  • • Sets up automatic startup
📥

Manual Download

If you prefer to download manually:

1

Download the script

Click the download button above to get battery-monitor-install.sh

2

Open Terminal

Press ⌘ + Space, type "Terminal", press Enter

3

Navigate to Downloads

Type: cd ~/Downloads

4

Make executable & run

Type: chmod +x battery-monitor-install.sh && ./battery-monitor-install.sh

🎉 After Installation

🔋

Automatic Monitoring

The tool runs in the background and monitors your battery every 30 seconds

🔔

Smart Notifications

Get native macOS notifications when battery needs attention

🚀

Auto Startup

Starts automatically when you boot your Mac

How It Works

Understanding the smart sleep counter mechanism

🔋

Charging Mode

1

When battery ≥ 75%

First 3 times: Forces sleep with notification "Sleep (Attempt X/3)"

2

After 3 sleeps

Shows reminder only: "Consider unplugging your charger"

3

Auto-reset

Counter resets when battery drops below 75%

Low Battery Mode

1

When battery ≤ 25%

First 3 times: Forces sleep to protect battery

2

After 3 sleeps

Shows reminder only: "Consider connecting your charger"

3

Auto-reset

Counter resets when battery charges above 25%

Service Management

Common commands for managing the battery monitor service

Check Service Status
launchctl list | grep battery
Stop Service
launchctl unload ~/Library/LaunchAgents/com.user.battery.monitor.plist
Start Service
launchctl load ~/Library/LaunchAgents/com.user.battery.monitor.plist
View Logs
tail -f ~/battery_monitor/battery_monitor.log
Uninstall
./uninstall.sh

Completely removes the service and all related files

Frequently Asked Questions

Everything you need to know about Battery Monitor

Why does it keep forcing my Mac to sleep?

The new version (v2.0) implements a smart counting mechanism. It will force sleep only 3 times for each scenario (high battery or low battery). After that, it will only send notification reminders without forcing sleep. This prevents infinite interruptions to your workflow.

How do I change the maximum sleep count?

Edit the MAX_SLEEP_TIMES variable in ~/battery_monitor/battery_monitor.sh. You can set it to any value from 1 to 10. After changing, restart the service with launchctl unload and launchctl load.

The service doesn't start automatically on boot

Check if the plist file is correctly placed in ~/Library/LaunchAgents/ and that the username in the file paths has been properly replaced. You can verify the service status with launchctl list | grep battery. If needed, run the installer again.

How do I reset the sleep counter?

The counter resets automatically when your battery returns to a normal range (below 75% for high battery, or above 25% for low battery). If you want to manually reset it, delete the counter file: rm ~/.battery_sleep_counter

Is this safe for my Mac and battery?

Yes, completely safe. The tool uses macOS native commands (pmset) and system notifications. It doesn't modify any system files or require administrator privileges beyond normal sleep commands. The purpose is to protect your battery from damage caused by prolonged overcharging or deep discharge.

Can I temporarily disable the monitor?

Yes, run launchctl unload ~/Library/LaunchAgents/com.user.battery.monitor.plist to stop the service. To re-enable it, run launchctl load ~/Library/LaunchAgents/com.user.battery.monitor.plist

Get the Best Mac Battery Monitor

Join hundreds of Mac users managing their mac battery health with intelligent automation