slitaz-tools rev 415

tazx: fix patch_xorg_kbd and add config-xorg option (to config Xorg at boot time)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Dec 22 18:31:28 2009 +0100 (2009-12-22)
parents 5a34e02fb165
children 0eb4f6b032fa
files tinyutils/tazx
line diff
     1.1 --- a/tinyutils/tazx	Mon Dec 21 20:51:44 2009 +0100
     1.2 +++ b/tinyutils/tazx	Tue Dec 22 18:31:28 2009 +0100
     1.3 @@ -17,7 +17,7 @@
     1.4  WM=openbox
     1.5  
     1.6  # Default user for config files in Live mode.
     1.7 -[ "$USER" = "root"] && USER=`cat /etc/passwd | grep 1000 | cut -d ":" -f 1`
     1.8 +USER=`cat /etc/passwd | grep 1000 | cut -d ":" -f 1`
     1.9  
    1.10  ####################
    1.11  #  Tazx functions  #
    1.12 @@ -33,11 +33,15 @@
    1.13  			patch -p0 <<EOF
    1.14  --- /etc/X11/xorg.conf
    1.15  +++ /etc/X11/xorg.conf
    1.16 -@@ -30,2 +30,3 @@
    1.17 +@@ -26,6 +26,8 @@
    1.18 + Section "InputDevice"
    1.19 + 	Identifier  "Keyboard0"
    1.20   	Driver      "kbd"
    1.21  +	Option      "XkbLayout"	 "ch"
    1.22  +	Option      "XkbVariant" "fr"
    1.23   EndSection
    1.24 + 
    1.25 + Section "InputDevice"
    1.26  EOF
    1.27  			;;
    1.28  		en)
    1.29 @@ -45,11 +49,15 @@
    1.30  			patch -p0 <<EOF
    1.31  --- /etc/X11/xorg.conf
    1.32  +++ /etc/X11/xorg.conf
    1.33 -@@ -30,2 +30,3 @@
    1.34 +@@ -26,6 +26,8 @@
    1.35 + Section "InputDevice"
    1.36 + 	Identifier  "Keyboard0"
    1.37   	Driver      "kbd"
    1.38  +	Option      "XkbLayout"	 "en"
    1.39  +	Option      "XkbVariant" "en"
    1.40   EndSection
    1.41 + 
    1.42 + Section "InputDevice"
    1.43  EOF
    1.44  			;;
    1.45  		ru)
    1.46 @@ -57,11 +65,13 @@
    1.47  			patch -p0 <<EOF
    1.48  --- /etc/X11/xorg.conf
    1.49  +++ /etc/X11/xorg.conf
    1.50 -@@ -30,2 +30,3 @@
    1.51 +@@ -26,6 +26,8 @@
    1.52   	Driver      "kbd"
    1.53  +	Option      "XkbLayout"	 "us,ru(winkeys)"
    1.54  +	Option      "XkbVariant" "grp:alt_shift_toggle"
    1.55   EndSection
    1.56 +  
    1.57 + Section "InputDevice"
    1.58  EOF
    1.59  			;;
    1.60  		slovene)
    1.61 @@ -69,11 +79,13 @@
    1.62  			patch -p0 <<EOF
    1.63  --- /etc/X11/xorg.conf
    1.64  +++ /etc/X11/xorg.conf
    1.65 -@@ -30,2 +30,3 @@
    1.66 +@@ -26,6 +26,8 @@
    1.67   	Driver      "kbd"
    1.68  +	Option      "XkbLayout"  "si"
    1.69  +	Option      "XkbOptions" "grp:alt_shift_toggle"
    1.70   EndSection
    1.71 +   
    1.72 + Section "InputDevice"
    1.73  EOF
    1.74  			;;
    1.75  		*)
    1.76 @@ -85,10 +97,12 @@
    1.77  			patch -p0 <<EOF
    1.78  --- /etc/X11/xorg.conf
    1.79  +++ /etc/X11/xorg.conf
    1.80 -@@ -30,2 +30,3 @@
    1.81 +@@ -26,6 +26,8 @@
    1.82   	Driver      "kbd"
    1.83  +	Option      "XkbLayout"	"$KEYMAP"
    1.84   EndSection
    1.85 +   
    1.86 + Section "InputDevice"
    1.87  EOF
    1.88  		;;
    1.89  	esac
    1.90 @@ -398,6 +412,16 @@
    1.91  		wm_config
    1.92  		creat_xinitrc
    1.93  		creat_xsession ;;
    1.94 +	config-xorg)
    1.95 +		# WM can be specified on cmdline.
    1.96 +		if [ -n "$2" ]; then
    1.97 +			WM=$2
    1.98 +		fi
    1.99 +		XSERVER="Xorg"
   1.100 +		wm_config
   1.101 +		creat_xinitrc
   1.102 +		creat_xsession
   1.103 +		patch_xorg_kbd ;;
   1.104  	*)
   1.105  		# WM can be specified on cmdline.
   1.106  		if [ -n "$1" ]; then