slitaz-tools rev 117
Xorg install with tazx
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Mar 21 00:08:33 2008 +0100 (2008-03-21) |
parents | 6b2a20ad288b |
children | 37e95bad8064 |
files | tinyutils/tazx |
line diff
1.1 --- a/tinyutils/tazx Thu Mar 20 11:10:47 2008 +0000 1.2 +++ b/tinyutils/tazx Fri Mar 21 00:08:33 2008 +0100 1.3 @@ -23,6 +23,46 @@ 1.4 # Tazx functions # 1.5 #################### 1.6 1.7 +# Install xorg server 1.8 +install_xorg() 1.9 +{ 1.10 + tazpkg recharge 1.11 + exec 3>&1 1.12 + value=`$DIALOG --clear --colors --title " Install Xorg " \ 1.13 + --menu \ 1.14 + "L'application 'tazx' permet de configurer le driver X." 16 70 5 \ 1.15 + $(grep xorg-xf86-video /var/lib/tazpkg/packages.list | cut -d- -f4 | while read x; do echo $x; echo driver; done) \ 1.16 + "quit" "Quitter" \ 1.17 + 2>&1 1>&3` 1.18 + retval=$? 1.19 + exec 3>&- 1.20 + # Continue, exit... 1.21 + case $retval in 1.22 + 1) 1.23 + echo "Cancel pressed..." 1.24 + exit 0 ;; 1.25 + 255) 1.26 + if test -z "$value"; then 1.27 + echo "ESC pressed..." 1.28 + exit 0 1.29 + fi ;; 1.30 + esac 1.31 + # Set selected value. 1.32 + case $value in 1.33 + quit) 1.34 + echo "Quit..." 1.35 + exit 0 ;; 1.36 + *) 1.37 + tazpkg get-install xorg-server 1.38 + tazpkg get-install xorg-xf86-video-$value 1.39 + xorg -configure 1.40 + mv /root/xorg.conf.new /etc/X11/xorg.conf 1.41 + sed -i 's|/usr/bin/Xvesa|/usr/bin/Xorg|' /etc/slim.conf 1.42 + sed -i s/"^xserver_arguments"/'\#xserver_arguments'/ /etc/slim.conf 1.43 + XSERVER=Xorg;; 1.44 + esac 1.45 +} 1.46 + 1.47 # Screen configuration dialog. 1.48 screen_config_dialog() 1.49 { 1.50 @@ -35,6 +75,7 @@ 1.51 Gestionnaire de fenêtres : \Z2$WM\Zn" 16 70 5 \ 1.52 $(Xvesa -listmodes 2>&1 | grep ^0x | awk '{ printf "%s %s\n",$2,$3 }' | sort -nr) \ 1.53 "xterm" "800x600x16" \ 1.54 + "xorg" "Installer Xorg" \ 1.55 "quit" "Quitter" \ 1.56 2>&1 1>&3` 1.57 retval=$? 1.58 @@ -60,6 +101,8 @@ 1.59 esac 1.60 # Set selected value. 1.61 case $value in 1.62 + xorg) 1.63 + install_xorg;; 1.64 xterm) 1.65 Xvesa -ac -shadow -screen 800x600x16 -br & 1.66 exec xterm -cr orange -geometry 80x35+0-0 ;; 1.67 @@ -127,21 +170,25 @@ 1.68 # 1.69 WM=jwm 1.70 1.71 -if [ -n $1 ]; then 1.72 - WM=$1 1.73 -fi 1.74 - 1.75 -case $WM in 1.76 +case $1 in 1.77 e17|enlightenment_start) 1.78 exec enlightenment_start 1.79 ;; 1.80 openbox|openbox-session) 1.81 exec openbox-session 1.82 ;; 1.83 - jwm|*) 1.84 + jwm) 1.85 lxpanel & 1.86 exec jwm 1.87 ;; 1.88 + *) 1.89 + # LXpanel by default with JWM (use less memory started from here rater 1.90 + # than from StartupCommand). 1.91 + if [ "$WM" = "jwm" ]; then 1.92 + lxpanel & 1.93 + fi 1.94 + exec $WM 1.95 + ;; 1.96 esac 1.97 EOF 1.98 } 1.99 @@ -152,7 +199,6 @@ 1.100 FILE=$HOME/.xinitrc 1.101 xinitrc_sample 1.102 1.103 - 1.104 # In Live mode hacker needs a xinitrc, since tazx 1.105 # is executed only by root. 1.106 if [ ! -f /home/hacker/.xinitrc ]; then 1.107 @@ -179,7 +225,7 @@ 1.108 cp /etc/jwm/system.jwmrc $JWM_CONFIG 1.109 chown hacker.hacker $JWM_CONFIG 1.110 fi 1.111 - if [ ! -f "/root/.jwmrc" ]; then 1.112 + if [ ! -f "/root/.jwmrc" -a `id -u` = 0 ]; then 1.113 JWM_CONFIG=/root/.jwmrc 1.114 cp /etc/jwm/system.jwmrc $JWM_CONFIG 1.115 fi 1.116 @@ -192,12 +238,17 @@ 1.117 cat > $HOME/.xsession << _EOF_ 1.118 # ~/.xsession: Start X window session manually on your system (startx). 1.119 # 1.120 -$XSERVER -ac -shadow $XSEVER_OPTS -screen $NEW_SCREEN -mouse $MOUSE & 1.121 -#xterm & 1.122 -#xpad & 1.123 _EOF_ 1.124 + if [ "$XSERVER " == "Xorg" ]; then 1.125 + echo 'Xorg &' >> $HOME/.xsession 1.126 + else 1.127 + echo "$XSERVER -ac -shadow $XSEVER_OPTS -screen $NEW_SCREEN -mouse $MOUSE &" \ 1.128 + >> $HOME/.xsession 1.129 + fi 1.130 + echo '#xterm &' >> $HOME/.xsession 1.131 + echo '#xpad &' >> $HOME/.xsession 1.132 # LXpanel by default with JWM. 1.133 - if [ "$WM" = "jwm" ];then 1.134 + if [ "$WM" = "jwm" ]; then 1.135 echo 'lxpanel &' >> $HOME/.xsession 1.136 fi 1.137 echo "exec $WM" >> $HOME/.xsession