Skip to content

Drain Mac battery to specified level, then shut down the computer (for battery health purposes)

License

Notifications You must be signed in to change notification settings

nisc/drain-battery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Drain Battery

A macOS battery monitoring script that automatically shuts down your system when the battery level falls below a specified threshold. The script includes optional stress testing to accelerate battery drain and prevent system sleep during monitoring.

Designed for battery storage scenarios where you need to maintain optimal charge levels (typically 50-80%) for long-term storage, or when used with tools like Battery Toolkit to operate devices below 100% charge for better battery health. Run with ./drain-battery.sh <threshold_percentage> (e.g., ./drain-battery.sh 70 to shutdown at 70% battery). Install dependencies with make install.

Note: Currently does not support charging scenarios. If the current battery level is below the desired threshold, the script will shutdown the computer rather than charge to the target level.

About

Drain Mac battery to specified level, then shut down the computer (for battery health purposes)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published