Could this be fixed, please.

I have a Sony laptop and I am using APM because it simply works better 
than ACPI on this particular laptop. Also dmidecode says my chassis is 
of type 'Other'. So in the end laptop-detect tells me I don't have a 
laptop!

Yet with the patches that have been posted so far adding APM support is 
really not hard. I have put the pieces together and the patch below will 
say a computer is a laptop if APM reports a battery. If not, then 
nothing is changed so this should really have no negative impact on 
desktops.

If the patch is not good enough, then please let me know why and I will 
try to fix the issue.


--- laptop-detect.orig  2006-09-13 11:57:25.000000000 +0200
+++ laptop-detect       2006-09-13 12:03:05.000000000 +0200
@@ -33,5 +33,11 @@
         fi
 fi
 
+# If APM reports a battery, then it is a laptop
+if [ -e /proc/apm ] && [ "$(cut -d ' ' -f 7 /proc/apm)" != "-1%" ]; then
+#      echo "We're a laptop" >&2;
+       exit 0
+fi
+
 #probably not a laptop; exit 
 exit 1


-- 
Francois Gouget <[EMAIL PROTECTED]>              http://fgouget.free.fr/
                     Linux: the choice of a GNU generation


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to