Batteries have a limited amount of charge cycles before they are considered to be consumed.

Are you aware of remaining number? Keep an eye on this counter and maybe turn-on the ECO mode.

Posted by Gediminas Siutilas on November 30, 2014

Preface

Batteries have a limited amount of charge cycles before they are considered to be consumed. Once consumed, a replacement battery is recommended. You can use your battery after it reaches its maximum cycle count, but you may notice a reduction in your battery life. Knowing how many charge cycles are on your battery and how many are left can help you determine when a battery replacement is required.

* If you downloaded ShellWrangler app this scripts will be packed along with the downloaded application.

Script:

Download
#!/bin/bash

#   ____ __        __ __ _      __                       __         
#  / __// /  ___  / // /| | /| / /____ ___ _ ___  ___ _ / /___  ____
# _\ \ / _ \/ -_)/ // / | |/ |/ // __// _ `// _ \/ _ `// // -_)/ __/
#/___//_//_/\__//_//_/  |__/|__//_/   \_,_//_//_/\_, //_/ \__//_/   
#                                               /___/               
# 
#   ___        _      ___              _   
#  / __|  _ __| |___ / __|___ _  _ _ _| |_ 
# | (_| || / _| / -_) (__/ _ \ || | ' \  _|
#  \___\_, \__|_\___|\___\___/\_,_|_||_\__|
#      |__/                                
#
# Script author: gadominas@gmail.com
#
#   Batteries have a limited amount of charge cycles before they are considered to be consumed.
# Depends on your MacBook model it can vary from 300 to 1000 full battery charge cycles.
# Script prints the current battery charge cycle count.
# You can find yours MacBook max battery cycle count at: http://support.apple.com/en-us/HT1519
#
#$$${ Script shows the current battery charge cycle count. }

drawBatteteryCycle() {
	cycleCount=$(/usr/sbin/ioreg -l | \
	 /usr/bin/awk '$3~/CycleCount/{c[$3]=$5}END{value=c["\"CycleCount\""];print(value)}')

	printf "🔃%s" $cycleCount
}

run() {
	drawBatteteryCycle
}

run