slitaz-tools rev 99

Improved tazx and fix .xsession
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 11 17:16:41 2008 +0100 (2008-03-11)
parents 48bf55c66ac9
children c5044e1754b4
files tinyutils/tazx
line diff
     1.1 --- a/tinyutils/tazx	Mon Mar 10 20:43:55 2008 +0100
     1.2 +++ b/tinyutils/tazx	Tue Mar 11 17:16:41 2008 +0100
     1.3 @@ -154,13 +154,16 @@
     1.4  {
     1.5  	cat >  $FILE << "EOF"
     1.6  # ~/.xinitrc: Executed by slim login manager to startx X session.
     1.7 -# You can use 'tazx' to configure your default WM: tazx e17
     1.8 +# You can use F1 with Slim or 'tazx' to configure permanantly 
     1.9 +# your default WM: tazx e17
    1.10  #
    1.11 -if [ -z $1 ]; then
    1.12 -	1=jwm
    1.13 +WM=jwm
    1.14 +
    1.15 +if [ -n $1 ]; then
    1.16 +	WM=$1
    1.17  fi
    1.18  
    1.19 -case $1 in
    1.20 +case $WM in
    1.21  	e17|enlightenment_start)
    1.22  		exec enlightenment_start
    1.23  		;;
    1.24 @@ -180,8 +183,8 @@
    1.25  {
    1.26  	FILE=$HOME/.xinitrc
    1.27  	xinitrc_sample
    1.28 -	# Set default WM.
    1.29 -	sed -i s/'1=jwm'/"1=$WM"/ $FILE
    1.30 +	
    1.31 +	
    1.32  	# In Live mode hacker needs a xinitrc, since tazx 
    1.33  	# is executed only by root.
    1.34  	if [ ! -f /home/hacker/.xinitrc ]; then
    1.35 @@ -189,6 +192,9 @@
    1.36  		xinitrc_sample
    1.37  		chown hacker.hacker $FILE
    1.38  	fi
    1.39 +	# Set default WM.
    1.40 +	RES=`grep ^WM=[e-o] $HOME/.xinitrc`
    1.41 +	sed -i s/"$RES"/"WM=$WM"/ $HOME/.xinitrc
    1.42  }
    1.43  
    1.44  # Copy a JWM system config if any present in user home.
    1.45 @@ -219,9 +225,12 @@
    1.46  $XSERVER -ac -shadow $XSEVER_OPTS -screen $NEW_SCREEN -mouse $MOUSE &
    1.47  #xterm &
    1.48  #xpad &
    1.49 -#lxpanel &
    1.50 -exec $WM
    1.51  _EOF_
    1.52 +	# LXpanel by default with JWM.
    1.53 +	if [ "$WM" = "jwm" ];then
    1.54 +		echo 'lxpanel &' >> $HOME/.xsession
    1.55 +	fi
    1.56 +	echo 'exec $WM' >> $HOME/.xsession
    1.57  	chmod 700 $HOME/.xsession
    1.58  }
    1.59