tazlito view tazlitobox @ rev 107
tazlito upgrade-flavor/pack-flavor: estimate sizes
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Aug 21 13:44:40 2009 +0200 (2009-08-21) |
parents | 5509085f8542 |
children | 459ca8ceaa7f |
line source
1 #! /bin/sh
2 #
3 # Gtkdialog box for Tazlito - SliTaz Live Tool.
4 #
5 VERSION=2.0
7 # Check if user is root.
8 check_root()
9 {
10 if test $(id -u) != 0 ; then
11 echo -e "
12 You must be root to run `basename $0`. Please type 'su' and
13 root password to become super-user.\n"
14 exit 0
15 fi
16 }
18 # By default we go in the flavors dir to download or gen flavors.
19 cd_flavors()
20 {
21 mkdir -p /home/slitaz/flavors
22 cd /home/slitaz/flavors
23 }
25 export HELP='
26 <window title="Tazlito Box - Help" icon-name="media-cdrom">
27 <vbox>
28 <text use-markup="true">
29 <label>"
30 <b>Tazlito Box - Help</b>"
31 </label>
32 </text>
34 <frame Overview>
35 <text wrap="true" width-chars="52" use-markup="true">
36 <label>
37 "
38 Tazlito Box is a tiny interface to the SliTaz Live Tool aka Tazlito.
39 You can simply generate a LiveCD in a few minutes, using your
40 own flavor or one from the SliTaz community. Tazlito can also
41 generate a LiveCD flavor using all of the currently installed
42 packages. Tazlito commands are executed in a XTerm, you can
43 press ENTER or the mouse to close the window.
44 "
45 </label>
46 </text>
47 </frame>
49 <frame Default paths>
50 <text wrap="true" width-chars="50" use-markup="true">
51 <label>
52 "
53 Distro : /home/slitaz/distro
54 Flavors : /home/slitaz/flavors
55 Packages : /home/slitaz/packages
56 "
57 </label>
58 </text>
59 </frame>
61 <hbox>
62 <button>
63 <input file icon="exit"></input>
64 <action type="closewindow">HELP</action>
65 </button>
66 </hbox>
68 </vbox>
69 </window>
70 '
72 # Execute tazlito commands in a XTerm.
73 #
74 export MAIN_DIALOG='
75 <window title="Tazlito Box" icon-name="media-cdrom">
76 <vbox>
78 <text use-markup="true">
79 <label>
80 "
81 <b>SliTaz Live Tool Box</b>"
82 </label>
83 </text>
84 <text wrap="true" width-chars="54" use-markup="true">
85 <label>
86 "
87 Generate a LiveCD flavor with Tazlito.
88 "
89 </label>
90 </text>
92 <notebook labels="System|Gen Flavor|Flavors|Configuration files">
94 <frame Current packages selection>
96 <text use-markup="true">
97 <label>
98 "
99 Gen distro will create a LiveCD based on all the currently installed packages.
100 "
101 </label>
102 </text>
104 <hbox>
105 <button>
106 <label>Gen distro</label>
107 <input file icon="forward"></input>
108 <action>cd /home/slitaz</action>
109 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "gen-liveflavor" -e "tazlito gen-liveflavor GEN_LIVEFLAVOR_NAME && echo -e \"----\nENTER to continue...\" && read close"</action>
110 </button>
111 <button>
112 <label>Clean distro</label>
113 <input file icon="edit-clear"></input>
114 <action>cd /home/slitaz</action>
115 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "clean-distro" -e "tazlito clean-distro && sleep 1"</action>
116 </button>
117 </hbox>
118 <hbox>
119 <text use-markup="true">
120 <label>"<b>Name :</b>"</label>
121 </text>
122 <entry>
123 <default>current-packages.iso</default>
124 <variable>GEN_LIVEFLAVOR_NAME</variable>
125 </entry>
126 </hbox>
127 </frame>
129 <frame Gen Flavor>
131 <text use-markup="true">
132 <label>
133 "
134 Gen Flavor will generate a new flavor file based on rootfs in
135 home/slitaz/distro.
136 "
137 </label>
138 </text>
140 <hbox>
141 <text use-markup="true">
142 <label>"<b>New flavor :</b>"</label>
143 </text>
144 <entry>
145 <default>home-made</default>
146 <variable>GEN_FLAVOR_NAME</variable>
147 </entry>
148 </hbox>
149 <hbox>
150 <button>
151 <label>Gen new flavor</label>
152 <input file icon="forward"></input>
153 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "gen-flavor $GEN_FLAVOR_NAME" -e "tazlito gen-flavor $GEN_FLAVOR_NAME && echo -e \"----\nENTER to continue...\" && read close"</action>
154 </button>
155 </hbox>
156 </frame>
158 <frame Community and personal flavors>
159 <text wrap="true" use-markup="true">
160 <label>
161 "
162 Flavors list can be recharged from SliTaz mirror.
163 "
164 </label>
165 </text>
167 <hbox>
168 <text use-markup="true">
169 <label>"<b>Flavor :</b>"</label>
170 </text>
171 <entry>
172 <default>core</default>
173 <variable>COMMUNITY_FLAVOR</variable>
174 </entry>
175 </hbox>
177 <hbox>
178 <button>
179 <label>List flavors</label>
180 <input file icon="media-cdrom"></input>
181 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "list-flavors" -e "tazlito list-flavors && echo -e \"----\nENTER to continue...\" && read close"</action>
182 </button>
183 <button>
184 <label>Recharge list</label>
185 <input file icon="reload"></input>
186 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "list-flavors --recharge" -e "tazlito list-flavors --recharge && echo -e \"----\nENTER to continue...\" && read close"</action>
187 </button>
188 </hbox>
190 <hbox>
191 <button>
192 <label>Get flavor</label>
193 <input file icon="forward"></input>
194 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "get-flavor $COMMUNITY_FLAVOR" -e "tazlito get-flavor $COMMUNITY_FLAVOR && echo -e \"----\nENTER to continue...\" && read close"</action>
195 </button>
196 <button>
197 <label>Gen distro</label>
198 <input file icon="forward"></input>
199 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "gen-distro" -e "tazlito gen-distro && echo -e \"----\nENTER to continue...\" && read close"</action>
200 </button>
201 <button>
202 <label>Clean distro</label>
203 <input file icon="edit-clear"></input>
204 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "clean-distro" -e "tazlito clean-distro && sleep 1"</action>
205 </button>
206 </hbox>
207 </frame>
209 <frame Flavor config and packages list>
210 <text wrap="true" use-markup="true">
211 <label>
212 "
213 Before editing files you must have a flavor description.
214 "
215 </label>
216 </text>
218 <hbox>
219 <text use-markup="true">
220 <label>"<b>Flavor config :</b>"</label>
221 </text>
222 <entry>
223 <default>/home/slitaz/flavors/tazlito.conf</default>
224 <variable>CONFIG_FILE</variable>
225 </entry>
226 <button>
227 <input file icon="accessories-text-editor"></input>
228 <action>leafpad $CONFIG_FILE</action>
229 </button>
230 </hbox>
232 <hbox>
233 <text use-markup="true">
234 <label>"<b>Packages list :</b>"</label>
235 </text>
236 <entry>
237 <default>/home/slitaz/flavors/distro-packages.list</default>
238 <variable>PKGS_LIST</variable>
239 </entry>
240 <button>
241 <input file icon="accessories-text-editor"></input>
242 <action>leafpad $PKGS_LIST</action>
243 </button>
244 </hbox>
246 </frame>
248 </notebook>
250 <hbox>
251 <button help>
252 <input file icon="help-browser"></input>
253 <action type="launch">HELP</action>
254 </button>
255 <button>
256 <input file icon="exit"></input>
257 <action type="exit">Exit</action>
258 </button>
259 </hbox>
261 </vbox>
262 </window>
263 '
265 # Tazlitobox action
266 check_root
267 cd_flavors
268 gtkdialog --center --program=MAIN_DIALOG
270 exit 0