#!/bin/bash

icon=""

current=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/%.*//' | sed 's/.*, //')
status="$current%"
state=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/,.*//' | sed 's/.*: //')

if [[ "$state" == "Discharging" ]]; then
	case $((current/20)) in
		1)
		icon=""
		;;
		2)
		icon=""
		;;
		3)
		icon=""
		;;
		4)
		icon=""
		;;
		5)
		icon=""
		;;
	esac
fi

if [[ "$state" == "Not charging" ]]; then
	icon=""
fi

if [[ "$state" == "Full" ]]; then
	icon=""
	status="Full"
fi

if [[ "$state" == "Charging" ]]; then
	icon=""
fi

echo "$icon $status"
