slitaz-tools view tinyutils/tazx @ rev 40

Removed screen with 8 PseudoColor in tazx
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jan 14 21:08:46 2008 +0100 (2008-01-14)
parents c1064e88ccb1
children 4bfab6a38fc5
line source
1 #!/bin/sh
2 #
3 # Tazx - Ncurses startx script for SliTaz GNU/Linux using Dialog boxes.
4 # This tinyutils is part of slitaz-tools.
5 #
6 # 20080114 <pankso@slitaz.org> - GNU gpl v3.
7 #
8 : ${DIALOG=dialog}
10 # Variables.
11 XSERVER=Xvesa
12 DOC=/usr/share/doc/slitaz-tools/tazx.txt
13 MOUSE=/dev/input/mice,5
14 WM=jwm
16 exec 3>&1
17 value=`$DIALOG --help-button \
18 --clear \
19 --title " Start X on SliTaz " \
20 --menu \
21 "L'application 'tazx' vous permet configurer votre session X \
22 sur votre système GNU/Linux. Syntaxe : \
23 Ecran largeur x hauteur x nb-couleurs" 15 70 5 \
24 "640x480x16" "TrueColor" \
25 "640x480x24" "TrueColor" \
26 "800x600x16" "TrueColor" \
27 "800x600x24" "TrueColor" \
28 "1024x768x16" "TrueColor" \
29 "1024x768x24" "TrueColor" \
30 "1280x1024x16" "TrueColor" \
31 "1280x1024x24" "TrueColor" \
32 "1600x1200x16" "TrueColor" \
33 "1600x1200x24" "TrueColor" \
34 "1920x1440x16" "TrueColor" \
35 "xterm" "800x600x16" \
36 "quit" "Quitter" \
37 2>&1 1>&3`
38 retval=$?
39 exec 3>&-
41 case $retval in
42 0)
43 continue ;;
44 1)
45 echo "Cancel pressed..."
46 exit 0 ;;
47 2)
48 $DIALOG --clear \
49 --title " Aide - Help " \
50 --textbox "$DOC" 15 70
51 exec tazx ;;
52 255)
53 if test -n "$value"; then
54 echo "$value"
55 else
56 echo "ESC pressed..."
57 exit 0
58 fi ;;
59 esac
61 # Set selected value.
62 case $value in
63 xterm)
64 Xvesa -ac -shadow -screen 1024x768x24 -br &
65 exec xterm -cr green -geometry 80x35+0-0 ;;
66 *)
67 SCREEN=$value ;;
68 esac
70 # Copy a JWM system config if any in present in user home
71 # and change backgroud image if the 3/4 is not respected.
72 if [ ! -f "$HOME/.jwmrc" ] ; then
73 cp /etc/jwm/system.jwmrc $HOME/.jwmrc
74 fi
75 if [ "$SCREEN" = "1280x1024x[0-9]" ] ; then
76 sed -i s/'1024x768.png'/'1280x1024.png'/ $HOME/.jwmrc
77 fi
78 if [ "$SCREEN" = "1024x768x[0-9]" ] ; then
79 sed -i s/'1280x1024.png'/'1024x768.png'/ $HOME/.jwmrc
80 fi
82 # Creat ~/.xsession to keep the configuration selected.
83 #
84 cat > $HOME/.xsession << EOT
85 # ~/.xsession: Start X window session on your system.
86 #
87 $XSERVER -ac -shadow -screen $SCREEN -mouse $MOUSE &
88 sleep 1 &
89 #xterm -bg khaki3 -fg white -cr orange -geometry 80x15+20+20 &
90 #xpad &
91 #mpg123 sound.wav &
92 exec $WM
93 EOT
95 chmod 700 $HOME/.xsession
97 # End messages.
98 echo "Configuration réussie."
99 echo "Screen : $SCREEN"
101 exit 0