Skip to content

Instantly share code, notes, and snippets.

@miao1007
Last active July 28, 2021 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miao1007/0b1c98112f0b0169bee29aef951248fb to your computer and use it in GitHub Desktop.
Save miao1007/0b1c98112f0b0169bee29aef951248fb to your computer and use it in GitHub Desktop.
Get current mac AC Charger power by command line
# 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