patch for olpc-session

Bernardo Innocenti bernie at codewiz.org
Sun Jan 27 22:59:34 EST 2008


(I've cc'd devel@)

Alexios Zavras wrote:


> However, I saw no way of providing the
> 	Option "XkbOptions" "grp:ctrl_shift_toggle"
> line.
> Could you add support for a XKB_OPTIONS variable,
> similar to the other XKB_* ones ?
> This would be translated to "-option $XKB_OPTIONS" string
> for the setxkbmap call, of course (careful, no final 's' in -option)

More worringly, we did not specify a manufacturing tag
to specify xkb options, so that olpc-configure could do
the right thing once we have an actual SKU for it.

I propose using KO for this purpose.


> I can obviously send you the 2-line patch,
> but I thought you might find it insulting... :-)

Oh, not at all!  I'm currently traveling to Australia
and I'm unable to test properly.  See if the following
code works for you.  I've already pushed it to git,
but I've not yet rebuilt the olpc-utils package out of it.

diff --git a/olpc-session b/olpc-session
index 3e7797e..2d3712d 100755
--- a/olpc-session
+++ b/olpc-session
@@ -34,11 +34,14 @@ export LANG
 xset m 7/4 0 
 xset r rate 500 30
 
+[ -n "$XKB_OPTION" ] && XKB_OPTION=`echo "$XKB_OPTION" | sed -e 's/\b/-option /g'`
+
 # set keyboard layout
 setxkbmap \
 	${XKB_MODEL:+ -model $XKB_MODEL} \
 	${XKB_LAYOUT:+ -layout $XKB_LAYOUT} \
-	${XKB_VARIANT:+ -variant $XKB_VARIANT}
+	${XKB_VARIANT:+ -variant $XKB_VARIANT} \
+	$XKB_OPTION
 
 # disable repeat on several keys
 xset -r 9 -r 220  -r 67 -r 68 -r 69 -r 70 -r 71 -r 72 -r 73 -r 74 -r 79 -r \

-- 
 \___/
 |___|   Bernardo Innocenti - http://www.codewiz.org/
  \___\  One Laptop Per Child - http://www.laptop.org/



More information about the Devel mailing list