#!/usr/bin/env bash
bat=$(awk '
    $1 == "Battery" && $3 ~ "Discharging" {
        print substr($4, 1, length($4)-1)
    }
    $1 == "Battery" && $3 != "design" && $3 !~ "Discharging" {
        print $4
    }
    ' <(acpi -V)
)

echo "BAT $bat"
