2022-09-21 11:58:45 +02:00
2022-09-21 11:58:45 +02:00
2022-01-26 15:39:22 +01:00
2022-09-18 21:49:06 +02:00
2022-09-19 21:35:24 +02:00
2022-01-26 14:17:46 +01:00
2022-09-21 11:58:30 +02:00
2022-09-19 21:17:12 +02:00
2022-09-19 20:02:25 +02:00
2022-09-19 20:03:59 +02:00

Battery charging manager

CLI for managing the battery charging status for M1 Macs. Can be used to enable/disable the Macbook from charging the battery when plugged into power.

The idea is to make it possible to keep a chronically plugged in Macbook at for example 80% battery, since that will prolong the longevity of the battery.

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:

Battery not charging

After running battery charging on you will see it change to this:

Battery charging

Installation

One-line installation:

curl -s https://raw.githubusercontent.com/actuallymentor/battery/main/setup.sh | bash

This will:

  1. Compile the smc tool from the hholtmann/smcFanControl repository
  2. Install smc to /usr/local/bin
  3. Install battery to /usr/local/bin

Usage

For help, run battery without parameters:

Battery CLI utility v0.0.5.

Usage:

  battery status
    output battery SMC status, % and time remaining

  battery maintain LEVEL[1-100]
    turn off charging above, and off below a certain value
    eg: battery maintain 80

  battery charging SETTING[on/off]
    manually set the battery to (not) charge
    eg: battery charging on

  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 visudo
    instructions on how to make which utility exempt from sudo, highly recommended

  battery update
    update the battery utility to the latest version (reruns the installation script)

  battery uninstall
    enable charging and remove the smc tool and the battery script
Description
No description provided
Readme MIT 3.8 MiB
Languages
Shell 53.5%
JavaScript 46.5%