Last active
July 28, 2021 11:03
-
-
Save miao1007/0b1c98112f0b0169bee29aef951248fb to your computer and use it in GitHub Desktop.
Get current mac AC Charger power by command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install jq is required | |
system_profiler SPPowerDataType -json | jq '.SPPowerDataType[] | select(._name == "sppower_ac_charger_information").sppower_ac_charger_watts | tonumber' # eg response | |
# response example: 87 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment