Official cross-platform collection
battery
Battery charge, power source, and time remaining.
Install#
Install just this package:
lesysbot tools install lesysbot/lesysbot-packages-official/tools/batteryOr take the whole Official packages collection at once:
lesysbot install lesysbot/lesysbot-packages-officialTools#
This package exposes 1 tool.
battery()#
shell command
Report charge percentage, whether the Mac is on AC or battery, and the estimated time remaining.
Runs
pmset -g battParameters
Takes no parameters.
Notes#
- macOS-only: a bare collection install skips it elsewhere (the OS gate is immutable); --only battery or --all overrides.
- Needs no root and no confirmation. On a desktop Mac it reports that there are no batteries rather than failing.
Source#
Every package is a folder holding a README.md and a tool.py. Read this one on GitHub: lesysbot/lesysbot-packages-official/tools/battery.
To write your own, see Writing tools.