#!/bin/bash acpireport="$(acpi | grep -v unavailable | head -n 1)" percent="$(echo $acpireport | awk '{print $4}')" state="$(echo $acpireport | awk '{print $3}')" time="$(echo $acpireport | awk '{print $5}')" if [[ "${state::-1}" == "Discharging" ]]; then echo "${percent::-1} | ${time::-3} ↓" else echo "${percent::-1} | ${time::-3} ↑" fi