The following is an edited shell log, I commented when I inserted or removed battery or ac adapter. The battery-applet and gnome-power-manager echoed these states fine I think. The timeframe for this log is maybe 1 or 2 minutes. Even now several minutes after I removed the battery proc says it's there. This is a standard Ubuntu Kernel, 2.6.15-20-386.
<ac present, battery not inserted>
alex@tosh:~$ cat /proc/acpi/battery/*/state
present: no
alex@tosh:~$ cat /proc/acpi/ac_adapter/*/state
state: on-line
The following is an edited shell log, I commented when I inserted or removed battery or ac adapter. The battery-applet and gnome-power-manager echoed these states fine I think. The timeframe for this log is maybe 1 or 2 minutes. Even now several minutes after I removed the battery proc says it's there. This is a standard Ubuntu Kernel, 2.6.15-20-386.
<ac present, battery not inserted>
alex@tosh:~$ cat /proc/acpi/ battery/ */state ac_adapter/ */state
present: no
alex@tosh:~$ cat /proc/acpi/
state: on-line
<*fully* charged battery inserted>
alex@tosh:~$ cat /proc/acpi/ battery/ */state battery/ */state
present: yes
capacity state: critical
charging state: charging
present rate: 0 mA
remaining capacity: 40 mAh
present voltage: 20067 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: critical
charging state: charging
present rate: 0 mA
remaining capacity: 40 mAh
present voltage: 1635 mV
<pull ac>
alex@tosh:~$ cat /proc/acpi/ ac_adapter/ */state
state: off-line
<plug ac>
alex@tosh:~$ cat /proc/acpi/ ac_adapter/ */state battery/ */state discharging battery/ */state battery/ */state
state: on-line
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: critical
charging state: charging/
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 34660 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: ok
charging state: charged
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 41060 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: ok
charging state: charged
present rate: 0 mA
remaining capacity: 40 mAh
present voltage: 8802 mV
<pull ac>
alex@tosh:~$ cat /proc/acpi/ ac_adapter/ */state battery/ */state battery/ */state discharging
state: off-line
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: critical
charging state: discharging
present rate: 0 mA
remaining capacity: 40 mAh
present voltage: 45154 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: critical
charging state: charging/
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 11364 mV
<plug ac>
alex@tosh:~$ cat /proc/acpi/ ac_adapter/ */state
state: on-line
<remove battery>
alex@tosh:~$ cat /proc/acpi/ battery/ */state battery/ */state battery/ */state
present: yes
capacity state: critical
charging state: discharging
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 0 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: ok
charging state: charged
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 0 mV
alex@tosh:~$ cat /proc/acpi/
present: yes
capacity state: ok
charging state: charged
present rate: 0 mA
remaining capacity: 5120 mAh
present voltage: 0 mV
alex@tosh:~$