slitaz-tools rev 81

Support Openbox in tazx
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 06 23:05:04 2008 +0100 (2008-03-06)
parents 971477a715b3
children 62efdf654877
files tinyutils/tazx
line diff
     1.1 --- a/tinyutils/tazx	Thu Mar 06 22:44:32 2008 +0100
     1.2 +++ b/tinyutils/tazx	Thu Mar 06 23:05:04 2008 +0100
     1.3 @@ -3,7 +3,7 @@
     1.4  # Tazx - Ncurses X configuration for SliTaz GNU/Linux using Dialog boxes.
     1.5  # This tinyutils is part of slitaz-tools.
     1.6  #
     1.7 -# 20080222 <pankso@slitaz.org> - GNU gpl v3.
     1.8 +# 20080306 <pankso@slitaz.org> - GNU gpl v3.
     1.9  #
    1.10  : ${DIALOG=dialog}
    1.11  
    1.12 @@ -126,17 +126,48 @@
    1.13  	fi
    1.14  }
    1.15  
    1.16 +# Openbox with openbox-session.
    1.17 +openbox_stuff()
    1.18 +{
    1.19 +	if [ "$WM" == "openbox" -o "$WM" == "ob" ]; then
    1.20 +		 WM=openbox-session
    1.21 +		 XSEVER_OPTS="dpms -terminate"
    1.22 +	fi
    1.23 +	# Check if a personnal autostart script exist if OB is installed.
    1.24 +	if [ -d "/var/lib/tazpkg/installed/openbox" ]; then
    1.25 +		if [ ! -f "$HOME/.config/openbox/autostart.sh" ]; then
    1.26 +			mkdir -p $HOME/.config/openbox
    1.27 +			cp /etc/xdg/openbox/autostart.sh $HOME/.config/openbox
    1.28 +		fi
    1.29 +		# Script for hacker, Openbox can be used with a LiveCD flavor or
    1.30 +		# LiveUSB.
    1.31 +		if [ ! -f "/home/hacker/.config/openbox/autostart.sh" ]; then
    1.32 +			mkdir -p /home/hacker/.config/openbox
    1.33 +			cp /etc/xdg/openbox/autostart.sh /home/hacker/.config/openbox
    1.34 +		fi
    1.35 +	fi
    1.36 +}
    1.37 +
    1.38  # Sample xinitrc for user (WM can be specified with F1 at slim login).
    1.39  xinitrc_sample()
    1.40  {
    1.41  	cat >  $FILE << "EOF"
    1.42  # ~/.xinitrc: Executed by slim login manager to startx X session.
    1.43 +# You can use 'tazx' to configure your default WM: tazx e17
    1.44  #
    1.45 +if [ -z $1 ]; then
    1.46 +	1=jwm
    1.47 +fi
    1.48 +
    1.49  case $1 in
    1.50  	e17|enlightenment_start)
    1.51  		exec enlightenment_start
    1.52  		;;
    1.53 -	*)
    1.54 +	openbox|openbox-session)
    1.55 +		exec openbox-session
    1.56 +		;;
    1.57 +	jwm|*)
    1.58 +		lxpanel &
    1.59  		exec jwm
    1.60  		;;
    1.61  esac
    1.62 @@ -148,6 +179,8 @@
    1.63  {
    1.64  	FILE=$HOME/.xinitrc
    1.65  	xinitrc_sample
    1.66 +	# Set default WM.
    1.67 +	sed -i s/'1=jwm'/"1=$WM"/ $FILE
    1.68  	# In Live mode hacker needs a xinitrc, since tazx 
    1.69  	# is executed only by root.
    1.70  	if [ ! -f /home/hacker/.xinitrc ]; then
    1.71 @@ -160,16 +193,16 @@
    1.72  # Copy a JWM system config if any present in user home.
    1.73  jwm_config()
    1.74  {
    1.75 -	if [ ! -f "$HOME/.jwmrc" ]; then
    1.76 -		cp /etc/jwm/system.jwmrc $HOME/.jwmrc
    1.77 -		JWM_CONFIG=$HOME/.jwmrc
    1.78 -		change_jwm_background
    1.79 +	JWM_CONFIG=$HOME/.jwmrc
    1.80 +	if [ ! -f "$JWM_CONFIG" ]; then
    1.81 +		cp /etc/jwm/system.jwmrc $JWM_CONFIG
    1.82  	fi
    1.83 +	change_jwm_background
    1.84  	# In Live mode hacker JWM config dose not exist, this is
    1.85  	# because tazx is executed at boot time by root.
    1.86  	if [ ! -f "/home/hacker/.jwmrc" ]; then
    1.87 -		cp /etc/jwm/system.jwmrc /home/hacker/.jwmrc
    1.88  		JWM_CONFIG=/home/hacker/.jwmrc
    1.89 +		cp /etc/jwm/system.jwmrc $JWM_CONFIG
    1.90  		change_jwm_background
    1.91  		chown hacker.hacker $JWM_CONFIG
    1.92  	fi
    1.93 @@ -185,6 +218,7 @@
    1.94  $XSERVER -ac -shadow $XSEVER_OPTS -screen $NEW_SCREEN -mouse $MOUSE &
    1.95  #xterm &
    1.96  #xpad &
    1.97 +#lxpanel &
    1.98  exec $WM
    1.99  _EOF_
   1.100  	chmod 700 $HOME/.xsession
   1.101 @@ -197,6 +231,7 @@
   1.102  [ -n "$NEW_SECREEN" ] || screen_config_dialog
   1.103  slim_config
   1.104  e17_stuff
   1.105 +openbox_stuff
   1.106  creat_xinitrc
   1.107  jwm_config
   1.108  creat_xsession