#!/bin/sh
rem=$(sysctl hw.acpi.battery.life | awk {'print $2'})
status=$(sysctl hw.acpi.battery.state | awk {'print $2'})
time=$(acpiconf -i 0 | grep time | awk {'print $3'})
if [ "$status" = "2" -o "$status" = "0" ]; then
echo "$rem% 🔌"
fi
if [ "$status" = "1" ]; then
echo "$rem% ($time hrs)"
fi