This simply displays the time left on your battery. If it's fully charged it'll display "~" and otherwise it'll display the time left until fully charged (if plugged in) or the time left until fully drained (if it's unplugged).
Script:
isFullyCharged=`ioreg -n AppleSmartBattery | grep FullyCharged | awk '{ print $5 }'`
timeLeft=`ioreg -n AppleSmartBattery | grep TimeRemaining | awk '{ print $5 }'`
if [ $isFullyCharged = "Yes" ] ; then
echo "~"
else
echo "$timeLeft"
fi