#!/bin/bash
# check for battery
if [ `apm|grep "no system battery"|wc -l` = "0" ]; then
  if [ `apm|grep "AC on-line"|wc -l` = "0" ]; then 
    echo -`apm|cut -f 2 -d':'|cut -f 2 -d' '`;
  else
    echo +`apm|cut -f 2 -d':'|cut -f 2 -d' '`;
  fi
else
  echo "AC";
fi
