nixrice/.local/bin/block_battery
2023-08-21 13:34:22 -04:00

18 lines
303 B
Bash
Executable file

#!/bin/sh
battery=$(cat /sys/class/power_supply/BAT0/capacity)
if [ $battery -gt 80 ]; then
symbol=
elif [ $battery -gt 60 ]; then
symbol=
elif [ $battery -gt 40 ]; then
symbol=
elif [ $battery -gt 20 ]; then
symbol=
else
symbol=
fi
echo "${symbol} ${battery}%"