sucklessConfigs

configurations of the suckless.org software that I use
Log | Files | Refs

batteryStatusChecker.sh (572B)


      1 #! /bin/sh
      2 
      3 battery=$(acpi -b | awk '{print $4}' | sed s/%,//)
      4 charging=$(acpi -b | grep -c "Charging")
      5 if [ "$charging" -eq 1 ]; then
      6 	echo " 󱐋  $battery %" 
      7 elif [ "$battery" -eq 100 ]; then
      8 	echo "FULL"
      9 elif [ "$battery" -gt 80 ]; then
     10 	echo "    $battery %"
     11 elif [ "$battery" -gt 60 ]; then
     12 	echo "    $battery %"
     13 elif [ "$battery" -gt 40 ]; then
     14 	echo "    $battery %"
     15 elif [ "$battery" -gt 20 ]; then
     16 	echo "    $battery %" 
     17 elif [ "$battery" -gt 10 ]; then
     18 	echo "    $battery %" 
     19 elif [ "$battery" -gt 0 ]; then
     20 	echo -e "    $battery %" 
     21 fi
     22