---
 debian/changelog |    6 ++++++
 laptop-detect.in |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f3b7575..3afac31 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+laptop-detect (0.13.4) UNRELEASED; urgency=low
+
+  * Support the /sys power interface in 2.6.24. Closes: #463662
+
+ -- Joey Hess <[EMAIL PROTECTED]>  Fri, 01 Feb 2008 22:48:39 -0500
+
 laptop-detect (0.13.3) unstable; urgency=low
 
   [ Thom May ]
diff --git a/laptop-detect.in b/laptop-detect.in
index 942dce4..5a181be 100644
--- a/laptop-detect.in
+++ b/laptop-detect.in
@@ -63,6 +63,13 @@ fi
 
 # check for any ACPI batteries
 /sbin/modprobe battery 2> /dev/null || true
+if [ -d /sys/class/power_supply ]; then
+       if grep -q Battery /sys/class/power_supply/*/type 2>/dev/null; then
+            $PRINTIT "We're a laptop (ACPI batteries found)" >&2
+            exit 0
+       fi
+fi
+# old interface:
 if [ -d /proc/acpi/battery ]; then
         results=`find /proc/acpi/battery -mindepth 1 -type d`
         if [ ! -z "$results" ]; then
@@ -71,6 +78,7 @@ if [ -d /proc/acpi/battery ]; then
         fi
 fi
 
+
 # check for APM batteries. This sucks, because we'll only get a valid response
 # if the laptop has a battery fitted at the time
 if [ -f /proc/apm ]; then
-- 
1.5.3.8

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to