slitaz-tools rev 779 5.1

tazx: fix X keyboard layout switcher by moving/merging XkbOptions from 40-evdev.conf to 40-Keyboard.conf only
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Nov 03 02:05:48 2012 +0000 (2012-11-03)
parents 1dda4f4d6450
children 0d90e07700be
files tinyutils/tazx
line diff
     1.1 --- a/tinyutils/tazx	Thu Sep 13 10:37:58 2012 +0200
     1.2 +++ b/tinyutils/tazx	Sat Nov 03 02:05:48 2012 +0000
     1.3 @@ -75,38 +75,43 @@
     1.4  	# Configure the keyboard with the right keymap.
     1.5  	keymap=`cat /etc/keymap.conf`
     1.6  	keyboard_config=$xorg_config/40-Keyboard.conf
     1.7 -	echo 'Section "InputClass"
     1.8 -	Identifier "Keyboard Defaults"
     1.9 -	MatchIsKeyboard "yes"' > $keyboard_config
    1.10 +	variant=""
    1.11 +	# this XkbOption moved from 40-evdev.conf (xorg-xf86-input-evdev)
    1.12 +	options="terminate:ctrl_alt_bksp"
    1.13  	case $keymap in
    1.14  		fr_CH-latin1)
    1.15  			# Swiss FrenCH
    1.16 -			echo '	Option "XkbLayout" "ch"
    1.17 -	Option "XkbVariant" "fr"' >> $keyboard_config ;;
    1.18 +			layout="ch"; variant="fr" ;;
    1.19  		uk)
    1.20  			# English UK
    1.21 -			echo '	Option "XkbLayout" "gb"' >> $keyboard_config ;;
    1.22 +			layout="gb" ;;
    1.23  		ru)
    1.24  			# Russian
    1.25 -			echo '	Option "XkbLayout" "us,ru(winkeys)"
    1.26 -	Option "XkbOptions" "grp:ctrl_shift_toggle, grp_led:scroll"'  >> $keyboard_config ;;
    1.27 +			layout="us,ru"
    1.28 +			options="grp:ctrl_shift_toggle, grp_led:scroll, $options" ;;
    1.29  		slovene)
    1.30  			# Slovenian
    1.31 -			echo '	Option "XkbLayout" "si"
    1.32 -	Option "XkbOptions" "grp:alt_shift_toggle"' >> $keyboard_config ;;
    1.33 +			layout="si"; options="grp:alt_shift_toggle, $options" ;;
    1.34  		us-acentos)
    1.35 -			echo '	Option "XkbLayout" "us"
    1.36 -	Option "XkbVariant" "intl"' >> $keyboard_config ;;
    1.37 +			layout="us"; variant="intl" ;;
    1.38  		*)
    1.39  			# Use clean /etc/keymap.conf value.
    1.40  			keymap=${keymap%-latin1}
    1.41  			keymap=${keymap%-lat2}
    1.42  			keymap=${keymap%-lat6}
    1.43 -			keymap=${keymap%-abnt2}
    1.44 -			echo '	Option "XkbLayout" "'$keymap\"  >> $keyboard_config ;;
    1.45 +			layout=${keymap%-abnt2}
    1.46  	esac
    1.47  
    1.48 -	echo 'Endsection' >> $keyboard_config
    1.49 +	cat > $keyboard_config << EOC
    1.50 +Section "InputClass"
    1.51 +	Identifier "Keyboard Defaults"
    1.52 +	MatchIsKeyboard "yes"
    1.53 +	Option "XkbLayout" "$layout"
    1.54 +	Option "XkbVariant" "$variant"
    1.55 +	Option "XkbOptions" "$options"
    1.56 +EndSection
    1.57 +EOC
    1.58 +	[ "x$variant" != "x" ] && sed -i '/XkbVariant/d' $keyboard_config
    1.59  
    1.60  	# Create a xorg.conf if needed.
    1.61  	if [ ! -f /etc/X11/xorg.conf ]; then