diff options
author | fluxgen <fluxgen> | 2003-11-15 19:29:18 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-11-15 19:29:18 (GMT) |
commit | 220465ebbe2de9f464639594b45009b3fbfad087 (patch) | |
tree | ec409857a239ad089589269079a6731412f5bf91 | |
parent | ab46ba755d8ce6255f7f721a5adebec9186ee18f (diff) | |
download | fluxbox_pavel-220465ebbe2de9f464639594b45009b3fbfad087.zip fluxbox_pavel-220465ebbe2de9f464639594b45009b3fbfad087.tar.bz2 |
renamed
-rwxr-xr-x | util/fluxbox-generate_menu.in | 1081 |
1 files changed, 1081 insertions, 0 deletions
diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in new file mode 100755 index 0000000..079641d --- /dev/null +++ b/util/fluxbox-generate_menu.in | |||
@@ -0,0 +1,1081 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # generate_menu for Fluxbox | ||
4 | # | ||
5 | # Copyright (c) 2002 Han Boetes <han@mijncomputer.nl> | ||
6 | # | ||
7 | # Permission is hereby granted, free of charge, to any person obtaining a | ||
8 | # copy of this software and associated documentation files (the "Software"), | ||
9 | # to deal in the Software without restriction, including without limitation | ||
10 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
11 | # and/or sell copies of the Software, and to permit persons to whom the | ||
12 | # Software is furnished to do so, subject to the following conditions: | ||
13 | # | ||
14 | # The above copyright notice and this permission notice shall be included in | ||
15 | # all copies or substantial portions of the Software. | ||
16 | # | ||
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
20 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
23 | # DEALINGS IN THE SOFTWARE. | ||
24 | # | ||
25 | # $Id: fluxbox-generate_menu.in,v 1.1 2003/11/15 19:29:18 fluxgen Exp $ | ||
26 | |||
27 | # | ||
28 | # Portability notes: | ||
29 | # To guarantee this script works on all platforms that support fluxbox | ||
30 | # please keep the following restrictions in mind: | ||
31 | # | ||
32 | # - don't use if ! command;, use command; if [ $? -ne 0 ]; | ||
33 | # - don't use [ -e file ] use [ -r file ] | ||
34 | # - don't use $(), use `` | ||
35 | # - don't use ~, use ${HOME} | ||
36 | # - don't use id -u, use whoami | ||
37 | # - getopts won't work on all platforms, but the config-file can | ||
38 | # compensate for that. | ||
39 | # - various software like grep/sed/perl may be not present or not | ||
40 | # the version you have. for example grep '\W' only works on gnu-grep. | ||
41 | # Keep this in mind, use bare basic defaults. | ||
42 | # - Do _NOT_ suggest to use #!/bin/bash. Not everybody uses bash. | ||
43 | # Non portable features like getopts in this script can be achieved in | ||
44 | # other ways. | ||
45 | |||
46 | |||
47 | WHOAMI=`whoami` | ||
48 | [ "$WHOAMI" = root ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin | ||
49 | |||
50 | # Functions | ||
51 | display_usage() { | ||
52 | cat << EOF | ||
53 | Usage: fluxbox-generate_menu [-kgrBh] [-t terminal] [-w url] [-b browser] | ||
54 | [-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path] | ||
55 | EOF | ||
56 | } | ||
57 | |||
58 | display_help() { | ||
59 | display_usage | ||
60 | cat << EOF | ||
61 | |||
62 | Options: | ||
63 | |||
64 | -k Insert a kde menu | ||
65 | -g Add a gnome menu | ||
66 | -B enable backgrounds menu | ||
67 | -r Don't remove empty menu-entries; for templates | ||
68 | |||
69 | -t Favourite terminal | ||
70 | -w Homepage for console-browsers. Default is fluxbox.org | ||
71 | -b Favourite browser | ||
72 | -m Menu-title; default is "Fluxbox" | ||
73 | -o Outputfile; default is ~/.fluxbox/menu | ||
74 | -u user sub-menu; default is ~/.fluxbox/usermenu | ||
75 | |||
76 | -h Display this help | ||
77 | -a Display the authors of this script | ||
78 | |||
79 | Only for packagers: | ||
80 | |||
81 | -p prefix; default is /usr/local | ||
82 | -n Gnome-prefix; /opt, /usr, /usr/X11R6 and /usr/local autodetected | ||
83 | -q KDE-prefix; idem dito | ||
84 | |||
85 | |||
86 | Files: | ||
87 | ~/.fluxbux/usermenu your own submenu which will be included in the menu | ||
88 | ~/.fluxbox/menuconfig rc file for fluxbox-generate_menu | ||
89 | |||
90 | EOF | ||
91 | } | ||
92 | |||
93 | display_authors() { | ||
94 | cat << EOF | ||
95 | |||
96 | fluxbox-generate_menu was brought to you by: | ||
97 | |||
98 | Henrik Kinnunen: Project leader. | ||
99 | Han Boetes: Packaging, debugging and scripts. | ||
100 | Simon Bowden: Cleanups and compatibility for sun. | ||
101 | Jeramy B. Smith: Packaging assistance, gnome and kde menu system. | ||
102 | Filippo Pappalardo: Italian locales and -t option. | ||
103 | $WHOAMI: Innocent bystander. | ||
104 | |||
105 | EOF | ||
106 | } | ||
107 | |||
108 | # ugly code for solaris compat. | ||
109 | case `uname` in | ||
110 | Linux|*BSD) | ||
111 | find_it() { | ||
112 | which $1 > /dev/null 2>&1 && shift && $* | ||
113 | } | ||
114 | |||
115 | find_it_options() { | ||
116 | which $1 > /dev/null 2>&1 | ||
117 | } | ||
118 | ;; | ||
119 | *) | ||
120 | find_it() { | ||
121 | file=`which $1 2> /dev/null` | ||
122 | if [ -x "$file" ]; then | ||
123 | if [ $# -gt 1 ]; then | ||
124 | shift | ||
125 | $* | ||
126 | fi | ||
127 | return 0 | ||
128 | else | ||
129 | return 1 | ||
130 | fi | ||
131 | } | ||
132 | |||
133 | find_it_options() { | ||
134 | file=`which $1 2> /dev/null` | ||
135 | if [ -x "$file" ]; then | ||
136 | return 0 | ||
137 | else | ||
138 | return 1 | ||
139 | fi | ||
140 | } | ||
141 | |||
142 | ;; | ||
143 | esac | ||
144 | |||
145 | append() { | ||
146 | echo " $*" >> ${MENUFILENAME} | ||
147 | } | ||
148 | |||
149 | append_menu() { | ||
150 | echo "$*" >> ${MENUFILENAME} | ||
151 | } | ||
152 | |||
153 | append_submenu() { | ||
154 | [ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates | ||
155 | append_menu "[submenu] ($1)" | ||
156 | } | ||
157 | |||
158 | append_menu_end() { | ||
159 | append_menu '[end]' | ||
160 | [ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates | ||
161 | } | ||
162 | |||
163 | menu_entry() { | ||
164 | if [ -f "$1" ]; then | ||
165 | # space&tab here | ||
166 | entry_name=`grep '^[ ]*Name=' "$1" | head -1 | cut -d = -f 2` | ||
167 | entry_exec=`grep '^[ ]*Exec=' "$1" | head -1 | cut -d = -f 2` | ||
168 | if [ -n "$entry_name" -a -n "$entry_exec" ]; then | ||
169 | append "[exec] ($entry_name) {$entry_exec}" | ||
170 | fi | ||
171 | fi | ||
172 | } | ||
173 | |||
174 | menu_entry_dir() { | ||
175 | for b in "$*"/*.desktop; do | ||
176 | menu_entry "${b}" | ||
177 | done | ||
178 | } | ||
179 | |||
180 | menu_entry_dircheck() { | ||
181 | if [ -d "$*" ]; then | ||
182 | menu_entry_dir "$*" | ||
183 | fi | ||
184 | } | ||
185 | |||
186 | |||
187 | # recursively build a menu from the listed directories | ||
188 | # the dirs are merged | ||
189 | recurse_dir_menu () { | ||
190 | ls "$@"/ 2>/dev/null | sort | uniq | while read name; do | ||
191 | for dir in "$@"; do | ||
192 | if [ -n "$name" -a -d "$dir/$name" ]; then | ||
193 | # recurse | ||
194 | append_submenu "${name}" | ||
195 | # unfortunately, this is messy since we can't easily expand | ||
196 | # them all. Only allow for 3 atm. Add more if needed | ||
197 | recurse_dir_menu ${1:+"$1/$name"} ${2:+"$2/$name"} ${3:+"$3/$name"} | ||
198 | append_menu_end | ||
199 | break; # found one, it'll pick up all the rest | ||
200 | fi | ||
201 | # ignore it if it is a file, since menu_entry_dir picks those up | ||
202 | done | ||
203 | done | ||
204 | |||
205 | # Make entries for current dir after all submenus | ||
206 | for dir in "$@"; do | ||
207 | menu_entry_dircheck "${dir}" | ||
208 | done | ||
209 | } | ||
210 | |||
211 | |||
212 | normal_find() { | ||
213 | while [ "$1" ]; do | ||
214 | find_it $1 append "[exec] ($1) {$1}" | ||
215 | shift | ||
216 | done | ||
217 | } | ||
218 | |||
219 | clean_up() { | ||
220 | # Some magic to clean up empty menus | ||
221 | rm -f ${MENUFILENAME}.tmp | ||
222 | touch ${MENUFILENAME}.tmp | ||
223 | until diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp > /dev/null 2>&1; do | ||
224 | [ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME} | ||
225 | grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{ | ||
226 | n | ||
227 | N | ||
228 | /^\[submenu].*\n\[end]/d | ||
229 | }"|sed -e "/^\[submenu].*/{ | ||
230 | N | ||
231 | /^\[submenu].*\n\[end]/d | ||
232 | }" > ${MENUFILENAME}.tmp | ||
233 | done | ||
234 | rm -f ${MENUFILENAME}.tmp | ||
235 | } | ||
236 | |||
237 | # menu defaults (if translation forget to set one of them) | ||
238 | BACKGROUNDMENU='Backgrounds' | ||
239 | BACKGROUNDMENUTITLE='Set the Background' | ||
240 | BROWSERMENU='Browsers' | ||
241 | CONFIGUREMENU='Configure' | ||
242 | EDITORMENU='Editors' | ||
243 | EXITITEM='Exit' | ||
244 | FBSETTINGSMENU='fluxbox menu' | ||
245 | FILEUTILSMENU='File utils' | ||
246 | GAMESMENU='Games' | ||
247 | GNOMEMENUTEXT='Gnome-menus' | ||
248 | GRAPHICMENU='Graphics' | ||
249 | KDEMENUTEXT='KDE-menus' | ||
250 | MISCMENU='Misc' | ||
251 | MULTIMEDIAMENU='Multimedia' | ||
252 | MUSICMENU='Audio' | ||
253 | NETMENU='Net' | ||
254 | OFFICEMENU='Office' | ||
255 | RELOADITEM='Reload config' | ||
256 | RESTARTITEM='Restart' | ||
257 | STYLEMENUTITLE='Choose a style...' | ||
258 | SYSTEMSTYLES='System Styles' | ||
259 | TERMINALMENU='Terminals' | ||
260 | USERSTYLES='User Styles' | ||
261 | VIDEOMENU='Video' | ||
262 | WINDOWMANAGERS='Window Managers' | ||
263 | WORKSPACEMENU='Workspace List' | ||
264 | XUTILSMENU='X-utils' | ||
265 | |||
266 | # Check translation | ||
267 | case ${LC_ALL} in | ||
268 | ru_RU*) #Russian locales | ||
269 | #BACKGROUNDMENU='Backgrounds' | ||
270 | #BACKGROUNDMENUTITLE='Set the Background' | ||
271 | #FILEUTILSMENU='File utils' | ||
272 | #OFFICEMENU='Office' | ||
273 | #SYSTEMSTYLES='óÔÉÌÉ' | ||
274 | #USERSTYLES='óÔÉÌÉ' | ||
275 | #WINDOWMANAGERS='WindowManagers' | ||
276 | BROWSERMENU='âÒÁÕÚÅÒÙ' | ||
277 | CONFIGUREMENU='îÁÓÔÒÏÊËÁ' | ||
278 | EDITORMENU='òÅÄÁËÔÏÒÙ' | ||
279 | EXITITEM='÷ÙÊÔÉ' | ||
280 | FBSETTINGSMENU='FB-ÎÁÓÔÒÏÊËÉ' | ||
281 | GNOMEMENUTEXT='Gnome-ÍÅÎÀ' | ||
282 | GRAPHICMENU='çÒÁÆÉËÁ' | ||
283 | KDEMENUTEXT='KDE-ÍÅÎÀ' | ||
284 | MISCMENU='ðÒÏÞÅÅ' | ||
285 | MUSICMENU='ú×ÕË' | ||
286 | NETMENU='óÅÔØ' | ||
287 | RELOADITEM='ðÅÒÅÎÁÓÔÒÏÉÔØ' | ||
288 | RESTARTITEM='ðÅÒÅÚÁÐÕÓÔÉÔØ' | ||
289 | STYLEMENUTITLE='÷ÙÂÅÒÉÔÅ ÓÔÉÌØ' | ||
290 | TERMINALMENU='ôÅÒÍÉÎÁÌÙ' | ||
291 | WORKSPACEMENU='òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á' | ||
292 | XUTILSMENU='X-ÕÔÉÌÉÔÙ' | ||
293 | ;; | ||
294 | de_DE*) # german locales | ||
295 | #WINDOWMANAGERS='Window Managers' | ||
296 | BACKGROUNDMENU='Hintergrundbilder' | ||
297 | BACKGROUNDMENUTITLE='Hintergrundbild setzen' | ||
298 | BROWSERMENU='Internet-Browser' | ||
299 | CONFIGUREMENU='Einstellungen' | ||
300 | EDITORMENU='Editoren' | ||
301 | EXITITEM='Beenden' | ||
302 | FBSETTINGSMENU='Fluxbox-Einstellungen' | ||
303 | FILEUTILSMENU='Datei-Utilities' | ||
304 | GNOMEMENUTEXT='Gnome-Menues' | ||
305 | GRAPHICMENU='Grafik' | ||
306 | KDEMENUTEXT='Kde-Menues' | ||
307 | MISCMENU='Sonstiges' | ||
308 | MUSICMENU='Musik' | ||
309 | NETMENU='Netzwerk' | ||
310 | OFFICEMENU='Bueroprogramme' | ||
311 | RELOADITEM='Konfiguration neu laden' | ||
312 | RESTARTITEM='Neustarten' | ||
313 | STYLEMENUTITLE='Einen Stil auswaehlen...' | ||
314 | SYSTEMSTYLES='Systemweite Stile' | ||
315 | TERMINALMENU='Terminals' | ||
316 | USERSTYLES='Eigene Stile' | ||
317 | WORKSPACEMENU='Arbeitsflaechenliste' | ||
318 | XUTILSMENU='X-Anwendungen' | ||
319 | ;; | ||
320 | sv_SE*) #Swedish locales | ||
321 | #BACKGROUNDMENU='Backgrounds' | ||
322 | #BACKGROUNDMENUTITLE='Set the Background' | ||
323 | #FILEUTILSMENU='File utils' | ||
324 | #OFFICEMENU='Office' | ||
325 | #SYSTEMSTYLES='Stiler' | ||
326 | #USERSTYLES='Stiler' | ||
327 | #WINDOWMANAGERS='Window Managers' | ||
328 | BROWSERMENU='Browsers' | ||
329 | CONFIGUREMENU='Konfiguration' | ||
330 | EDITORMENU='Editorer' | ||
331 | EXITITEM='Exit' | ||
332 | FBSETTINGSMENU='FB-inställningar' | ||
333 | GNOMEMENUTEXT='Gnome-menyer' | ||
334 | GRAPHICMENU='Grafik' | ||
335 | KDEMENUTEXT='KDE-menyer' | ||
336 | MISCMENU='Blandat' | ||
337 | MUSICMENU='Musik' | ||
338 | NETMENU='Net' | ||
339 | RELOADITEM='Ladda om konfig' | ||
340 | RESTARTITEM='Starta om' | ||
341 | STYLEMENUTITLE='Välj en stil' | ||
342 | TERMINALMENU='Terminaler' | ||
343 | WORKSPACEMENU='Arbetsytor' | ||
344 | XUTILSMENU='X-program' | ||
345 | ;; | ||
346 | nl_NL*) #Nederlandse locales | ||
347 | BACKGROUNDMENU='Achtergrond' | ||
348 | BACKGROUNDMENUTITLE='Kies een achtergrond' | ||
349 | BROWSERMENU='Browsers' | ||
350 | CONFIGUREMENU='Instellingen' | ||
351 | EDITORMENU='Editors' | ||
352 | EXITITEM='Afsluiten' | ||
353 | FBSETTINGSMENU='FB-Instellingen' | ||
354 | FILEUTILSMENU='Verkenners' | ||
355 | GNOMEMENUTEXT='Gnome-menu' | ||
356 | GRAPHICMENU='Grafisch' | ||
357 | KDEMENUTEXT='KDE-menu' | ||
358 | MISCMENU='Onregelmatig' | ||
359 | MUSICMENU='Muziek' | ||
360 | NETMENU='Net' | ||
361 | OFFICEMENU='Office' | ||
362 | RELOADITEM='Vernieuw instellingen' | ||
363 | RESTARTITEM='Herstart' | ||
364 | STYLEMENUTITLE='Kies een stijl' | ||
365 | SYSTEMSTYLES='Systeem Stijlen' | ||
366 | TERMINALMENU='Terminals' | ||
367 | USERSTYLES='Gebruikers Stijlen' | ||
368 | WINDOWMANAGERS='Window Managers' | ||
369 | WORKSPACEMENU='Werkveld menu' | ||
370 | XUTILSMENU='X-utils' | ||
371 | ;; | ||
372 | fi_FI*) #Finnish locales | ||
373 | BACKGROUNDMENU='Taustat' | ||
374 | BACKGROUNDMENUTITLE='Määritä tausta' | ||
375 | BROWSERMENU='Selaimet' | ||
376 | CONFIGUREMENU='Konfigurointi' | ||
377 | EDITORMENU='Editorit' | ||
378 | EXITITEM='Lopeta' | ||
379 | FBSETTINGSMENU='FB:n Asetukset' | ||
380 | FILEUTILSMENU='Tiedostoapuohjelmat' | ||
381 | GNOMEMENUTEXT='Gnomen valikot' | ||
382 | GRAPHICMENU='Grafiikka' | ||
383 | KDEMENUTEXT='KDE:n valikot' | ||
384 | MISCMENU='Sekalaista' | ||
385 | MUSICMENU='Musikki' | ||
386 | NETMENU='Verkko' | ||
387 | OFFICEMENU='Toimistotyökalut' | ||
388 | RELOADITEM='Päivitä' | ||
389 | RESTARTITEM='Käynnistä uudelleen' | ||
390 | STYLEMENUTITLE='Valitse tyyli' | ||
391 | SYSTEMSTYLES='Järjestelmän tyylit' | ||
392 | TERMINALMENU='Terminaalit' | ||
393 | USERSTYLES='Käyttäjän tyylit' | ||
394 | WINDOWMANAGERS='Ikkunanhallintaohjelmat' | ||
395 | WORKSPACEMENU='Työaluet' | ||
396 | XUTILSMENU='X-Ohjelmat' | ||
397 | ;; | ||
398 | ja_JP*) #Japanese locales | ||
399 | #BACKGROUNDMENU='Backgrounds' | ||
400 | #BACKGROUNDMENUTITLE='Set the Background' | ||
401 | #FILEUTILSMENU='File utils' | ||
402 | #OFFICEMENU='Office' | ||
403 | #SYSTEMSTYLES='¥¹¥¿¥¤¥ë' | ||
404 | #USERSTYLES='¥¹¥¿¥¤¥ë' | ||
405 | #WINDOWMANAGERS='Window Managers' | ||
406 | BROWSERMENU='¥Ö¥é¥¦¥¶' | ||
407 | CONFIGUREMENU='ÀßÄê' | ||
408 | EDITORMENU='¥¨¥Ç¥£¥¿' | ||
409 | EXITITEM='½ªÎ»' | ||
410 | FBSETTINGSMENU='FluxboxÀßÄê' | ||
411 | GNOMEMENUTEXT='Gnome¥á¥Ë¥å¡¼' | ||
412 | GRAPHICMENU='²èÁü' | ||
413 | KDEMENUTEXT='KDE¥á¥Ë¥å¡¼' | ||
414 | MISCMENU='¤¤¤í¤¤¤í' | ||
415 | MUSICMENU='²»³Ú' | ||
416 | NETMENU='¥Í¥Ã¥È¥ï¡¼¥¯' | ||
417 | RELOADITEM='ºÆÆɤ߹þ¤ß' | ||
418 | RESTARTITEM='ºÆµ¯Æ°' | ||
419 | STYLEMENUTITLE='¥¹¥¿¥¤¥ëÁªÂò...' | ||
420 | TERMINALMENU='¥¿¡¼¥ß¥Ê¥ë' | ||
421 | WORKSPACEMENU='¥ï¡¼¥¯¥¹¥Ú¡¼¥¹' | ||
422 | XUTILSMENU='X¥æ¡¼¥Æ¥£¥ê¥Æ¥£' | ||
423 | ;; | ||
424 | fr_FR*) # french locales | ||
425 | BACKGROUNDMENU="Fond d'écran" | ||
426 | BACKGROUNDMENUTITLE="Changer le fond d'écran" | ||
427 | BROWSERMENU='Navigateurs' | ||
428 | CONFIGUREMENU='Configurer' | ||
429 | EDITORMENU='Editeurs' | ||
430 | EXITITEM='Sortir' | ||
431 | FBSETTINGSMENU='Configurer Fluxbox' | ||
432 | FILEUTILSMENU='Outils fichiers' | ||
433 | GNOMEMENUTEXT='Menus Gnome' | ||
434 | GRAPHICMENU='Graphisme' | ||
435 | KDEMENUTEXT='Menus KDE' | ||
436 | MISCMENU='Divers' | ||
437 | MUSICMENU='Musique' | ||
438 | NETMENU='Réseau' | ||
439 | OFFICEMENU='Bureautique' | ||
440 | RELOADITEM='Recharger la configuration' | ||
441 | RESTARTITEM='Redémarrer Fluxbox' | ||
442 | STYLEMENUTITLE='Choisir un style...' | ||
443 | SYSTEMSTYLES='Styles Systeme' | ||
444 | TERMINALMENU='Terminaux' | ||
445 | USERSTYLES='Styles Utilisateur' | ||
446 | WINDOWMANAGERS='Gestionnaires de fenêtres' | ||
447 | WORKSPACEMENU='Liste des bureaux' | ||
448 | XUTILSMENU='Outils X' | ||
449 | ;; | ||
450 | it_IT*) # italian locales | ||
451 | #BACKGROUNDMENU='Backgrounds' | ||
452 | #BACKGROUNDMENUTITLE='Set the Background' | ||
453 | #FILEUTILSMENU='File utils' | ||
454 | #OFFICEMENU='Office' | ||
455 | #SYSTEMSTYLES='Stile' | ||
456 | #USERSTYLES='Stile' | ||
457 | #WINDOWMANAGERS='Window Managers' | ||
458 | BROWSERMENU='Browsers' | ||
459 | CONFIGUREMENU='Configurazione' | ||
460 | EDITORMENU='Editori' | ||
461 | EXITITEM='Esci' | ||
462 | FBSETTINGSMENU='Preferenze' | ||
463 | GAMESMENU='Giochi' | ||
464 | GNOMEMENUTEXT='Gnome' | ||
465 | GRAPHICMENU='Grafica' | ||
466 | KDEMENUTEXT='KDE' | ||
467 | MISCMENU='Varie' | ||
468 | MUSICMENU='Musica' | ||
469 | NETMENU='Internet' | ||
470 | RELOADITEM='Rileggi la configurazione' | ||
471 | RESTARTITEM='Riavvia' | ||
472 | STYLEMENUTITLE='Scegli uno stile' | ||
473 | TERMINALMENU='Terminali' | ||
474 | WORKSPACEMENU='Aree di lavoro' | ||
475 | XUTILSMENU='X-utils' | ||
476 | ;; | ||
477 | ro_RO*) # Romanian locales | ||
478 | #FILEUTILSMENU='File utils' | ||
479 | #OFFICEMENU='Office' | ||
480 | #RESTARTITEM='Restart' | ||
481 | #WINDOWMANAGERS='WindowManagers' | ||
482 | BACKGROUNDMENU='Fundaluri' | ||
483 | BACKGROUNDMENUTITLE='Alege fundalul' | ||
484 | BROWSERMENU='Navigatoare' | ||
485 | CONFIGUREMENU='Configurare' | ||
486 | EDITORMENU='Editoare' | ||
487 | EXITITEM='Iesire' | ||
488 | FBSETTINGSMENU='Meniul Fluxbox' | ||
489 | GAMESMENU='Jocuri' | ||
490 | GNOMEMENUTEXT='Meniu Gnome' | ||
491 | GRAPHICMENU='Grafica' | ||
492 | KDEMENUTEXT='Meniu KDE' | ||
493 | MISCMENU='Diverse' | ||
494 | MULTIMEDIAMENU='Multimedia' | ||
495 | MUSICMENU='Muzica' | ||
496 | NETMENU='Net' | ||
497 | RELOADITEM='Reincarca configuratia' | ||
498 | STYLEMENUTITLE='Alege un stil...' | ||
499 | SYSTEMSTYLES='Stiluri sistem' | ||
500 | TERMINALMENU='Terminale' | ||
501 | USERSTYLES='Stiluri utilizator' | ||
502 | WORKSPACEMENU='Lista workspace-uri' | ||
503 | XUTILSMENU='Utilitare X' | ||
504 | ;; | ||
505 | es_ES*) # spanish locales | ||
506 | #FILEUTILSMENU='File utils' | ||
507 | #WINDOWMANAGERS='WindowManagers' | ||
508 | BACKGROUNDMENU='Fondos' | ||
509 | BACKGROUNDMENUTITLE='Seleccionar Fondo' | ||
510 | BROWSERMENU='Navegadores' | ||
511 | CONFIGUREMENU='Configurar' | ||
512 | EDITORMENU='Editores' | ||
513 | EXITITEM='Salir' | ||
514 | FBSETTINGSMENU='Menú fluxbox' | ||
515 | GAMESMENU='Juegos' | ||
516 | GNOMEMENUTEXT='Menús Gnome' | ||
517 | GRAPHICMENU='Gráficos' | ||
518 | KDEMENUTEXT='Menús KDE' | ||
519 | MISCMENU='Varios' | ||
520 | MULTIMEDIAMENU='Multimedia' | ||
521 | MUSICMENU='Música' | ||
522 | NETMENU='Red' | ||
523 | OFFICEMENU='Oficina' | ||
524 | RELOADITEM='Reconfigurar' | ||
525 | RESTARTITEM='Reiniciar' | ||
526 | STYLEMENUTITLE='Escoge un Estilo...' | ||
527 | SYSTEMSTYLES='Estilos del Sistema' | ||
528 | TERMINALMENU='Terminales' | ||
529 | USERSTYLES='Estilos del Usuario' | ||
530 | WORKSPACEMENU='Lista de Escritorios' | ||
531 | XUTILSMENU='Utilidades X' | ||
532 | ;; | ||
533 | pl_PL*) # Polish locales | ||
534 | #FILEUTILSMENU='File utils' | ||
535 | #WINDOWMANAGERS='WindowManagers' | ||
536 | BACKGROUNDMENU='Tapety' | ||
537 | BACKGROUNDMENUTITLE='Ustaw tapet?' | ||
538 | BROWSERMENU='Przegl?darki' | ||
539 | CONFIGUREMENU='Konfiguracja' | ||
540 | EDITORMENU='Edytory' | ||
541 | EXITITEM='Wyj?cie' | ||
542 | FBSETTINGSMENU='Menu Fluxbox' | ||
543 | GAMESMENU='Gry' | ||
544 | GNOMEMENUTEXT='Menu Gnome' | ||
545 | GRAPHICMENU='Grafika' | ||
546 | KDEMENUTEXT='Menu KDE' | ||
547 | MISCMENU='Ró?ne' | ||
548 | MULTIMEDIAMENU='Multimedia' | ||
549 | MUSICMENU='Muzyka' | ||
550 | NETMENU='Sie?' | ||
551 | OFFICEMENU='Aplikacje biurowe' | ||
552 | RELOADITEM='Od?wie? konfiguracj?' | ||
553 | RESTARTITEM='Restart' | ||
554 | STYLEMENUTITLE='Wybierz styl...' | ||
555 | SYSTEMSTYLES='Style systemowe' | ||
556 | TERMINALMENU='Terminale' | ||
557 | USERSTYLES='Style u?ytkownika' | ||
558 | WORKSPACEMENU='Lista pulpitów' | ||
559 | XUTILSMENU='Narz?dzia X' | ||
560 | ;; | ||
561 | *) | ||
562 | ;; | ||
563 | esac | ||
564 | |||
565 | # Set Defaults | ||
566 | MENUFILENAME="${MENUFILENAME:=${HOME}/.fluxbox/menu}" | ||
567 | MENUTITLE="${MENUTITLE:=Fluxbox}" | ||
568 | HOMEPAGE="${HOMEPAGE:=fluxbox.org}" | ||
569 | USERMENU="${USERMENU:=${HOME}/.fluxbox/usermenu}" | ||
570 | |||
571 | # Read the menuconfig file if it exists or else create it. | ||
572 | # But not during install time, use envvar for sun | ||
573 | if [ ! "${INSTALL}" = Yes ]; then | ||
574 | if [ -r ${HOME}/.fluxbox/menuconfig ]; then | ||
575 | . ${HOME}/.fluxbox/menuconfig | ||
576 | else | ||
577 | if [ ! "$WHOAMI" = root ]; then # this is only for users. | ||
578 | if touch ${HOME}/.fluxbox/menuconfig; then | ||
579 | cat << EOF > ${HOME}/.fluxbox/menuconfig | ||
580 | # This file is read by fluxbox-generate_menu. If you don't like a | ||
581 | # default you can change it here. Don't forget to remove the # in front | ||
582 | # of the line. | ||
583 | |||
584 | # Your favourite terminal. Put the command in quotes if you want to use | ||
585 | # options. Put a backslash in before odd chars | ||
586 | # MY_TERM='Eterm --tint \#123456' | ||
587 | # MY_TERM='aterm -tint $(random_color)' | ||
588 | |||
589 | # Your favourite browser. You can also specify options. | ||
590 | # MY_BROWSER=mozilla | ||
591 | |||
592 | # Name of the outputfile | ||
593 | # MENUFILENAME=${HOME}/.fluxbox/menu | ||
594 | |||
595 | # MENUTITLE=\`fluxbox -version|cut -d " " -f-2\` | ||
596 | |||
597 | # standard url for console-browsers | ||
598 | # HOMEPAGE=fluxbox.org | ||
599 | |||
600 | # location with your own menu-entries | ||
601 | # USERMENU=~/.fluxbox/usermenu | ||
602 | |||
603 | # Options for fbrun | ||
604 | # FBRUNOPTIONS='-font 10x20 -fg grey -bg black -title run' | ||
605 | |||
606 | # --- PREFIX'es | ||
607 | # These are prefixes; So if fluxbox is installed in /usr/bin/fluxbox | ||
608 | # your prefix is: /usr | ||
609 | |||
610 | # fluxbox-generate already looks in /usr/X11R6, /usr, /usr/local and /opt so | ||
611 | # there should be no need to specify them. | ||
612 | # | ||
613 | # PREFIX=/usr | ||
614 | # GNOME_PREFIX=/opt/gnome | ||
615 | # KDE_PREFIX=/opt/kde | ||
616 | |||
617 | |||
618 | # Sepparate the list of background-dirs with semicolumns ':' | ||
619 | # BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:/usr/local/share/fluxbox/backgrounds/:/usr/share/wallpapers" | ||
620 | |||
621 | |||
622 | # --- Boolean variables. | ||
623 | # Setting a variable to ``no'' won't help. Comment them out if you don't | ||
624 | # want them. Setting are overruled by the command-line options. | ||
625 | |||
626 | # Include all backgrounds in your backgrounds-directory | ||
627 | # BACKGROUNDMENUITEM=yes | ||
628 | |||
629 | # Include kde-menus | ||
630 | # KDEMENU=yes | ||
631 | |||
632 | # Include gnome-menus | ||
633 | # GNOMEMENU=yes | ||
634 | |||
635 | # Don't cleanup the menu | ||
636 | # REMOVE=no | ||
637 | |||
638 | EOF | ||
639 | else | ||
640 | echo "Warning: I couldn't create ${HOME}/.fluxbox/menuconfig" >&2 | ||
641 | fi | ||
642 | fi | ||
643 | fi | ||
644 | fi | ||
645 | |||
646 | testoption() { | ||
647 | if [ -z "$3" -o -n "`echo $3|grep '^-'`" ]; then | ||
648 | echo "Error: The option $2 requires an argument." >&2 | ||
649 | exit 1 | ||
650 | fi | ||
651 | case $1 in | ||
652 | ex) # executable | ||
653 | if find_it "$3"; then | ||
654 | : | ||
655 | else | ||
656 | echo "Error: The option $2 needs an executable as argument, and \`$3' is not." >&2 | ||
657 | fi | ||
658 | ;; | ||
659 | di) # directory | ||
660 | if [ -d "$3" ]; then | ||
661 | : | ||
662 | else | ||
663 | echo "Error: The option $2 needs a directory as argument, and \`$3' is not." >&2 | ||
664 | fi | ||
665 | ;; | ||
666 | fl) # file | ||
667 | if [ -r "$3" ]; then | ||
668 | : | ||
669 | else | ||
670 | echo "Error: The option $2 needs a readable file as argument, and \`$3' is not." >&2 | ||
671 | fi | ||
672 | ;; | ||
673 | sk) # skip | ||
674 | : | ||
675 | ;; | ||
676 | esac | ||
677 | } | ||
678 | |||
679 | # Get options. | ||
680 | while [ $# -gt 0 ]; do | ||
681 | case "$1" in | ||
682 | -B) BACKGROUNDMENUITEM=yes; shift;; | ||
683 | -k) KDEMENU=yes; shift;; | ||
684 | -g) GNOMEMENU=yes; shift;; | ||
685 | -t) MY_TERM=${2}; testoption ex $1 $2; shift 2;; | ||
686 | -b) MY_BROWSER=${2}; testoption ex $1 $2; shift 2;; | ||
687 | -o) MENUFILENAME=${2}; testoption fi $1 $2; shift 2;; | ||
688 | -p) PREFIX=${2}; testoption di $1 $2; shift 2;; | ||
689 | -n) GNOME_PREFIX=${2}; testoption di $1 $2; shift 2;; | ||
690 | -q) KDE_PREFIX=${2}; testoption di $1 $2; shift 2;; | ||
691 | -m) MENUTITLE=${2}; testoption sk $1 $2; shift 2;; | ||
692 | -w) HOMEPAGE=${2}; testoption sk $1 $2; shift 2;; | ||
693 | -u) USERMENU=${2}; testoption fl $1 $2; shift 2;; | ||
694 | -r) REMOVE=no; shift;; | ||
695 | -h) display_help ; exit 0 ;; | ||
696 | -a) display_authors ; exit 0 ;; | ||
697 | --*) echo "fluxbox-generate_menu doesn't recognize -- gnu-longopts." | ||
698 | echo 'Use fluxbox-generate_menu -h for a long help message.' | ||
699 | display_usage | ||
700 | exit 1 ;; | ||
701 | -[a-zA-Z][a-zA-Z]*) | ||
702 | # split concatenated single-letter options apart | ||
703 | FIRST="$1"; shift | ||
704 | set -- `echo "$FIRST" | sed 's/^-\(.\)\(.*\)/-\1 -\2/'` "$@" | ||
705 | ;; | ||
706 | -*) | ||
707 | echo 1>&2 "fluxbox-generate_menu: unrecognized option "\`"$1'" | ||
708 | display_usage | ||
709 | exit 1 | ||
710 | ;; | ||
711 | *) | ||
712 | break | ||
713 | ;; | ||
714 | esac | ||
715 | done | ||
716 | |||
717 | # Check defaults | ||
718 | |||
719 | # Can we actually create ${MENUFILENAME} | ||
720 | touch ${MENUFILENAME} 2> /dev/null | ||
721 | if [ $? -ne 0 ]; then | ||
722 | echo "Fatal error: can't create or write to $MENUFILENAME" >&2 | ||
723 | exit 1 | ||
724 | fi | ||
725 | |||
726 | # backup menu | ||
727 | if [ -w "${MENUFILENAME}" ]; then | ||
728 | if [ -f ${MENUFILENAME}.firstbak ]; then | ||
729 | cp ${MENUFILENAME} ${MENUFILENAME}.firstbak | ||
730 | fi | ||
731 | mv ${MENUFILENAME} ${MENUFILENAME}.bak | ||
732 | fi | ||
733 | |||
734 | # prefix | ||
735 | PREFIX="${PREFIX:=@PREFIX@}" | ||
736 | if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then | ||
737 | PREFIX=`which fluxbox | sed 's,/bin/fluxbox$,,'` | ||
738 | fi | ||
739 | |||
740 | |||
741 | # gnome prefix | ||
742 | for GNOME_PREFIX in "${GNOME_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do | ||
743 | if [ -n "${GNOME_PREFIX}" -a -d "$GNOME_PREFIX/share/gnome" ]; then | ||
744 | break; | ||
745 | fi | ||
746 | done | ||
747 | # Will remain $PREFIX if all else fails | ||
748 | |||
749 | # kde prefix | ||
750 | for KDE_PREFIX in "${KDE_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do | ||
751 | if [ -n "${KDE_PREFIX}" -a -d "$KDE_PREFIX/share/applnk" ]; then | ||
752 | break; | ||
753 | fi | ||
754 | done | ||
755 | |||
756 | # directory for the backgrounds | ||
757 | if [ -z "$BACKGROUND_DIRS" ]; then | ||
758 | BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/" | ||
759 | fi | ||
760 | |||
761 | # find the default terminal | ||
762 | if find_it_options $MY_TERM; then | ||
763 | DEFAULT_TERM=$MY_TERM | ||
764 | else | ||
765 | [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 | ||
766 | #The precise order is up for debate. | ||
767 | for term in Eterm aterm rxvt wterm xterm konsole gnome-terminal; do | ||
768 | if find_it $term; then | ||
769 | DEFAULT_TERM=$term | ||
770 | break | ||
771 | fi | ||
772 | done | ||
773 | fi | ||
774 | DEFAULT_TERMNAME=`echo $DEFAULT_TERM|awk '{print $1}'` | ||
775 | DEFAULT_TERMNAME=`basename $DEFAULT_TERMNAME` | ||
776 | |||
777 | |||
778 | # find the default browser | ||
779 | if find_it_options $MY_BROWSER; then | ||
780 | DEFAULT_BROWSER=$MY_BROWSER | ||
781 | else | ||
782 | [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2 | ||
783 | #The precise order is up for debate. | ||
784 | for browser in mozilla-firebird MozillaFirebird opera skipstone mozilla galeon konqueror dillo netscape w3m links lynx; do | ||
785 | if find_it $browser; then | ||
786 | DEFAULT_BROWSER=$browser | ||
787 | break | ||
788 | fi | ||
789 | done | ||
790 | fi | ||
791 | DEFAULT_BROWSERNAME=`echo $DEFAULT_BROWSER|awk '{print $1}'` | ||
792 | DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME` | ||
793 | |||
794 | |||
795 | # a unix system without any terms. that's odd | ||
796 | if [ -z "$DEFAULT_TERM" ]; then | ||
797 | cat << EOF >&2 | ||
798 | Warning: I can't find any terminal-emulators in your PATH. | ||
799 | Please fix your PATH or specify your favourite terminal with the -t option | ||
800 | EOF | ||
801 | fi | ||
802 | |||
803 | |||
804 | # Start of menu | ||
805 | cat << EOF > ${MENUFILENAME} | ||
806 | # Generated by fluxbox-generate_menu | ||
807 | # | ||
808 | # If you read this it means you want to edit this file manually, so here | ||
809 | # are some useful tips: | ||
810 | # | ||
811 | # - You can add your own menu-entries to ~/.fluxbox/usermenu | ||
812 | # | ||
813 | # - If you miss apps please let me know and I will add them for the next | ||
814 | # release. | ||
815 | # | ||
816 | # - The -r option prevents removing of empty menu entries and lines which | ||
817 | # makes things much more readable. | ||
818 | # | ||
819 | # - To prevent any other app from overwriting your menu | ||
820 | # you can change the menu name in .fluxbox/init to: | ||
821 | # session.menuFile: /home/you/.fluxbox/my-menu | ||
822 | |||
823 | EOF | ||
824 | |||
825 | echo "[begin] (${MENUTITLE})" >> ${MENUFILENAME} | ||
826 | |||
827 | append "[exec] (${DEFAULT_TERMNAME}) {${DEFAULT_TERM}}" | ||
828 | |||
829 | case "$DEFAULT_BROWSERNAME" in | ||
830 | links|w3m|lynx) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;; | ||
831 | firebird|mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_BROWSER}}" ;; | ||
832 | konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;; | ||
833 | opera) append "[exec] (opera) {env QT_XFT=true opera}" ;; | ||
834 | MozillaFirebird) append "[exec] (firebird) {MozillaFirebird}" ;; | ||
835 | *) append "[exec] ($DEFAULT_BROWSERNAME) {$DEFAULT_BROWSER}" ;; | ||
836 | esac | ||
837 | |||
838 | find_it fbrun append "[exec] (Run) {fbrun $FBRUNOPTIONS}" | ||
839 | |||
840 | |||
841 | append_submenu "${TERMINALMENU}" | ||
842 | normal_find xterm gnome-terminal Eterm konsole aterm rxvt | ||
843 | append_menu_end | ||
844 | |||
845 | |||
846 | append_submenu "${NETMENU}" | ||
847 | append_submenu "${BROWSERMENU}" | ||
848 | normal_find mozilla-firebird MozillaFirebird galeon mozilla dillo netscape | ||
849 | find_it opera append "[exec] (opera) {env QT_XFT=true opera}" | ||
850 | find_it konqueror append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" | ||
851 | find_it links append "[exec] (links) {${DEFAULT_TERM} -e links ${HOMEPAGE}}" | ||
852 | find_it w3m append "[exec] (w3m) {${DEFAULT_TERM} -e w3m ${HOMEPAGE}}" | ||
853 | find_it lynx append "[exec] (lynx) {${DEFAULT_TERM} -e lynx ${HOMEPAGE}}" | ||
854 | append_menu_end | ||
855 | |||
856 | append_submenu IM | ||
857 | normal_find gaim kopete gnomemeeting sim | ||
858 | find_it licq append "[exec] (licq) {env QT_XFT=true licq}" | ||
859 | append_menu_end | ||
860 | |||
861 | append_submenu Mail | ||
862 | normal_find sylpheed kmail evolution | ||
863 | find_it mutt append "[exec] (mutt) {${DEFAULT_TERM} -e mutt}" | ||
864 | append_menu_end | ||
865 | |||
866 | append_submenu IRC | ||
867 | normal_find xchat ksirc | ||
868 | find_it irssi append "[exec] (irssi) {${DEFAULT_TERM} -e irssi}" | ||
869 | find_it BitchX append "[exec] (BitchX) {${DEFAULT_TERM} -e BitchX -N}" || \ | ||
870 | find_it bitchx append "[exec] (BitchX) {${DEFAULT_TERM} -e bitchx -N}" | ||
871 | find_it ircii append "[exec] (ircii) {${DEFAULT_TERM} -e ircii -s}" | ||
872 | append_menu_end | ||
873 | |||
874 | append_submenu P2P | ||
875 | normal_find gtk-gnutella lopster nicotine pyslsk xmule amule | ||
876 | find_it TekNap append "[exec] (TekNap) {${DEFAULT_TERM} -e TekNap}" | ||
877 | append_menu_end | ||
878 | |||
879 | append_submenu ftp | ||
880 | normal_find gftp IglooFTP-PRO | ||
881 | find_it pftp append "[exec] (pftp) {${DEFAULT_TERM} -e pftp}" | ||
882 | find_it ftp append "[exec] (ftp) {${DEFAULT_TERM} -e ftp}" | ||
883 | find_it lftp append "[exec] (lftp) {${DEFAULT_TERM} -e lftp}" | ||
884 | find_it yafc append "[exec] (yafc) {${DEFAULT_TERM} -e yafc}" | ||
885 | append_menu_end | ||
886 | |||
887 | normal_find pan | ||
888 | |||
889 | append_menu_end | ||
890 | |||
891 | append_submenu "${EDITORMENU}" | ||
892 | normal_find gvim | ||
893 | find_it nano append "[exec] (nano) {${DEFAULT_TERM} -e nano}" | ||
894 | find_it vi append "[exec] (vi) {${DEFAULT_TERM} -e vi}" | ||
895 | find_it vim append "[exec] (vim) {${DEFAULT_TERM} -e vim}" | ||
896 | normal_find nedit gedit xedit kword kwrite kate anjuta wings xemacs emacs | ||
897 | find_it emacs append "[exec] (emacs-nw) {${DEFAULT_TERM} -e emacs -nw}" | ||
898 | find_it xemacs append "[exec] (emacs-nw) {${DEFAULT_TERM} -e xemacs -nw}" | ||
899 | append_menu_end | ||
900 | |||
901 | append_submenu "${FILEUTILSMENU}" | ||
902 | normal_find konqueror gentoo krusader linuxcmd rox | ||
903 | find_it nautilus append "[exec] (nautilus) {nautilus --no-desktop}" | ||
904 | find_it mc append "[exec] (mc) {${DEFAULT_TERM} -e mc}" | ||
905 | append_menu_end | ||
906 | |||
907 | append_submenu "${MULTIMEDIAMENU}" | ||
908 | append_submenu "${GRAPHICMENU}" | ||
909 | normal_find gimp xv gqview showimg xpaint kpaint kiconedit \ | ||
910 | ee xscreensaver-demo xlock | ||
911 | find_it xnview append "[exec] (xnview browser) {xnview -browser}" | ||
912 | find_it blender append "[exec] (blender) {blender -w}" | ||
913 | find_it gears append "[exec] (Mesa gears) {gears}" | ||
914 | find_it morph3d append "[exec] (Mesa morph) {morph3d}" | ||
915 | find_it reflect append "[exec] (Mesa reflect) {reflect}" | ||
916 | append_menu_end | ||
917 | |||
918 | append_submenu "${MUSICMENU}" | ||
919 | normal_find xmms noatun alsaplayer gqmpeg aumix xmixer gmix kmix kscd \ | ||
920 | grecord kmidi xplaycd soundtracker grip easytag audacity \ | ||
921 | zinf rhythmbox kaboodle | ||
922 | find_it cdcd append "[exec] (cdcd) {${DEFAULT_TERM} -e cdcd}" | ||
923 | find_it cplay append "[exec] (cplay) {${DEFAULT_TERM} -e cplay}" | ||
924 | find_it alsamixer append "[exec] (AlsaMixer) {${DEFAULT_TERM} -e alsamixer}" | ||
925 | append_menu_end | ||
926 | |||
927 | |||
928 | append_submenu "${VIDEOMENU}" | ||
929 | normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb realplay xawtv | ||
930 | find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" | ||
931 | append_menu_end | ||
932 | |||
933 | append_submenu "${XUTILSMENU}" | ||
934 | normal_find xfontsel xman xload xfigxbiff editres viewres xclock \ | ||
935 | xmag wmagnify gkrellm vmware | ||
936 | append_menu_end | ||
937 | append_menu_end | ||
938 | |||
939 | |||
940 | append_submenu "${OFFICEMENU}" | ||
941 | normal_find xclock xcalc kcalc | ||
942 | find_it gcalc append "[exec] (gcalc) {gcalc}" || \ | ||
943 | find_it gnome-calculator append "[exec] (gcalc) {gnome-calculator}" | ||
944 | find_it ooffice append "[exec] (Open Office) {ooffice}" | ||
945 | find_it oocalc append "[exec] (OO Calc) {oocalc}" | ||
946 | find_it oowriter append "[exec] (OO Writer) {oowriter}" | ||
947 | find_it ooimpress append "[exec] (OO Impress) {ooimpress}" | ||
948 | find_it oodraw append "[exec] (OO Draw) {oodraw}" | ||
949 | find_it oomath append "[exec] (OO Math) {oomath}" | ||
950 | find_it oopadmin append "[exec] (OO Printer Administration) {oopadmin}" | ||
951 | find_it mrproject append "[exec] (Mr.Project) {mrproject}" | ||
952 | find_it soffice append "[exec] (Star Office) {soffice}" | ||
953 | |||
954 | normal_find abiword kword wordperfect katoob acroread xpdf | ||
955 | append_menu_end | ||
956 | |||
957 | append_submenu "${GAMESMENU}" | ||
958 | normal_find bzflag gnibbles gnobots2 tuxpuck gataxx glines \ | ||
959 | gnect mahjongg gnomine gnome-stones gnometris gnotravex \ | ||
960 | gnotski iagno knights eboard xboard freecell pysol \ | ||
961 | gtali tuxracer xpenguins xsnow xeyes xpenguins smclone openmortal \ | ||
962 | quake2 quake3 skoosh same-gnome enigma xbill icebreaker | ||
963 | find_it et append "[exec] (Enemy Territory) {et}" | ||
964 | append_menu_end | ||
965 | |||
966 | # We'll only use this once | ||
967 | ETCAPPLNK=/etc/X11/applnk | ||
968 | # gnome menu | ||
969 | if [ "${GNOMEMENU}" ]; then | ||
970 | append_submenu "${GNOMEMENUTEXT}" | ||
971 | recurse_dir_menu "${GNOME_PREFIX}/share/gnome/apps" "$HOME/.gnome/apps" ${ETCAPPLNK} | ||
972 | append_menu_end | ||
973 | unset ETCAPPLNK | ||
974 | fi | ||
975 | |||
976 | # kde submenu | ||
977 | if [ -d "${KDE_PREFIX}/share/applnk/" -a "${KDEMENU}" ]; then | ||
978 | append_submenu "${KDEMENUTEXT}" | ||
979 | recurse_dir_menu "${KDE_PREFIX}/share/applnk" "$HOME/.kde/share/applnk" ${ETCAPPLNK} | ||
980 | append_menu_end | ||
981 | unset ETCAPPLNK | ||
982 | fi | ||
983 | |||
984 | #User menu | ||
985 | if [ -r "${USERMENU}" ]; then | ||
986 | cat ${USERMENU} >> ${MENUFILENAME} | ||
987 | fi | ||
988 | |||
989 | append_submenu "${FBSETTINGSMENU}" | ||
990 | append "[config] (${CONFIGUREMENU})" | ||
991 | |||
992 | append_menu "[submenu] (${SYSTEMSTYLES}) {${STYLEMENUTITLE}}" | ||
993 | append "[stylesdir] (${PREFIX}/share/fluxbox/styles)" | ||
994 | append_menu_end | ||
995 | |||
996 | append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}" | ||
997 | append "[stylesdir] (~/.fluxbox/styles)" | ||
998 | append_menu_end | ||
999 | |||
1000 | # Backgroundmenu | ||
1001 | addbackground() { | ||
1002 | picturename=`basename "$1"` | ||
1003 | append "[exec] (${picturename%.???}) {fbsetbg -a \"$1\" }" | ||
1004 | } | ||
1005 | |||
1006 | if [ "$BACKGROUNDMENUITEM" = yes ]; then | ||
1007 | IFS=: # set delimetor for find | ||
1008 | NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l` | ||
1009 | if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then | ||
1010 | append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" | ||
1011 | if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then | ||
1012 | menucounter=1 ; counter=1 | ||
1013 | append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" | ||
1014 | find $BACKGROUND_DIRS -follow -type f|sort|while read i; do | ||
1015 | counter=`expr $counter + 1` | ||
1016 | if [ $counter -eq 30 ]; then | ||
1017 | counter=1 | ||
1018 | menucounter=`expr $menucounter + 1` | ||
1019 | append_menu_end | ||
1020 | append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" | ||
1021 | fi | ||
1022 | addbackground "$i" | ||
1023 | done | ||
1024 | append_menu_end | ||
1025 | else | ||
1026 | find $BACKGROUND_DIRS -follow -type f|sort|while read i; do | ||
1027 | addbackground "$i" | ||
1028 | done | ||
1029 | fi | ||
1030 | append_menu_end | ||
1031 | else | ||
1032 | echo "Warning: You wanted a background-menu but I couldn't find any backgrounds in: | ||
1033 | $BACKGROUND_DIRS" >&2 | ||
1034 | fi | ||
1035 | fi | ||
1036 | |||
1037 | append "[workspaces] (${WORKSPACEMENU})" | ||
1038 | |||
1039 | append_submenu Tools | ||
1040 | normal_find fluxconf fluxkeys fluxmenu | ||
1041 | # if gxmessage exitst use it; else use xmessage | ||
1042 | find_it gxmessage append \ | ||
1043 | "[exec] (Windowname) {xprop WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" || \ | ||
1044 | find_it xmessage append \ | ||
1045 | "[exec] (Windowname) {xprop WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" | ||
1046 | find_it import append "[exec] (screenshot) {import screenshot.png && qiv -W 50 screenshot.png}" | ||
1047 | find_it fbrun append "[exec] (Run) {fbrun $FBRUNOPTIONS}" | ||
1048 | find_it switch append "[exec] (gtk-theme-switch) {switch}" | ||
1049 | find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" | ||
1050 | find_it fluxbox-generate_menu append "[exec] (regenerate menu) {fluxbox-generate_menu}" | ||
1051 | append_menu_end | ||
1052 | |||
1053 | append_submenu ${WINDOWMANAGERS} | ||
1054 | #hard to properly maintain since there are so many exceptions to the rule. | ||
1055 | for wm in icewm ion kde sawfish enlightenment openbox evilwm waimea xfce pekwm; do | ||
1056 | find_it start${wm} append "[restart] (${wm}) {start${wm}}" ||\ | ||
1057 | find_it ${wm} append "[restart] (${wm}) {${wm}}" | ||
1058 | done | ||
1059 | find_it startgnome append "[restart] (gnome) {startgnome}" ||\ | ||
1060 | find_it gnome-session append "[restart] (gnome) {gnome-session}" | ||
1061 | |||
1062 | find_it startwindowmaker append "[restart] (windowmaker) {startwindowmaker}" ||\ | ||
1063 | find_it wmaker append "[restart] (windowmaker) {wmaker}" | ||
1064 | append_menu_end | ||
1065 | find_it xlock append "[exec] (Lock Screen) {xlock}" | ||
1066 | append "[reconfig] (${RELOADITEM})" | ||
1067 | append "[restart] (${RESTARTITEM})" | ||
1068 | append "[exit] (${EXITITEM})" | ||
1069 | |||
1070 | append_menu_end | ||
1071 | append_menu_end | ||
1072 | |||
1073 | # this function removes empty menu items. It can not yet remove nested | ||
1074 | # empty submenus :\ | ||
1075 | |||
1076 | if [ ! "${REMOVE}" ]; then | ||
1077 | clean_up | ||
1078 | fi | ||
1079 | |||
1080 | echo 'Menu successfully generated.' | ||
1081 | echo 'Use fluxbox-generate_menu -h to read about all the latest features.' | ||