tags 381952 + patch
thanks

On Tue, Aug 08, 2006 at 01:19:32AM +0200, Steinar H. Gunderson wrote:
> Autodetecting a Latitude is not difficult, but rather hairy -- it's
> basically a matter of
> 
>   dmidecode --string system-product-name | grep -q '^Latitude ' && 
> LATITUDE=yes

I've written up a quick patch to do this for various laptops, but it's
largely untested yet, and I don't know if dmidecode is available during
xorg configuration; I'll have to check that with Joey.

/* Steinar */
-- 
Homepage: http://www.sesse.net/
diff -ur xorg-7.0.22/debian/xserver-xorg.config.in 
xorg-7.0.22.patched/debian/xserver-xorg.config.in
--- xorg-7.0.22/debian/xserver-xorg.config.in   2006-06-12 05:40:21.000000000 
+0200
+++ xorg-7.0.22.patched/debian/xserver-xorg.config.in   2006-08-08 
11:50:43.000000000 +0200
@@ -964,6 +964,99 @@
     warn "selected layout '$XMAP' from '$DI_KEYMAP--$REALLANG' is l2-only"
   fi
 
+  # Try to guess the keyboard model if we have a laptop; largely adapted
+  # from hotkey-setup by Matthew Garrett and laptop-detect by Thom May
+
+  # Are we a Mac?
+  if [ -d /proc/pmu ]; then
+    batteries=$(grep Battery /proc/pmu/info| cut -f2 -d:)
+    if test "$batteries" -ne 0; then
+      MODEL=apple_laptop
+    fi
+  fi
+  
+  # Try to get information out of dmidecode, if we can
+  if [ -x /usr/sbin/dmidecode ]; then
+    manufacturer=`dmidecode --string system-manufacturer`
+    name=`dmidecode --string system-product-name`
+    version=`dmidecode --string system-version`
+    chassis=`dmidecode --string chassis-type`
+  
+    case "$manufacturer" in
+    Acer*)
+      case "$name" in
+      Ferrari*4000*)
+        MODEL=acer_ferrari4k
+        ;;
+      TravelMate*800*)
+        MODEL=acer_acer_tm_800
+        ;;
+      esac
+      ;;
+  
+    Dell*)
+      case "$name" in
+      Latitude*)
+        MODEL=latitude
+        ;;
+      esac
+      ;;
+  
+    Hewlett-Packard*)
+      case "$name" in
+      Omnibook*XE3*GC*)
+        MODEL=hpxe3gc
+        ;;
+      Omnibook*XE3*GF*)
+        MODEL=hpxe3gf
+        ;;
+      Omnibook*XT1000*)
+        MODEL=hpxt1000
+        ;;
+      Omnibook*500*FA*)
+        MODEL=hp500fa
+        ;;
+      Omnibook*5*)
+        MODEL=hp5xx
+        ;;
+      Omnibook*6000*)
+        MODEL=hp6000
+        ;;
+      Omnibook*6100*)
+        MODEL=hp6000
+        ;;
+      Pavillion*ZT11*)
+        MODEL=hpzt11xx
+        ;;
+      esac
+      ;;
+  
+    IBM*)
+      case "$version" in
+      *ThinkPad*)
+        MODEL=thinkpad
+        ;;
+      esac
+      ;;
+  
+    LENOVO*)
+      case "$version" in
+      *ThinkPad*)
+        MODEL=thinkpad
+        ;;
+      esac
+      ;;
+  
+    Toshiba*)
+      case "$name" in
+      Satellite*S3000*)
+        MODEL=toshiba_s3000
+        ;;
+      esac
+      ;;
+    esac
+  fi
+
   XKBLAYOUT="$XMAP"
   XKBOPTIONS="$OPTIONS"
   XKBVARIANT="$VARIANT"

Reply via email to