[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Patch to enable keymap switching in ltsp clients when using XFree86 3.x

Hi Petter, 
Well, the subject says it all. We have a skolelinux setup on old PCs 
and these use XF86 3.3, which is tricky to do keymap switching in 
(needs different keymaps that include the original, eg. 'us'). 
So, instead of hacking the Xkb keymaps, it's much easier to just force 
use the 'vesa' X server from XF86 4.x. It's much easier that way and 
keymap switching works. I think this is going to be useful in every 
other locale that includes keymap switching, so I tried to make it as 
generic as possible.

The patch should be applied to ltsp-0.58debian3/client/screen.d/startx


PS. It's untested, in the way I couldn't build the cd image to make 
the actual test, but i'm confident :-)
--- startx.orig	2005-11-11 20:42:19.702204560 +0200
+++ startx	2005-11-12 16:10:26.736355832 +0200
@@ -75,7 +75,19 @@
         case ${XSERVER} in
-            XF86_*)  /etc/build_x3_cfg ${XSERVER} >${XFCFG}
+            XF86_*)  #
+                     # We can use XFree86 3.3, only if there is no keymap switching
+                     # configured in Xkb. I.e. if a grp:*_toggle option is part of
+                     # XKBOPTIONS. If it is, then we use the vesa X server in XFree86 4.
+                     # 
+                     TOGGLE="toggle"
+                     HASTOGGLE=`expr match "${XKBOPTIONS}" ".*.${TOGGLE}"`
+                     if [ $HASTOGGLE -ne 0 ]; then
+                        XSERVER=vesa
+                        /etc/build_x4_cfg ${XSERVER} >${XFCFG}
+                     else
+	    		/etc/build_x3_cfg ${XSERVER} >${XFCFG}
+                     fi
             *)       /etc/build_x4_cfg ${XSERVER} >${XFCFG}

Reply to: