5 tempfile
=`mktemp 2> /dev/null` || tempfile
=/tmp
/test$$
6 trap "rm -f $tempfile" 0 1 2 5 15
10 #conf_file=/etc/X11/xorg.conf.d/00-keyboard.conf
11 conf_file
=/etc
/X11
/xorg.conf.d
/90-inputclass-setting.conf
13 [ -r /usr
/share
/X11
/xkb
/rules
/evdev.lst
-a -e $conf_file ] ||
exit 0
16 LN1
=`expr $(grep -n "^! layout" /usr/share/X11/xkb/rules/evdev.lst | cut -d : -f 1) + 1`
17 LN2
=`expr $(grep -n "^! variant" /usr/share/X11/xkb/rules/evdev.lst | cut -d : -f 1) - 2`
18 sed -n "${LN1},${LN2}p" /usr
/share
/X11
/xkb
/rules
/evdev.lst | \
19 while read MAP DESC
; do
21 nec_
*) echo "jp ${DESC// /_} off";;
22 *) echo "$MAP ${DESC// /_} off";;
27 $DIALOG --backtitle "Configuring system settings" \
29 --radiolist "Select Xkeyboard layout" 20 61 15 \
30 `list_keymaps | sort` 2> $tempfile
34 choice
=`cat $tempfile`
37 if [ -z $choice ]; then
38 sed -i "s%.*Option.*\"$conf_key\".*%# Option \"$conf_key\" \"us\"%" $conf_file
40 sed -i "s%.*Option.*\"$conf_key\".*% Option \"$conf_key\" \"$choice\"%" $conf_file