Here is a battery shell script for linux to be used with something like i3blocks:

#!/usr/bin/env sh

bat0per=$(acpi |tr "\n" "|" | cut -d "|" -f2 | cut -d , -f2 |tr -d "%")
bat1per=$(acpi |tr "\n" "|" | cut -d "|" -f1 | cut -d , -f2 |tr -d "%")

if [ $bat0per -ge 90 ]; then cap0=""
elif [ $bat0per -le 89 ] && [ $bat0per -ge 75 ]; then cap0=""
elif [ $bat0per -le 74 ] && [ $bat0per -ge 50 ]; then cap0=""
elif [ $bat0per -le 49 ] && [ $bat0per -gt 20 ]; then cap0=""
elif [ $bat0per -le 19 ]; then cap0=""
fi

if [ $bat1per -ge 90 ]; then cap1=""
elif [ $bat1per -le 89 ] && [ $bat1per -ge 75 ];then cap1=""
elif [ $bat1per -le 74 ] && [ $bat1per -ge 50 ] ; then cap1=""
elif [ $bat1per -le 49 ] && [ $bat1per -gt 20 ]; then cap1=""
elif [ $bat1per -le 19 ]; then cap1=""
fi

bat0=$(acpi | tr "\n" "|" | cut -d "|" -f2 | cut -d ":" -f2 | cut -d , -f 1,2)
bat1=$(acpi | tr "\n" "|" | cut -d "|" -f1 | cut -d ":" -f2 | cut -d , -f 1,2)
battery0=$(echo $bat0 | sed -e "s/Discharging,/$cap0/g" -e "s/Not charging,/$cap0/g" -e "s/Charging,/ $cap0/g" -e "s/Full,/$cap0/g" -e 's/, //g')
battery1=$(echo $bat1 | sed -e "s/Discharging,/$cap1/g" -e "s/Not charging,/$cap1/g" -e "s/Full,/$cap0/g" -e "s/Charging,/ $cap1/g" -e 's/, //g')
echo $battery0 $battery1