tazlito view tazlitobox @ rev 132

Update and improve tazlitobox
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jan 22 23:28:53 2010 +0100 (2010-01-22)
parents 8db6f5f382ce
children 1cc96a18d594
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 /home/slitaz to download or gen flavors.
19 cd_flavors()
20 {
21 mkdir -p /home/slitaz/flavors
22 cd /home/slitaz
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 # tab-pos="GTK_POS_LEFT"
74 export MAIN_DIALOG='
75 <window title="Tazlito Box" icon-name="media-cdrom">
76 <vbox>
78 <hbox>
79 <text use-markup="true">
80 <label>"<b>SliTaz Live Tool</b>"</label>
82 </text>
83 <pixmap>
84 <input file>/usr/share/pixmaps/tazlito.png</input>
85 </pixmap>
87 </hbox>
89 <notebook labels="Writeiso|Live flavor|Flavors list|Gen flavor|Configuration files">
91 <frame Filesystem to ISO>
93 <text wrap="true" width-chars="60" use-markup="true">
94 <label>
95 "
96 Writeiso will generate an ISO image of the current filesystem as
97 it, including the /home direcory. It is an easy way to remaster
98 SliTaz Live system, you just have to: boot, modify, writeiso.
99 "
100 </label>
101 </text>
103 <hbox>
104 <text use-markup="true">
105 <label>"<b>Compression :</b> (gzip,lzma,none)"</label>
106 </text>
107 <entry>
108 <default>gzip</default>
109 <variable>COMPRESSION</variable>
110 </entry>
111 </hbox>
113 <hbox>
114 <text use-markup="true">
115 <label>"<b>ISO image name :</b> "</label>
116 </text>
117 <entry>
118 <default>slitaz</default>
119 <variable>WRITEISO_NAME</variable>
120 </entry>
121 </hbox>
122 <hbox>
123 <button>
124 <label>Writeiso</label>
125 <input file icon="forward"></input>
126 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "writeiso" -e "tazlito writeiso $COMPRESSION $WRITEISO_NAME"</action>
127 </button>
128 </hbox>
129 </frame>
131 <frame Current packages selection>
132 <text wrap="true" width-chars="60" use-markup="true">
133 <label>
134 "
135 Gen Live flavor will create a LiveCD based on all the currently
136 installed packages. To build the rootfs and ISO image it will use
137 original SliTaz packages.
138 "
139 </label>
140 </text>
142 <hbox>
143 <text use-markup="true">
144 <label>"<b>Flavor name :</b>"</label>
145 </text>
146 <entry>
147 <default>slitaz</default>
148 <variable>GEN_LIVEFLAVOR_NAME</variable>
149 </entry>
150 </hbox>
152 <hbox>
153 <button>
154 <label>Gen distro</label>
155 <input file icon="forward"></input>
156 <action>cd /home/slitaz</action>
157 <action>sed -i "s/ISO_NAME=.*/ISO_NAME=\"slitaz-$GEN_LIVEFLAVOR_NAME\"/" /etc/tazlito/tazlito.conf</action>
158 <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>
159 </button>
160 <button>
161 <label>Clean distro</label>
162 <input file icon="edit-clear"></input>
163 <action>cd /home/slitaz</action>
164 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "clean-distro" -e "tazlito clean-distro && sleep 1"</action>
165 </button>
166 </hbox>
168 </frame>
170 <frame Community and personal flavors>
171 <text wrap="true" width-chars="60" use-markup="true">
172 <label>
173 "
174 Get and build preconfigured flavors from the community. Flavors
175 list can be recharged from SliTaz mirror.
176 "
177 </label>
178 </text>
180 <hbox>
181 <text use-markup="true">
182 <label>"<b>Flavor :</b>"</label>
183 </text>
184 <entry>
185 <default>core</default>
186 <variable>COMMUNITY_FLAVOR</variable>
187 </entry>
188 </hbox>
190 <hbox>
191 <button>
192 <label>List flavors</label>
193 <input file icon="media-cdrom"></input>
194 <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>
195 </button>
196 <button>
197 <label>Recharge list</label>
198 <input file icon="reload"></input>
199 <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>
200 </button>
201 </hbox>
203 <hbox>
204 <button>
205 <label>Get flavor</label>
206 <input file icon="forward"></input>
207 <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>
208 </button>
209 <button>
210 <label>Gen distro</label>
211 <input file icon="forward"></input>
212 <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>
213 </button>
214 <button>
215 <label>Clean distro</label>
216 <input file icon="edit-clear"></input>
217 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x16 -title "clean-distro" -e "tazlito clean-distro && sleep 1"</action>
218 </button>
219 </hbox>
220 </frame>
222 <frame Generate a flavor>
224 <text wrap="true" width-chars="60" use-markup="true">
225 <label>
226 "
227 Gen Flavor will generate a new flavor file based on rootfs in
228 home/slitaz/distro.
229 "
230 </label>
231 </text>
233 <hbox>
234 <text use-markup="true">
235 <label>"<b>New flavor :</b>"</label>
236 </text>
237 <entry>
238 <default>slitaz</default>
239 <variable>GEN_FLAVOR_NAME</variable>
240 </entry>
241 </hbox>
242 <hbox>
243 <button>
244 <label>Gen new flavor</label>
245 <input file icon="forward"></input>
246 <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>
247 </button>
248 </hbox>
249 </frame>
251 <frame Flavor config and packages list>
252 <text wrap="true" width-chars="60" use-markup="true">
253 <label>
254 "
255 Before editing files you must have a flavor description.
256 "
257 </label>
258 </text>
260 <hbox>
261 <text use-markup="true">
262 <label>"<b>Flavor config :</b>"</label>
263 </text>
264 <entry>
265 <default>/home/slitaz/tazlito.conf</default>
266 <variable>CONFIG_FILE</variable>
267 </entry>
268 <button>
269 <input file icon="accessories-text-editor"></input>
270 <action>leafpad $CONFIG_FILE</action>
271 </button>
272 </hbox>
274 <hbox>
275 <text use-markup="true">
276 <label>"<b>Packages list :</b>"</label>
277 </text>
278 <entry>
279 <default>/home/slitaz/distro-packages.list</default>
280 <variable>PKGS_LIST</variable>
281 </entry>
282 <button>
283 <input file icon="accessories-text-editor"></input>
284 <action>leafpad $PKGS_LIST</action>
285 </button>
286 </hbox>
288 </frame>
290 </notebook>
292 <hbox>
293 <button help>
294 <input file icon="help-browser"></input>
295 <action type="launch">HELP</action>
296 </button>
297 <button>
298 <label>Exit</label>
299 <input file icon="exit"></input>
300 <action type="exit">Exit</action>
301 </button>
302 </hbox>
304 </vbox>
305 </window>
306 '
308 # Tazlitobox action
309 check_root
310 cd_flavors
311 gtkdialog --center --program=MAIN_DIALOG
313 exit 0