#!/bin/sh

      STATE=`cat /proc/acpi/battery/BAT0/state | grep 'charging state:' | cut -b26-36`
      echo $STATE