diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/fluxbox-generate_menu | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu index 20df908..4c99292 100755 --- a/util/fluxbox-generate_menu +++ b/util/fluxbox-generate_menu | |||
@@ -60,6 +60,10 @@ find_it() { | |||
60 | which $1 > /dev/null 2> /dev/null && shift && $* | 60 | which $1 > /dev/null 2> /dev/null && shift && $* |
61 | } | 61 | } |
62 | 62 | ||
63 | find_term() { | ||
64 | if find_it $1; then DEFAULT_TERM=$1; fi | ||
65 | } | ||
66 | |||
63 | append() { | 67 | append() { |
64 | echo " $*" >> ${FILENAME} | 68 | echo " $*" >> ${FILENAME} |
65 | } | 69 | } |
@@ -133,6 +137,17 @@ if [ -z "${MENUTITLE}" ]; then | |||
133 | MENUTITLE="Fluxbox" | 137 | MENUTITLE="Fluxbox" |
134 | fi | 138 | fi |
135 | 139 | ||
140 | if find_it xterm; then | ||
141 | DEFAULT_TERM=xterm | ||
142 | else | ||
143 | for term in konsole gnome-terminal Eterm wterm aterm rxvt; do | ||
144 | find_term $term | ||
145 | if [ -nz $DEFAULT_TERM ]; then | ||
146 | break | ||
147 | fi | ||
148 | done | ||
149 | fi | ||
150 | |||
136 | # menu defaults (if translation forget to set one of them) | 151 | # menu defaults (if translation forget to set one of them) |
137 | BROWSERMENU="Browsers" | 152 | BROWSERMENU="Browsers" |
138 | EDITORMENU="Editors" | 153 | EDITORMENU="Editors" |
@@ -255,7 +270,7 @@ case ${LC_ALL} in | |||
255 | STYLEMENUTITLE="スタイル選択..." | 270 | STYLEMENUTITLE="スタイル選択..." |
256 | WORKSPACEMENU="ワークスペース" | 271 | WORKSPACEMENU="ワークスペース" |
257 | ;; | 272 | ;; |
258 | fr_FR) # french | 273 | fr_FR) # french locales |
259 | BROWSERMENU="Navigateurs" | 274 | BROWSERMENU="Navigateurs" |
260 | EDITORMENU="Editeurs" | 275 | EDITORMENU="Editeurs" |
261 | NETMENU="Net" | 276 | NETMENU="Net" |
@@ -275,6 +290,26 @@ case ${LC_ALL} in | |||
275 | STYLEMENUTITLE="Choisir un style..." | 290 | STYLEMENUTITLE="Choisir un style..." |
276 | WORKSPACEMENU="Liste des bureaux" | 291 | WORKSPACEMENU="Liste des bureaux" |
277 | ;; | 292 | ;; |
293 | it_IT|it_IT@euro) # italian locales | ||
294 | BROWSERMENU="Browsers" | ||
295 | EDITORMENU="Editori" | ||
296 | NETMENU="Internet" | ||
297 | GRAPHICMENU="Grafica" | ||
298 | MUSICMENU="Musica" | ||
299 | TERMINALMENU="Terminali" | ||
300 | MISCMENU="Varie" | ||
301 | XUTILSMENU="X-utils" | ||
302 | FBSETTINGSMENU="Preferenze" | ||
303 | KDEMENUTEXT="menu KDE" | ||
304 | GNOMEMENUTEXT="menu Gnome" | ||
305 | RESTARTITEM="Riavvia" | ||
306 | EXITITEM="Esci" | ||
307 | CONFIGUREMENU="Configurazione" | ||
308 | RELOADITEM="Rileggi la configurazione" | ||
309 | STYLEMENU="Scegli uno stile..." | ||
310 | STYLEMENUTITLE="Scegli uno stile..." | ||
311 | WORKSPACEMENU="Aree di lavoro" | ||
312 | ;; | ||
278 | *) | 313 | *) |
279 | ;; | 314 | ;; |
280 | esac | 315 | esac |
@@ -283,7 +318,7 @@ esac | |||
283 | 318 | ||
284 | echo "[begin] (${MENUTITLE})" > ${FILENAME} | 319 | echo "[begin] (${MENUTITLE})" > ${FILENAME} |
285 | 320 | ||
286 | find_it xterm append "[exec] (xterm) {xterm}" | 321 | append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" |
287 | find_it nedit append "[exec] (nedit) {nedit}" | 322 | find_it nedit append "[exec] (nedit) {nedit}" |
288 | 323 | ||
289 | 324 | ||
@@ -293,9 +328,9 @@ append_submenu ${BROWSERMENU} | |||
293 | find_it galeon append "[exec] (galeon) {galeon}" | 328 | find_it galeon append "[exec] (galeon) {galeon}" |
294 | find_it mozilla append "[exec] (mozilla) {mozilla}" | 329 | find_it mozilla append "[exec] (mozilla) {mozilla}" |
295 | find_it konqueror append "[exec] (konqueror) {konqueror}" | 330 | find_it konqueror append "[exec] (konqueror) {konqueror}" |
296 | find_it links append "[exec] (links) {xterm -title links -e links fluxbox.sf.net}" | 331 | find_it links append "[exec] (links) {${DEFAULT_TERM} -title links -e links fluxbox.sf.net}" |
297 | find_it w3m append "[exec] (w3m) {xterm -title w3m -e w3m}" | 332 | find_it w3m append "[exec] (w3m) {${DEFAULT_TERM} -title w3m -e w3m}" |
298 | find_it lynx append "[exec] (lynx) {xterm -title lynx -e lynx}" | 333 | find_it lynx append "[exec] (lynx) {${DEFAULT_TERM} -title lynx -e lynx}" |
299 | find_it dillo append "[exec] (dillo) {dillo}" | 334 | find_it dillo append "[exec] (dillo) {dillo}" |
300 | append_menu_end | 335 | append_menu_end |
301 | 336 | ||
@@ -319,19 +354,20 @@ append_submenu ${NETMENU} | |||
319 | find_it kmail append "[exec] (kmail) {kmail}" | 354 | find_it kmail append "[exec] (kmail) {kmail}" |
320 | find_it gnomemeeting append "[exec] (gnomemeeting) {gnomemeeting}" | 355 | find_it gnomemeeting append "[exec] (gnomemeeting) {gnomemeeting}" |
321 | find_it evolution append "[exec] (evolution) {evolution}" | 356 | find_it evolution append "[exec] (evolution) {evolution}" |
322 | find_it mutt append "[exec] (mutt) {xterm -title mutt -e mutt}" | 357 | find_it mutt append "[exec] (mutt) {${DEFAULT_TERM} -title mutt -e mutt}" |
323 | 358 | ||
324 | find_it gftp append "[exec] (gftp) {gftp}" | 359 | find_it gftp append "[exec] (gftp) {gftp}" |
325 | find_it pan append "[exec] (pan) {pan}" | 360 | find_it pan append "[exec] (pan) {pan}" |
326 | find_it xchat append "[exec] (xchat) {xchat}" | 361 | find_it xchat append "[exec] (xchat) {xchat}" |
327 | find_it irssi append "[exec] (irssi) {xterm -title irssi -e irssi}" | 362 | find_it irssi append "[exec] (irssi) {${DEFAULT_TERM} -title irssi -e irssi}" |
328 | find_it BitchX append "[exec] (BitchX) {xterm -title BitchX -e BitchX -N}" | 363 | find_it BitchX append "[exec] (BitchX) {${DEFAULT_TERM} -title BitchX -e BitchX -N}" |
329 | find_it bitchx append "[exec] (BitchX) {xterm -title BitchX -e bitchx -N}" | 364 | find_it bitchx append "[exec] (BitchX) {${DEFAULT_TERM} -title BitchX -e bitchx -N}" |
330 | find_it ircii append "[exec] (ircii) {xterm -title ircii -e ircii -s}" | 365 | find_it ircii append "[exec] (ircii) {${DEFAULT_TERM} -title ircii -e ircii -s}" |
331 | append_menu_end | 366 | append_menu_end |
332 | 367 | ||
333 | append_submenu ${GRAPHICMENU} | 368 | append_submenu ${GRAPHICMENU} |
334 | find_it gimp append "[exec] (gimp) {gimp}" | 369 | find_it gimp append "[exec] (gimp) {gimp}" |
370 | find_it gimp-1.3 append "[exec] (gimp 1.3) {gimp-1.3}" | ||
335 | find_it xv append "[exec] (xv) {xv}" | 371 | find_it xv append "[exec] (xv) {xv}" |
336 | find_it gqview append "[exec] (gqview) {gqview}" | 372 | find_it gqview append "[exec] (gqview) {gqview}" |
337 | find_it xpaint append "[exec] (xpaint) {xpaint}" | 373 | find_it xpaint append "[exec] (xpaint) {xpaint}" |
@@ -350,12 +386,12 @@ append_submenu ${MUSICMENU} | |||
350 | find_it kmidi append "[exec] (kmidi) {kmidi}" | 386 | find_it kmidi append "[exec] (kmidi) {kmidi}" |
351 | find_it xplaycd append "[exec] (xplaycd) {xplaycd}" | 387 | find_it xplaycd append "[exec] (xplaycd) {xplaycd}" |
352 | find_it soundtracker append "[exec] (soundtracker) {soundtracker}" | 388 | find_it soundtracker append "[exec] (soundtracker) {soundtracker}" |
353 | find_it cplay append "[exec] (cplay) {xterm -title cplay -e /usr/local/bin/cplay}" | 389 | find_it cplay append "[exec] (cplay) {${DEFAULT_TERM} -title cplay -e /usr/local/bin/cplay}" |
354 | find_it grip append "[exec] (grip) {grip}" | 390 | find_it grip append "[exec] (grip) {grip}" |
355 | append_menu_end | 391 | append_menu_end |
356 | 392 | ||
357 | append_submenu ${TERMINALMENU} | 393 | append_submenu ${TERMINALMENU} |
358 | append "[exec] (xterm) {xterm}" | 394 | find_it xterm append "[exec] (xterm) {xterm}" |
359 | find_it gnome-terminal append "[exec] (gnome-terminal) {gnome-terminal}" | 395 | find_it gnome-terminal append "[exec] (gnome-terminal) {gnome-terminal}" |
360 | find_it Eterm append "[exec] (Eterm) {Eterm}" | 396 | find_it Eterm append "[exec] (Eterm) {Eterm}" |
361 | find_it konsole append "[exec] (konsole) {konsole}" | 397 | find_it konsole append "[exec] (konsole) {konsole}" |
@@ -376,7 +412,7 @@ append_submenu ${MISCMENU} | |||
376 | find_it kpackage append "[exec] (kpackage) {kpackage}" | 412 | find_it kpackage append "[exec] (kpackage) {kpackage}" |
377 | find_it xgdb append "[exec] (xgdb) {xgdb}" | 413 | find_it xgdb append "[exec] (xgdb) {xgdb}" |
378 | find_it ddd append "[exec] (ddd) {ddd}" | 414 | find_it ddd append "[exec] (ddd) {ddd}" |
379 | find_it xterm append "[exec] (tail access_log) {xterm -title access_log -e tail -f /var/log/access_log}" | 415 | find_it ${DEFAULT_TERM} append "[exec] (tail access_log) {${DEFAULT_TERM} -title access_log -e tail -f /var/log/access_log}" |
380 | append_menu_end | 416 | append_menu_end |
381 | 417 | ||
382 | 418 | ||
@@ -434,8 +470,8 @@ append_submenu ${FBSETTINGSMENU} | |||
434 | append "[workspaces] (${WORKSPACEMENU})" | 470 | append "[workspaces] (${WORKSPACEMENU})" |
435 | 471 | ||
436 | append_menu "[submenu] (${STYLEMENU}) {${STYLEMENUTITLE}}" | 472 | append_menu "[submenu] (${STYLEMENU}) {${STYLEMENUTITLE}}" |
437 | append "[stylesdir] (${PKGDATADIR}/fluxbox/styles)" | ||
438 | append "[stylesdir] (~/.fluxbox/styles)" | 473 | append "[stylesdir] (~/.fluxbox/styles)" |
474 | append "[stylesdir] (${PKGDATADIR}/fluxbox/styles)" | ||
439 | append_menu_end | 475 | append_menu_end |
440 | 476 | ||
441 | append "[config] (${CONFIGUREMENU})" | 477 | append "[config] (${CONFIGUREMENU})" |