Skip to content

Instantly share code, notes, and snippets.

@shannietron
Last active August 29, 2015 14:17
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 shannietron/9afe49f16342c6614cec to your computer and use it in GitHub Desktop.
Save shannietron/9afe49f16342c6614cec to your computer and use it in GitHub Desktop.
Calculate how much power your Macbook is nomming.
function power
set amp (system_profiler SPPowerDataType | awk '/Amperage/{ print $3 }')
set volt (system_profiler SPPowerDataType | awk '/Voltage/{ print $3 }')
set power (echo "scale=2; ($volt * $amp)/1000000"| bc -l)
echo $power"W"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment