battery 315 B

12345678910111213141516171819202122
  1. #!/usr/bin/env sh
  2. BATTERY_LEVEL=`apm -l`
  3. # 1 is charging & 0 is discharging
  4. CHARGING=`apm -a`
  5. if [ $BATTERY_LEVEL -gt 95 ]
  6. then
  7. echo ;
  8. elif [ $BATTERY_LEVEL -gt 70 ]
  9. then
  10. echo ;
  11. elif [ $BATTERY_LEVEL -gt 45 ]
  12. then
  13. echo ;
  14. elif [ $BATTERY_LEVEL -gt 20 ]
  15. then
  16. echo ;
  17. else
  18. echo 
  19. fi