Last active
August 29, 2015 14:17
-
-
Save shannietron/9afe49f16342c6614cec to your computer and use it in GitHub Desktop.
Calculate how much power your Macbook is nomming.
This file contains 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
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