Ensure that digits below 20 show a red battery percentage

This commit is contained in:
Dave Gallant
2020-05-07 09:18:53 -04:00
parent 7ee9f791a1
commit fba55c58ce

View File

@@ -11,7 +11,8 @@ Battery() {
capacity=$(grep -hs ^ /sys/class/power_supply/BAT0/capacity)
if [ -n "$capacity" ]; then
case $capacity in
[0-1][0-9]{0,1}) colour=$red ;;
[0-9]) colour=$red ;;
[0-1][0-9]) colour=$red ;;
[2-3][0-9]) colour=$yellow ;;
*) colour=$green ;;
esac