Created
December 23, 2018 05:40
-
-
Save tylerkerr/d6ab77621cf8e790563cdd702b17e75e to your computer and use it in GitHub Desktop.
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 battime() | |
{ | |
minutes=$(/usr/sbin/ioreg -r -n AppleSmartBattery | grep InstantTimeToEmpty | \grep -Eo "\d+") | |
hours=$(echo "$minutes / 60" | bc) | |
remainder=$(echo "$minutes - (60 * $hours)" | bc) | |
echo "[+] battery time remaining : ${hours}h ${remainder}m" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment