#!/bin/sh
if [ -f /sys/class/power_supply/ps-controller-battery-*/capacity ]; then
percentage=$(cat /sys/class/power_supply/ps-controller-battery-*/capacity)
if [ percentage -lt 40 ]; then
printf "%s%%" "$percentage"
exit
fi
if [ percentage -lt 20 ]; then
printf "%s%%" "$percentage"
exit
fi
printf "%s%%" "$percentage"
fi