actuallymentor/battery được TopGit xếp vào nhóm dự án mã nguồn mở, với 7.2k sao trên GitHub, viết chủ yếu bằng Shell. CLI/GUI for managing the battery charging status for Apple silicon (M1, M2, M3) Macs
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Battery charge limiter for Apple Silicon Macbook devices
This tool makes it possible to keep a chronically plugged in Apple Silicon Macbook at 80% battery, since that will prolong the longevity of the battery. It is free and open-source and will remain that way.
Want to know if this tool does anything or is just a placebo? Read this excellent article. TL;DR: keep your battery cool, keep it at 80% when plugged in, and discharge it as shallowly as feasible.
Requirements
This is an app for Apple Silicon Macs. It will not work on Intel macs. Do you have an older Mac? Consider the free version of the Al Dente software package. It is a good alternative and has a premium version with many more features.
Installation
Option 1: install through brew with brew install battery
Option 2: You can download the latest app dmg version here.
Option 3: command-line only installation (see section below)
The first time you open the app, it will ask for your administator password so it can install the needed components. Please note that the app:
Discharges your battery until it reaches 80%, even when plugged in
Disables charging when your battery is above 80% charged
Enabled charging when your battery is under 80% charged
Keeps the limit engaged even after rebooting
Keeps the limit engaged even after closing the tray app
Also automatically installs the battery command line tool. If you want a custom charging percentage, the CLI is the only way to do that.
Do you have questions, comments, or feature requests? Open an issue here or Tweet at me.
🖥 Command-line version
If you don't know what a "command line" is, ignore this section. You don't need it.
The GUI app uses a command line tool under the hood. Installing the GUI automatically installs the CLI as well. You can also separately install the CLI.
The CLI is used for managing the battery charging status for Apple Silicon Macbooks. Can be used to enable/disable the Macbook from charging the battery when plugged into power.
Compile the smc tool from the hholtmann/smcFanControl repository
Install smc to /usr/local/bin
Install battery to /usr/local/bin
Usage
Example usage:
# This will enable charging when your battery dips under 80, and disable it when it exceeds 80
battery maintain 80
After running a command like battery charging off you can verify the change visually by looking at the battery icon:
After running battery charging on you will see it change to this:
For help, run battery without parameters:
Battery CLI utility v1.0.1
Usage:
battery status
output battery SMC status, % and time remaining
battery maintain LEVEL[1-100,stop]
reboot-persistent battery level maintenance: turn off charging above, and on below a certain value
eg: battery maintain 80
eg: battery maintain stop
battery charging SETTING[on/off]
manually set the battery to (not) charge
eg: battery charging on
battery adapter SETTING[on/off]
manually set the adapter to (not) charge even when plugged in
eg: battery adapter off
battery charge LEVEL[1-100]
charge the battery to a certain percentage, and disable charging when that percentage is reached
eg: battery charge 90
battery discharge LEVEL[1-100]
block power input from the adapter until battery falls to this level
eg: battery discharge 90
battery visudo
instructions on how to make which utility exempt from sudo, highly recommended
battery update
update the battery utility to the latest version
battery reinstall
reinstall the battery utility to the latest version (reruns the installation script)
battery uninstall
enable charging, remove the smc tool, and the battery script
FAQ & Troubleshooting
Why does this exist?
I was looking at the Al Dente software package for battery limiting, but I found the license too limiting for a poweruser like myself.
I would actually have preferred using Al Dente, but decided to create a command-line utility to replace it as a side-project on holiday. A colleague mentioned they would like a GUI, so I spend a few evenings setting up an Electron app. And voila, here we are.
"It's not working"
If you used one of the earlier versions of the battery utility, you may run into path/permission issues. This is not your fault but mine. To fix it:
Then reopen the app and things should work. If not, open an issue and I'll try to help you fix it.
A note to Little Snitch users
This tool calls a number of urls, blocking all of them will only break auto-updates.
unidentifiedanalytics.web.app is a self-made app that tracks app installations, I use it to see if enough people use the app to justify spending time on it. It tracks only how many unique ip addresses open the app.
icanhasip.com is used to see if there is an internet connection
github.com is used both as a liveness check and as the source of updates for the underlying command-line utility
electronjs.org hosts the update server for the GUI
All urls are called over https and so not leak data. Unidentified Analytics keeps track of unique ip addresses that open the app, but nothing else.
How do I support this project?
Do you know how to code? Open a pull-request for a feature with the label help wanted (PR welcome).
Do you have an awesome feature idea? Add a feature request
Do you just want to keep me motivated to update the app? Tweet at me
Có — actuallymentor/battery phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/actuallymentor/battery.
actuallymentor/battery là gì?
actuallymentor/battery (actuallymentor/battery) là dự án Shell trên GitHub. Theo mô tả gốc: CLI/GUI for managing the battery charging status for Apple silicon (M1, M2, M3) Macs
Đọc thêm về actuallymentor/battery ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/actuallymentor/battery là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc battery có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về battery.