3
# generate_menu for Fluxbox
5
# Copyright (c) 2005 Dung N. Lam <dnlam@users.sourceforge.net>
6
# Copyright (c) 2002-2004 Han Boetes <han@mijncomputer.nl>
8
# Permission is hereby granted, free of charge, to any person obtaining a
9
# copy of this software and associated documentation files (the "Software"),
10
# to deal in the Software without restriction, including without limitation
11
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
# and/or sell copies of the Software, and to permit persons to whom the
13
# Software is furnished to do so, subject to the following conditions:
15
# The above copyright notice and this permission notice shall be included in
16
# all copies or substantial portions of the Software.
18
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24
# DEALINGS IN THE SOFTWARE.
26
# $Id: fluxbox-generate_menu.in 4091 2005-08-17 04:24:55Z mathias $
30
# To guarantee this script works on all platforms that support fluxbox
31
# please keep the following restrictions in mind:
33
# - don't use [ "a" == "a" ]; use [ "a" = "a" ] (found with help from FreeBSD user relaxed)
34
# - don't use if ! command;, use command; if [ $? -ne 0 ];
35
# - don't use [ -e file ] use [ -r file ]
36
# - don't use $(), use ``
37
# - don't use ~, use ${HOME}
38
# - don't use id -u or $UID, use whoami
39
# - getopts won't work on all platforms, but the config-file can
40
# compensate for that.
41
# - OpenBSD and Solaris grep do not have the -m option
42
# - various software like grep/sed/perl may be not present or not
43
# the version you have. for example grep '\W' only works on gnu-grep.
44
# Keep this in mind, use bare basic defaults.
45
# - Do _NOT_ suggest to use #!/bin/bash. Not everybody uses bash.
46
# Non portable features like getopts in this script can be achieved in
51
[ "$WHOAMI" = root ] && PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
53
# Check for Imlib2-support
54
if fluxbox -info 2> /dev/null | grep -q "^IMLIB"; then
57
# better assume to assume "no"
64
Usage: fluxbox-generate_menu [-kgrBh] [-t terminal] [-w url] [-b browser]
65
[-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path]
66
[-d /path ] [-ds] [-i /path] [-is]
78
-B enable backgrounds menu
79
-r Don't remove empty menu-entries; for templates
81
-d other path(s) to recursively search for *.desktop files
82
-ds wider search for *.desktop files (takes more time)
83
-i other path(s) to search for icons
84
e.g., "/usr/kde/3.3/share/icons/crystalsvg/16x16/*"
85
-is wider search for icons (worth the extra time)
89
-w Homepage for console-browsers. Default is fluxbox.org
91
-m Menu-title; default is "Fluxbox"
92
-o Outputfile; default is ~/.fluxbox/menu
93
-u user sub-menu; default is ~/.fluxbox/usermenu
96
-a Display the authors of this script
100
-p prefix; default is @PREFIX@
101
-n Gnome-prefix; /opt, /usr, /usr/X11R6 and /usr/local autodetected
102
-q KDE-prefix; idem dito
106
~/.fluxbox/usermenu your own submenu which will be included in the menu
107
~/.fluxbox/menuconfig rc file for fluxbox-generate_menu
115
fluxbox-generate_menu was brought to you by:
117
Henrik Kinnunen: Project leader.
118
Han Boetes: Packaging, debugging and scripts.
119
Simon Bowden: Cleanups and compatibility for sun.
120
Jeramy B. Smith: Packaging assistance, gnome and kde menu system.
121
Filippo Pappalardo: Italian locales and -t option.
122
$WHOAMI: Innocent bystander.
127
# some which's have a reliable return code, some don't
128
# Lets figure out which which we have.
129
if which this_program_does_not_exist-no_really-aA1zZ9 2> /dev/null 1> /dev/null; then
130
# can't rely on return value
132
file=`which $1 2> /dev/null`
133
if [ -x "$file" ]; then
134
if [ $# -gt 1 ]; then
145
file=`which $1 2> /dev/null`
146
if [ -x "$file" ]; then
154
# can rely on return value
156
which $1 > /dev/null 2>&1 && shift && $*
160
which $1 > /dev/null 2>&1
164
#echo "replaceWithinString: $1, $2, $3" >&2
165
#echo ${1//$2/$3} # causes error in BSD even though not used
166
replaceWithinString(){
167
echo $1 | awk "{ gsub(/$2/, \"$3\"); print }"
171
if [ ! -f "$1" ] ; then
172
echo "Icon file not found: $1" >&2
176
if [ "$1" = "$2" ]; then
177
# $dnlamVERBOSE "Files are in the same location: $1 = $2" >&2
178
# not really an error; just nothing to do.
185
# make sure it is an icon by checking if it has an extension
186
if [ "$BASENAME" = "${BASENAME%%.*}" ]; then
187
# $dnlamVERBOSE "File $1 does not have a filename extention." >&2
191
# don't have to convert xpm files
199
# may not have to convert png if imlib is enabled
200
if [ "$PNG_ICONS" = "yes" ]; then
209
# convert all others icons and save it as xpm format under directory $2
210
entry_icon="$2/${BASENAME%.*}.xpm"
211
if [ -f "${entry_icon}" ]; then
212
: echo "File exists. To overwrite, type: convert \"$1\" \"$entry_icon\"" >&2
214
if which convert &> /dev/null; then
215
convert "$1" "$entry_icon"
216
# echo convert "$1" , "$entry_icon" >> $ICONMAPPING
218
echo "Please install ImageMagick's convert utility" >&2
227
progname="${execname%% *}"
228
# separate program name and its parameters
229
if [ "$progname" = "$execname" ]; then
231
# remove path from only program name
232
execname="${progname##*/}"
235
params="${execname#* }"
236
# remove path from only program name
237
execname="${progname##*/} $params"
243
for ICONPATH in "$@"; do
244
## $dnlamVERBOSE ": $ICONPATH" >> $ICONMAPPING
245
[ -d "$ICONPATH" ] || continue
247
# # $dnlamVERBOSE ":: $ICONPATH/$temp_icon" >> $ICONMAPPING
248
if [ -f "$ICONPATH/$temp_icon" ]; then
249
echo "$ICONPATH/$temp_icon"
251
else # try different extensions;
253
iconNOext="${temp_icon%%.*}"
254
[ -d "$ICONPATH" ] && for ICONEXT in .xpm .png .gif ; do
255
## echo "::: $ICONPATH/$iconNOext$ICONEXT" >> $ICONMAPPING
256
if [ -f "$ICONPATH/$iconNOext$ICONEXT" ]; then
257
echo "$ICONPATH/$iconNOext$ICONEXT"
268
# remove '(' from '(fluxbox ...) | ...'
269
local execname temp_icon
270
execname=`replaceWithinString "$1" "\("`
272
# $dnlamVERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING
274
# check in $ICONMAPPING before searching directories
275
entry_icon=`grep "^\"${execname}\"" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
276
if [ -n "$entry_icon" ]; then
277
entry_icon=`replaceWithinString "$entry_icon" "<"`
278
entry_icon=`replaceWithinString "$entry_icon" ">"`
282
# echo "$ICONMAPPING for $execname: $entry_icon"
284
# the following paths include a user-defined variable, listing paths to search for icons
285
# echo -n "for $temp_icon"
286
eval doSearchLoop $USER_ICONPATHS \
288
"/usr/share/${execname%% *}" \
295
# remove '&' and everything after it
296
entry_exec="${1%%&*}"
298
# $dnlamVERBOSE echo "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2
300
# get the basename and parameters of entry_exec -- no path
301
entry_exec=`removePath "${entry_exec}"`
302
[ -z "$entry_exec" ] && { echo "Exec is NULL $1 with icon $2"; return 1; }
304
# search for specified icon if it does not exists
305
if [ -n "$entry_icon" ] && [ ! "$entry_exec" = "$entry_icon" ] && [ ! -f "$entry_icon" ]; then
306
# to search for icon in other paths,
309
temp_icon="${entry_icon##*/}"
311
temp_icon="${temp_icon#* }"
312
# clear entry_icon until temp_icon is found
315
if [ ! -f "$entry_icon" ]; then
316
entry_icon=`doSearch "$entry_exec" "$temp_icon"`
322
execname="${entry_exec%% *}"
324
# echo "search for icon named $execname.{xpm,png,gif}"
325
if [ ! -f "$entry_icon" ]; then
326
entry_icon=`doSearch "$entry_exec" "$execname"`
329
# ----------- done with search ------------
330
# $dnlamVERBOSE echo "::: $entry_icon" >&2
332
# convert icon file, if needed
333
if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then
334
entry_icon=`convertIcon "$entry_icon" "$HOME/.fluxbox/icons"`
335
# $dnlamVERBOSE echo ":::: $entry_icon" >&2
338
# remove path to icon; just get basename
340
icon_base="${entry_icon##*/}"
342
icon_base="${icon_base%%.*}"
343
# echo "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>"
344
if [ -f "$entry_icon" ]; then
345
# if icon exists and entry does not already exists, add it
346
if ! grep -q -m 1 "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then
347
echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING
349
: echo "# mapping already exists for ${entry_exec}" >> $ICONMAPPING
352
echo "# No icon file found for $entry_exec" >> $ICONMAPPING
356
toSingleLine(){ echo "$@"; }
358
# $dnlamVERBOSE "# creating `date`" >> $ICONMAPPING
359
# $dnlamVERBOSE "# using desktop files in $@" >> $ICONMAPPING
360
# $dnlamVERBOSE "# searching for icons in `eval toSingleLine $OTHER_ICONPATHS`" >> $ICONMAPPING
361
# need to determine when to use .fluxbox/icons/$execname.xpm over those listed in iconmapping
362
# $dnlamVERBOSE echo "createIconMapping: $@"
364
if [ -d "$DIR" ]; then
365
# $dnlamVERBOSE echo "# ------- Looking in $DIR" >&2
367
find "$DIR" -type f -name "*.desktop" | while read DESKTOP_FILE; do
368
# echo $DESKTOP_FILE;
369
#entry_name=`grep '^[ ]*Name=' $DESKTOP_FILE | head -n 1`
370
#entry_name=${entry_name##*=}
371
entry_exec=`grep '^[ ]*Exec=' "$DESKTOP_FILE" | head -n 1`
372
entry_exec=${entry_exec##*=}
373
entry_exec=`replaceWithinString "$entry_exec" "\""`
374
if [ -z "$entry_exec" ]; then
375
entry_exec=${DESKTOP_FILE%%.desktop*}
378
entry_icon=`grep '^[ ]*Icon=' "$DESKTOP_FILE" | head -n 1`
379
entry_icon=${entry_icon##*=}
381
# $dnlamVERBOSE echo "--- $entry_exec $entry_icon" >&2
382
case "$entry_icon" in
383
"" | mime_empty | no_icon )
384
: echo "no icon for $entry_exec"
387
searchForIcon "$entry_exec" "$entry_icon"
393
# $dnlamVERBOSE "# done `date`" >> $ICONMAPPING
397
if [ ! -f "$ICONMAPPING" ]; then
398
echo "!!! Icon map file not found: $ICONMAPPING" >&2
405
[ -n "$1" ] && echo "!! Ignoring extra paramters: $*" >&2
407
[ -z "$execname" ] && { echo "execname is NULL; cannot lookup"; return 1; }
408
execname=`removePath "$execname"`
410
#echo "grepping ${execname}"
411
iconString=`grep "^\"${execname}\"" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
412
# $dnlamVERBOSE "lookupIcon $execname, $iconString" >&2
414
if [ -z "$iconString" ] ; then
415
iconString=`grep "^\"${execname%% *}" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
418
if [ -z "$iconString" ] && [ -z "$PARSING_DESKTOP" ] ; then
419
## $dnlamVERBOSE "lookupIcon: Searching ... should only be needed for icons not gotten from *.desktop (manual-created ones): $execname" >&2
420
searchForIcon "$execname" "$execname"
421
[ -n "$entry_icon" ] && iconString="<$entry_icon>"
424
# [ -n "$iconString" ] && echo " Found icon for $execname: $iconString" >&2
429
if [ -z "${INSTALL}" ]; then
430
# $dnlamVERBOSE echo "append: $*" >&2
432
iconString="`echo $* | grep -o '<.*>'`"
433
# echo "iconString=$iconString" >&2
434
if [ -z "$iconString" ] && [ -z "$NO_ICON" ]; then
435
echo -n " $* " >> ${MENUFILENAME}
436
# get the program name between '{}' from parameters
439
execname=${execname#*\{}
440
execname=${execname%%\}*}
441
# $dnlamVERBOSE echo "execname=$execname" >&2
442
# if execname hasn't changed from original $*, then no '{...}' was given
443
if [ ! "$execname" = "$*" ]; then
447
execname=`replaceWithinString "$execname" "\""`
448
# remove "$DEFAULT_TERM -e "
449
# needed in case calling another program (e.g., vi) via "xterm -e"
450
execname=${execname##*$DEFAULT_TERM -e }
453
# lookup execname in icon map file
454
iconString=`lookupIcon "$execname"`
455
#[ -n "$iconString" ] || echo "No icon found for $execname"
457
echo "${iconString}" >> ${MENUFILENAME}
459
echo " $*" >> ${MENUFILENAME}
462
echo " $*" >> ${MENUFILENAME}
467
echo "$*" >> ${MENUFILENAME}
471
[ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates
472
append_menu "[submenu] ($1)"
477
[ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates
483
entry_name=`grep '^[ ]*Name=' "$1" | head -n 1 | cut -d = -f 2`
484
entry_exec=`grep '^[ ]*Exec=' "$1" | head -n 1 | cut -d = -f 2`
485
if [ -n "$entry_name" -a -n "$entry_exec" ]; then
486
append "[exec] ($entry_name) {$entry_exec}"
492
for b in "$*"/*.desktop; do
497
menu_entry_dircheck() {
504
# recursively build a menu from the listed directories
505
# the dirs are merged
506
recurse_dir_menu () {
507
ls "$@"/ 2>/dev/null | sort | uniq | while read name; do
509
if [ -n "$name" -a -d "$dir/$name" ]; then
511
append_submenu "${name}"
512
# unfortunately, this is messy since we can't easily expand
513
# them all. Only allow for 3 atm. Add more if needed
514
recurse_dir_menu ${1:+"$1/$name"} ${2:+"$2/$name"} ${3:+"$3/$name"}
516
break; # found one, it'll pick up all the rest
518
# ignore it if it is a file, since menu_entry_dir picks those up
522
# Make entries for current dir after all submenus
524
menu_entry_dircheck "${dir}"
531
find_it $1 append "[exec] ($1) {$1}"
538
find_it $1 append "[exec] ($1) {${DEFAULT_TERM} -e $1}"
544
[ -f "$ICONMAPPING" ] && rm -f "$ICONMAPPING"
546
# Some magic to clean up empty menus
547
rm -f ${MENUFILENAME}.tmp
548
touch ${MENUFILENAME}.tmp
549
counter=10 # prevent looping in odd circumstances
550
until [ $counter -lt 1 ] || \
551
cmp ${MENUFILENAME} ${MENUFILENAME}.tmp 2>&1 > /dev/null; do
552
[ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME}
553
counter=`expr $counter - 1`
554
grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{
557
/^\[submenu].*\n\[end]/d
558
}"|sed -e "/^\[submenu].*/{
560
/^\[submenu].*\n\[end]/d
561
}" > ${MENUFILENAME}.tmp
563
rm -f ${MENUFILENAME}.tmp
566
# menu defaults (if translation forget to set one of them)
568
BACKGROUNDMENU='Backgrounds'
569
BACKGROUNDMENUTITLE='Set the Background'
570
BROWSERMENU='Browsers'
571
CONFIGUREMENU='Configure'
573
EDUCATIONMENU='Education'
575
FBSETTINGSMENU='fluxbox menu'
576
FILEUTILSMENU='File utils'
577
FLUXBOXCOMMAND='Fluxbox Command'
579
GNOMEMENUTEXT='Gnome-menus'
580
GRAPHICMENU='Graphics'
581
KDEMENUTEXT='KDE-menus'
582
LOCKSCREEN='Lock screen'
584
MULTIMEDIAMENU='Multimedia'
589
RANDOMBACKGROUND='Random Background'
590
REGENERATEMENU='Regen Menu'
591
RELOADITEM='Reload config'
592
RESTARTITEM='Restart'
594
SCREENSHOT='Screenshot'
595
STYLEMENUTITLE='Choose a style...'
596
SYSTEMSTYLES='System Styles'
597
TERMINALMENU='Terminals'
599
USERSTYLES='User Styles'
601
WINDOWMANAGERS='Window Managers'
602
WINDOWNAME='Window name'
603
WORKSPACEMENU='Workspace List'
608
ru_RU*) #Russian locales
610
# Ah my Russian hero. Please help me update the translation
611
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
612
# $ $EDITOR fluxbox-generate-menu.in
613
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
614
# email fbgm.diff to han@mijncomputer.nl
616
BACKGROUNDMENU='����'
617
BACKGROUNDMENUTITLE='���������� ����'
618
BROWSERMENU='��������'
619
CONFIGUREMENU='���������'
620
EDITORMENU='���������'
622
FBSETTINGSMENU='FB-���������'
623
FILEUTILSMENU='�������� �������'
624
FLUXBOXCOMMAND='��������� �������'
626
GNOMEMENUTEXT='Gnome-����'
627
GRAPHICMENU='�������'
628
KDEMENUTEXT='KDE-����'
629
LOCKSCREEN='������������� �����'
633
OFFICEMENU='������� ����������'
634
RANDOMBACKGROUND='��������� ����'
635
REGENERATEMENU='������� ���� ������'
636
RELOADITEM='�������������'
637
RESTARTITEM='�������������'
638
RUNCOMMAND='���������'
639
SCREENSHOT='������ ������'
640
STYLEMENUTITLE='�������� �����'
641
SYSTEMSTYLES='��������� �����'
642
TERMINALMENU='���������'
644
USERSTYLES='���������������� �����'
645
WINDOWMANAGERS='��������� ����'
646
WINDOWNAME='��� ����'
647
WORKSPACEMENU='������� ������������'
648
XUTILSMENU='X-�������'
651
cs_CZ.ISO*) # Czech locales (ISO-8859-2 encodings)
652
ABOUTITEM='O programu...'
653
BACKGROUNDMENU='Pozad�'
654
BACKGROUNDMENUTITLE='Nastaven� pozad�'
655
BROWSERMENU='Prohl��e�e'
656
CONFIGUREMENU='Konfigurace'
659
FBSETTINGSMENU='Fluxbox Menu'
660
FILEUTILSMENU='Souborov� utility'
661
FLUXBOXCOMMAND='P��kaz Fluxboxu'
663
GNOMEMENUTEXT='Gnome-menu'
664
GRAPHICMENU='Grafika'
665
KDEMENUTEXT='KDE-menu'
666
LOCKSCREEN='Zamknout obrazovku'
668
MULTIMEDIAMENU='Multim�dia'
672
OFFICEMENU='Kancel��'
673
RANDOMBACKGROUND='N�hodn� pozad�'
674
REGENERATEMENU='Obnoven� menu'
675
RELOADITEM='Obnoven� konfigurace'
676
RESTARTITEM='Restart'
677
RUNCOMMAND='Spustit program...'
678
SCREENSHOT='Screenshot'
679
STYLEMENUTITLE='Volba stylu...'
680
SYSTEMSTYLES='Syst�mov� styly'
681
TERMINALMENU='Termin�ly'
683
USERSTYLES='U�ivatelsk� styly'
685
WINDOWMANAGERS='Okenn� mana�ery'
686
WINDOWNAME='Jm�no okna'
687
WORKSPACEMENU='Seznam ploch'
688
XUTILSMENU='X-utility'
691
de_DE*) # german locales
692
BACKGROUNDMENU='Hintergrundbilder'
693
BACKGROUNDMENUTITLE='Hintergrundbild setzen'
694
BROWSERMENU='Internet-Browser'
695
CONFIGUREMENU='Einstellungen'
696
EDITORMENU='Editoren'
698
FBSETTINGSMENU='Fluxbox-Einstellungen'
699
FILEUTILSMENU='Datei-Utilities'
700
FLUXBOXCOMMAND='Fluxbox Befehl'
702
GNOMEMENUTEXT='Gnome-Menues'
704
KDEMENUTEXT='Kde-Menues'
705
LOCKSCREEN='Bildschirmsperre'
709
OFFICEMENU='Bueroprogramme'
710
RANDOMBACKGROUND='Zufaelliger Hintergrund'
711
REGENERATEMENU='Menu-Regeneration'
712
RELOADITEM='Konfiguration neu laden'
713
RESTARTITEM='Neustarten'
714
RUNCOMMAND='Ausf�hren'
715
SCREENSHOT='Bildschirmfoto'
716
STYLEMENUTITLE='Einen Stil auswaehlen...'
717
SYSTEMSTYLES='Systemweite Stile'
718
TERMINALMENU='Terminals'
720
USERSTYLES='Eigene Stile'
721
WINDOWMANAGERS='Window Manager'
722
WINDOWNAME='Window Name'
723
WORKSPACEMENU='Arbeitsflaechenliste'
724
XUTILSMENU='X-Anwendungen'
726
sv_SE*) #Swedish locales
727
# Ah my Swedish hero. Please help me update the translation
728
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
729
# $ $EDITOR fluxbox-generate-menu.in
730
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
731
# email fbgm.diff to han@mijncomputer.nl
733
BACKGROUNDMENU='Bakgrunder'
734
BACKGROUNDMENUTITLE='S�tt bakgrund'
735
BROWSERMENU='Webbl�sare'
736
CONFIGUREMENU='Konfiguration'
737
EDITORMENU='Editorer'
739
FBSETTINGSMENU='FB-inst�llningar'
740
FILEUTILSMENU='Filverktyg'
741
FLUXBOXCOMMAND='Fluxbox kommando'
743
GNOMEMENUTEXT='Gnome-menyer'
745
KDEMENUTEXT='KDE-menyer'
746
LOCKSCREEN='L�s sk�rm'
748
MULTIMEDIAMENU='Multimedia'
752
RANDOMBACKGROUND='Slumpm�ssig bakgrund'
753
REGENERATEMENU='Generera meny'
754
RELOADITEM='Ladda om konfig'
755
RESTARTITEM='Starta om'
757
SCREENSHOT='Sk�rmdump'
758
STYLEMENUTITLE='V�lj en stil'
759
SYSTEMSTYLES='Stiler'
760
TERMINALMENU='Terminaler'
764
WINDOWMANAGERS='F�nsterhanterare'
765
WINDOWNAME='F�nsternamn'
766
WORKSPACEMENU='Arbetsytor'
767
XUTILSMENU='X-program'
769
nl_*) #Nederlandse locales
770
BACKGROUNDMENU='Achtergrond'
771
BACKGROUNDMENUTITLE='Kies een achtergrond'
772
BROWSERMENU='Browsers'
773
CONFIGUREMENU='Instellingen'
776
FBSETTINGSMENU='FB-Instellingen'
777
FILEUTILSMENU='Verkenners'
778
FLUXBOXCOMMAND='Fluxbox Commando'
779
GAMESMENU='Spelletjes'
780
GNOMEMENUTEXT='Gnome-menu'
781
GRAPHICMENU='Grafisch'
782
KDEMENUTEXT='KDE-menu'
783
LOCKSCREEN='Scherm op slot'
784
MISCMENU='Onregelmatig'
788
RANDOMBACKGROUND='Willekeurige Achtergrond'
789
REGENERATEMENU='Nieuw Menu'
790
RELOADITEM='Vernieuw instellingen'
791
RESTARTITEM='Herstart'
792
RUNCOMMAND='Voer uit'
793
SCREENSHOT='Schermafdruk'
794
STYLEMENUTITLE='Kies een stijl'
795
SYSTEMSTYLES='Systeem Stijlen'
796
TERMINALMENU='Terminals'
798
USERSTYLES='Gebruikers Stijlen'
799
WINDOWMANAGERS='Venster Managers'
800
WINDOWNAME='Venster Naam'
801
WORKSPACEMENU='Werkveld menu'
802
XUTILSMENU='X-Gereedschap'
804
fi_FI*) #Finnish locales
805
BACKGROUNDMENU='Taustakuvat'
806
BACKGROUNDMENUTITLE='M��rit� taustakuva'
807
BROWSERMENU='Selaimet'
808
CONFIGUREMENU='Asetukset'
809
EDITORMENU='Editorit'
811
FBSETTINGSMENU='Fluxboxin s��d�t'
812
FILEUTILSMENU='Tiedostoty�kalut'
813
FLUXBOXCOMMAND='Komentorivi'
815
GNOMEMENUTEXT='Gnomen valikot'
816
GRAPHICMENU='Grafiikka'
817
KDEMENUTEXT='KDE:n valikot'
818
LOCKSCREEN='Lukitse ty�p�yt�'
819
MISCMENU='Sekalaista'
822
OFFICEMENU='Toimistoty�kalut'
823
RANDOMBACKGROUND='Satunnainen taustakuva'
824
REGENERATEMENU='P�ivit� valikko'
826
RESTARTITEM='K�ynnist� uudelleen'
828
SCREENSHOT='Kuvakaappaus'
829
STYLEMENUTITLE='Valitse tyyli'
830
SYSTEMSTYLES='J�rjestelm�n tyylit'
831
TERMINALMENU='Terminaalit'
833
USERSTYLES='K�ytt�j�n tyylit'
834
WINDOWMANAGERS='Ikkunanhallintaohjelmat'
835
WINDOWNAME='Ikkunan nimi'
836
WORKSPACEMENU='Ty�alueet'
837
XUTILSMENU='X-Ohjelmat'
839
ja_JP*) #Japanese locales
840
# Ah my Japanese hero. Please help me update the translation
841
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
842
# $ $EDITOR fluxbox-generate-menu.in
843
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
844
# email fbgm.diff to han@mijncomputer.nl
847
BACKGROUNDMENUTITLE='�طʤ�����'
852
FBSETTINGSMENU='Fluxbox������'
853
FILEUTILSMENU='�ե��������'
854
FLUXBOXCOMMAND='Fluxbox���ޥ��'
856
GNOMEMENUTEXT='Gnome��˥塼'
858
KDEMENUTEXT='KDE��˥塼'
859
LOCKSCREEN='���������å�'
863
OFFICEMENU='���ե���(Office)'
864
RANDOMBACKGROUND='�ط�(������)'
865
REGENERATEMENU='��˥塼�ƹ���'
866
RELOADITEM='���ɤ߹���'
868
RUNCOMMAND='���ޥ�ɤμ¹�'
869
SCREENSHOT='�������å�'
870
STYLEMENUTITLE='������������...'
871
SYSTEMSTYLES='��������'
872
TERMINALMENU='�����ߥʥ�'
874
USERSTYLES='��������'
875
WINDOWMANAGERS='������ɥ��ޥ͡�����'
876
WINDOWNAME='������ɥ�̾'
877
WORKSPACEMENU='������ڡ���'
878
XUTILSMENU='X�桼�ƥ���ƥ�'
880
fr_FR*) # french locales
881
# Ah my french hero. Please help me update the translation
882
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
883
# $ $EDITOR fluxbox-generate-menu.in
884
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
885
# email fbgm.diff to han@mijncomputer.nl
887
BACKGROUNDMENU="Fond d'�cran"
888
BACKGROUNDMENUTITLE="Changer le fond d'�cran"
889
BROWSERMENU='Navigateurs'
890
CONFIGUREMENU='Configurer'
891
EDITORMENU='Editeurs'
893
FBSETTINGSMENU='Configurer Fluxbox'
894
FILEUTILSMENU='Outils fichiers'
895
FLUXBOXCOMMAND='Commande Fluxbox'
897
GNOMEMENUTEXT='Menus Gnome'
898
GRAPHICMENU='Graphisme'
899
KDEMENUTEXT='Menus KDE'
900
LOCKSCREEN="Verouiller l'�cran"
904
OFFICEMENU='Bureautique'
905
RANDOMBACKGROUND="Fond d'�cran al�atoire"
906
REGENERATEMENU='R�g�n�rer le menu'
907
RELOADITEM='Recharger la configuration'
908
RESTARTITEM='Red�marrer Fluxbox'
910
SCREENSHOT="Capture d'�cran"
911
STYLEMENUTITLE='Choisir un style...'
912
SYSTEMSTYLES='Styles Systeme'
913
TERMINALMENU='Terminaux'
915
USERSTYLES='Styles Utilisateur'
916
WINDOWMANAGERS='Gestionnaires de fen�tres'
917
WINDOWNAME='Nom de la fenetre'
918
WORKSPACEMENU='Liste des bureaux'
919
XUTILSMENU='Outils X'
921
it_IT*) # italian locales
922
BACKGROUNDMENU='Sfondi'
923
BACKGROUNDMENUTITLE='Imposta lo sfondo'
924
BROWSERMENU='Browsers'
925
CONFIGUREMENU='Configurazione'
928
FBSETTINGSMENU='Preferenze'
929
FILEUTILSMENU='Utilit�'
930
FLUXBOXCOMMAND='Comando Fluxbox'
932
GNOMEMENUTEXT='Gnome'
933
GRAPHICMENU='Grafica'
935
LOCKSCREEN='Blocca lo schermo'
940
RANDOMBACKGROUND='Sfondo casuale'
941
REGENERATEMENU='Rigenera il menu'
942
RELOADITEM='Rileggi la configurazione'
943
RESTARTITEM='Riavvia'
945
SCREENSHOT='Schermata'
946
STYLEMENUTITLE='Scegli uno stile'
948
TERMINALMENU='Terminali'
951
WINDOWMANAGERS='Gestori finestre'
952
WINDOWNAME='Nome della finestra'
953
WORKSPACEMENU='Aree di lavoro'
954
XUTILSMENU='Utilit� X'
956
ro_RO*) # Romanian locales
957
# Ah my Romanian hero. Please help me update the translation
958
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
959
# $ $EDITOR fluxbox-generate-menu.in
960
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
961
# email fbgm.diff to han@mijncomputer.nl
963
BACKGROUNDMENU='Fundaluri'
964
BACKGROUNDMENUTITLE='Alege fundalul'
965
BROWSERMENU='Navigatoare'
966
CONFIGUREMENU='Configurare'
967
EDITORMENU='Editoare'
969
FBSETTINGSMENU='Meniul Fluxbox'
970
FILEUTILSMENU='Utilitare de fisier'
971
FLUXBOXCOMMAND='Comanda Fluxbox'
973
GNOMEMENUTEXT='Meniu Gnome'
974
GRAPHICMENU='Grafica'
975
KDEMENUTEXT='Meniu KDE'
976
LOCKSCREEN='Incuie ecranul'
978
MULTIMEDIAMENU='Multimedia'
982
RANDOMBACKGROUND='Fundal aleator'
983
REGENERATEMENU='Regenereaza meniul'
984
RELOADITEM='Reincarca configuratia'
985
RESTARTITEM='Restart'
986
RUNCOMMAND='Lanseaza'
987
SCREENSHOT='Captura ecran'
988
STYLEMENUTITLE='Alege un stil...'
989
SYSTEMSTYLES='Stiluri sistem'
990
TERMINALMENU='Terminale'
992
USERSTYLES='Stiluri utilizator'
993
WINDOWMANAGERS='WindowManagers'
994
WINDOWNAME='Nume fereastra'
995
WORKSPACEMENU='Lista workspace-uri'
996
XUTILSMENU='Utilitare X'
998
es_ES*) # spanish locales
999
# Ah my Spanish hero. Please help me update the translation
1000
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
1001
# $ $EDITOR fluxbox-generate-menu.in
1002
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
1003
# email fbgm.diff to han@mijncomputer.nl
1005
BACKGROUNDMENUTITLE='Seleccionar Fondo'
1006
BROWSERMENU='Navegadores'
1007
CONFIGUREMENU='Configurar'
1008
EDITORMENU='Editores'
1010
FBSETTINGSMENU='Men� fluxbox'
1012
GNOMEMENUTEXT='Men�s Gnome'
1013
GRAPHICMENU='Gr�ficos'
1014
KDEMENUTEXT='Men�s KDE'
1016
MULTIMEDIAMENU='Multimedia'
1019
OFFICEMENU='Oficina'
1020
RELOADITEM='Reconfigurar'
1021
RESTARTITEM='Reiniciar'
1022
STYLEMENUTITLE='Escoge un Estilo...'
1023
SYSTEMSTYLES='Estilos del Sistema'
1024
TERMINALMENU='Terminales'
1025
USERSTYLES='Estilos del Usuario'
1026
WORKSPACEMENU='Lista de Escritorios'
1027
XUTILSMENU='Utilidades X'
1028
BACKGROUNDMENU='Fondos'
1029
FILEUTILSMENU='Utilidades'
1030
FLUXBOXCOMMAND='Comandos de Fluxbox'
1031
LOCKSCREEN='Bloquear Pantalla'
1032
RANDOMBACKGROUND='Fondo Aleatoreo'
1033
REGENERATEMENU='Regenerar Men�'
1034
RUNCOMMAND='Ejecutar'
1035
SCREENSHOT='Captura de Pantalla'
1037
WINDOWMANAGERS='Gestores de Ventanas'
1038
WINDOWNAME='Nombre de Ventana'
1040
pl_PL*) # Polish locales
1041
# Ah my Russian hero. Please help me update the translation
1042
# $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig
1043
# $ $EDITOR fluxbox-generate-menu.in
1044
# $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff
1045
# email fbgm.diff to han@mijncomputer.nl
1047
BACKGROUNDMENU='Tapety'
1048
BACKGROUNDMENUTITLE='Ustaw tapet�'
1049
BROWSERMENU='Przegl�darki'
1050
CONFIGUREMENU='Konfiguracja'
1051
EDITORMENU='Edytory'
1053
FBSETTINGSMENU='Menu Fluxbox'
1054
FILEUTILSMENU='Narz�dzia do plik�w'
1055
FLUXBOXCOMMAND='Polecenia Fluxbox'
1057
GNOMEMENUTEXT='Menu Gnome'
1058
GRAPHICMENU='Grafika'
1059
KDEMENUTEXT='Menu KDE'
1060
LOCKSCREEN='Zablokuj ekran'
1062
MULTIMEDIAMENU='Multimedia'
1065
OFFICEMENU='Aplikacje biurowe'
1066
RANDOMBACKGROUND='Losowa tapeta'
1067
REGENERATEMENU='Wygeneruj menu'
1068
RELOADITEM='Od�wie� konfiguracj�'
1069
RESTARTITEM='Restartuj'
1070
RUNCOMMAND='Uruchom...'
1071
SCREENSHOT='Zrzut ekranu'
1072
STYLEMENUTITLE='Wybierz styl...'
1073
SYSTEMSTYLES='Style systemowe'
1074
TERMINALMENU='Terminale'
1076
USERSTYLES='Style u�ytkownika'
1077
WINDOWMANAGERS='Menad�ery okien'
1078
WINDOWNAME='Nazwy okien'
1079
WORKSPACEMENU='Lista pulpit�w'
1080
XUTILSMENU='Narz�dzia X'
1082
pt_PT*) # Portuguese locales
1083
BACKGROUNDMENU='Imagens de Fundo'
1084
BACKGROUNDMENUTITLE='Definir Imagem de Fundo'
1085
BROWSERMENU='Browsers'
1086
CONFIGUREMENU='Configura��o'
1087
EDITORMENU='Editores'
1089
FBSETTINGSMENU='Menu Fluxbox'
1090
FILEUTILSMENU='Utilit�rios de Ficheiros'
1091
FLUXBOXCOMMAND='Comando Fluxbox'
1093
GNOMEMENUTEXT='Menu Gnome'
1094
GRAPHICMENU='Gr�ficos'
1095
KDEMENUTEXT='Menu KDE'
1096
LOCKSCREEN='Trancar Ecr�'
1098
MULTIMEDIAMENU='Multim�dia'
1101
OFFICEMENU='Escrit�rio'
1102
RANDOMBACKGROUND='Imagem Aleat�ria'
1103
REGENERATEMENU='Regenerar Menu'
1104
RELOADITEM='Recarregar configura��o'
1105
RESTARTITEM='Reiniciar'
1106
RUNCOMMAND='Executar'
1107
SCREENSHOT='Capturar Ecr�'
1108
STYLEMENUTITLE='Escolha um estilo...'
1109
SYSTEMSTYLES='Estilos do Sistema'
1110
TERMINALMENU='Terminais'
1112
USERSTYLES='Estilos do Utilizador'
1114
WINDOWMANAGERS='Gestores de Janelas'
1115
WINDOWNAME='Nome da Janela'
1116
WORKSPACEMENU='Lista de �reas de Trabalho'
1117
XUTILSMENU='Utilit�rios X'
1124
MENUFILENAME="${MENUFILENAME:=${HOME}/.fluxbox/menu}"
1125
MENUTITLE="${MENUTITLE:=Fluxbox}"
1126
HOMEPAGE="${HOMEPAGE:=fluxbox.org}"
1127
USERMENU="${USERMENU:=${HOME}/.fluxbox/usermenu}"
1129
# Read the menuconfig file if it exists or else create it.
1130
# But not during install time, use envvar for sun
1131
if [ ! "${INSTALL}" = Yes ]; then
1132
if [ -r ${HOME}/.fluxbox/menuconfig ]; then
1133
. ${HOME}/.fluxbox/menuconfig
1135
if [ ! "$WHOAMI" = root ]; then # this is only for users.
1136
if touch ${HOME}/.fluxbox/menuconfig; then
1137
cat << EOF > ${HOME}/.fluxbox/menuconfig
1138
# This file is read by fluxbox-generate_menu. If you don't like a
1139
# default you can change it here. Don't forget to remove the # in front
1142
# Your favourite terminal. Put the command in quotes if you want to use
1143
# options. Put a backslash in before odd chars
1144
# MY_TERM='Eterm --tint \#123456'
1145
# MY_TERM='aterm -tint \$(random_color)'
1147
# Your favourite browser. You can also specify options.
1148
# MY_BROWSER=mozilla
1150
# Name of the outputfile
1151
# MENUFILENAME=${HOME}/.fluxbox/menu
1153
# MENUTITLE=\`fluxbox -version|cut -d " " -f-2\`
1155
# standard url for console-browsers
1156
# HOMEPAGE=fluxbox.org
1158
# location with your own menu-entries
1159
# USERMENU=~/.fluxbox/usermenu
1161
# Put the launcher you would like to use here
1166
# FBRUNOPTIONS='-font 10x20 -fg grey -bg black -title run'
1169
# These are prefixes; So if fluxbox is installed in /usr/bin/fluxbox
1170
# your prefix is: /usr
1172
# fluxbox-generate already looks in /usr/X11R6, /usr, /usr/local and /opt so
1173
# there should be no need to specify them.
1176
# GNOME_PREFIX=/opt/gnome
1177
# KDE_PREFIX=/opt/kde
1180
# Sepparate the list of background-dirs with semicolumns ':'
1181
# BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:@PREFIX@/share/fluxbox/backgrounds/:/usr/share/wallpapers"
1184
# --- Boolean variables.
1185
# Setting a variable to ``no'' won't help. Comment them out if you don't
1186
# want them. Setting are overruled by the command-line options.
1188
# Include all backgrounds in your backgrounds-directory
1189
# BACKGROUNDMENUITEM=yes
1194
# Include gnome-menus
1197
# Don't cleanup the menu
1202
echo "Warning: I couldn't create ${HOME}/.fluxbox/menuconfig" >&2
1209
if [ -z "$3" -o -n "`echo $3|grep '^-'`" ]; then
1210
echo "Error: The option $2 requires an argument." >&2
1215
if find_it "$3"; then
1218
echo "Error: The option $2 needs an executable as argument, and \`$3' is not." >&2
1222
if [ -d "$3" ]; then
1225
echo "Error: The option $2 needs a directory as argument, and \`$3' is not." >&2
1229
if [ -r "$3" ]; then
1232
echo "Error: The option $2 needs a readable file as argument, and \`$3' is not." >&2
1242
while [ $# -gt 0 ]; do
1244
-B) BACKGROUNDMENUITEM=yes; shift;;
1245
-k) KDEMENU=yes; shift;;
1246
-g) GNOMEMENU=yes; shift;;
1247
-in) NO_ICON=yes; shift;;
1248
-is) OTHER_ICONPATHS="
1249
/usr{,/local}/share{,/xclass}/{icons,pixmaps}
1250
/usr{,/local}/share/icons/mini
1251
/usr{,/local}/{,X11R6/}share/icons/{default.kde,hicolor}/16x16/*
1254
-ds) OTHER_DESKTOP_PATHS="
1256
/usr/share/applications
1257
/usr/share/xsessions
1262
-i) USER_ICONPATHS=${2};
1265
testoption di $1 $aPath;
1268
-d) USER_DESKTOP_PATHS=${2};
1271
testoption di $1 $aPath;
1274
-t) MY_TERM=${2}; testoption ex $1 $2; shift 2;;
1275
-b) MY_BROWSER=${2}; testoption ex $1 $2; shift 2;;
1276
-o) MENUFILENAME=${2}; shift 2; CHECKINIT=NO ;;
1277
-p) PREFIX=${2}; testoption di $1 $2; shift 2;;
1278
-n) GNOME_PREFIX=${2}; testoption di $1 $2; shift 2;;
1279
-q) KDE_PREFIX=${2}; testoption di $1 $2; shift 2;;
1280
-m) MENUTITLE=${2}; testoption sk $1 $2; shift 2;;
1281
-w) HOMEPAGE=${2}; testoption sk $1 $2; shift 2;;
1282
-u) USERMENU=${2}; testoption fl $1 $2; shift 2;;
1283
-r) REMOVE=no; shift;;
1284
-h) display_help ; exit 0 ;;
1285
-a) display_authors ; exit 0 ;;
1286
--*) echo "fluxbox-generate_menu doesn't recognize -- gnu-longopts."
1287
echo 'Use fluxbox-generate_menu -h for a long help message.'
1291
# split concatenated single-letter options apart
1293
set -- `echo "$FIRST" | sed 's/^-\(.\)\(.*\)/-\1 -\2/'` "$@"
1296
echo 1>&2 "fluxbox-generate_menu: unrecognized option "\`"$1'"
1308
# Can we actually create ${MENUFILENAME}
1309
touch ${MENUFILENAME} 2> /dev/null
1310
if [ $? -ne 0 ]; then
1311
echo "Fatal error: can't create or write to $MENUFILENAME" >&2
1316
if [ -w "${MENUFILENAME}" ]; then
1317
if [ -f ${MENUFILENAME}.firstbak ]; then
1318
cp ${MENUFILENAME} ${MENUFILENAME}.firstbak
1320
if [ -s "${MENUFILENAME}" ]; then
1321
mv ${MENUFILENAME} ${MENUFILENAME}.bak
1326
PREFIX="${PREFIX:=@PREFIX@}"
1327
if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then
1328
PREFIX=`which fluxbox | sed 's,/bin/fluxbox$,,'`
1333
for GNOME_PREFIX in "${GNOME_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do
1334
if [ -n "${GNOME_PREFIX}" -a -d "$GNOME_PREFIX/share/gnome" ]; then
1338
# Will remain $PREFIX if all else fails
1341
for KDE_PREFIX in "${KDE_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do
1342
if [ -n "${KDE_PREFIX}" -a -d "$KDE_PREFIX/share/applnk" ]; then
1347
if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then
1348
# [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging
1349
FB_ICONDIR="$HOME/.fluxbox/icons"
1350
[ -d "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR"
1351
ICONMAPPING="$HOME/.fluxbox/iconmapping"
1353
if [ "$GNOMEMENU" ] ; then
1354
OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS"
1355
#[ "OTHER_ICONPATHS" ] && OTHER_ICONPATHS=
1357
if [ "$KDEMENU" ] ; then
1358
OTHER_DESKTOP_PATHS="\"$HOME/.kde/share/applnk\" \"${KDE_PREFIX}/share/applnk\" $OTHER_DESKTOP_PATHS"
1359
[ "OTHER_ICONPATHS" ] && OTHER_ICONPATHS="\"$HOME\"/.kde/share/icons/{,*} $OTHER_ICONPATHS"
1361
[ "$GNOMEMENU$KDEMENU" ] && OTHER_DESKTOP_PATHS="\"$ETCAPPLNK\" $OTHER_DESKTOP_PATHS"
1364
#echo checkDirs: $* >&2
1365
local CHECKED_DIRS=""
1367
if [ -d "$DIR" ]; then
1368
# todo: should check if there are duplicates
1369
CHECKED_DIRS="$CHECKED_DIRS \"$DIR\""
1372
#echo checkDirs - $CHECKED_DIRS >&2
1376
OTHER_ICONPATHS=`eval checkDirs $OTHER_ICONPATHS`
1377
OTHER_DESKTOP_PATHS=`eval checkDirs $OTHER_DESKTOP_PATHS`
1379
# $dnlamVERBOSE "Using USER_DESKTOP_PATHS=\"$USER_DESKTOP_PATHS\" and USER_ICONPATHS=\"$USER_ICONPATHS\""
1380
# $dnlamVERBOSE "Using OTHER_ICONPATHS=$OTHER_ICONPATHS"
1381
# $dnlamVERBOSE "Using OTHER_DESKTOP_PATHS=$OTHER_DESKTOP_PATHS"
1382
# $dnlamVERBOSE "Calling function: createIconMapping"
1384
# $dnlamVERBOSE "Creating $ICONMAPPING" >&2
1385
touch "$ICONMAPPING"
1386
eval createIconMapping $USER_DESKTOP_PATHS $OTHER_DESKTOP_PATHS
1387
# $dnlamVERBOSE "Done createIconMapping."
1390
# directory for the backgrounds
1391
if [ -z "$BACKGROUND_DIRS" ]; then
1392
BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/"
1395
# find the default terminal
1396
if find_it_options $MY_TERM; then
1397
DEFAULT_TERM=$MY_TERM
1399
[ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2
1400
#The precise order is up for debate.
1401
for term in Eterm urxvt urxvtc aterm rxvt wterm xterm konsole gnome-terminal; do
1402
if find_it $term; then
1408
# a unix system without any terms. that's odd
1409
if [ -z "$DEFAULT_TERM" ]; then
1412
Warning: I can't find any terminal-emulators in your PATH. Please fix
1413
your PATH or specify your favourite terminal-emulator with the -t option
1419
DEFAULT_TERMNAME=`echo $DEFAULT_TERM|awk '{print $1}'`
1420
DEFAULT_TERMNAME=`basename $DEFAULT_TERMNAME`
1423
# find the default browser
1424
if find_it_options $MY_BROWSER; then
1425
DEFAULT_BROWSER=$MY_BROWSER
1427
[ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2
1428
#The precise order is up for debate.
1429
for browser in firefox mozilla-firefox mozilla-firebird MozillaFirebird opera skipstone mozilla galeon konqueror dillo netscape w3m links lynx; do
1430
if find_it $browser; then
1431
DEFAULT_BROWSER=$browser
1436
DEFAULT_BROWSERNAME=`echo $DEFAULT_BROWSER|awk '{print $1}'`
1437
DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME`
1441
cat << EOF > ${MENUFILENAME}
1442
# Generated by fluxbox-generate_menu
1444
# If you read this it means you want to edit this file manually, so here
1445
# are some useful tips:
1447
# - You can add your own menu-entries to ~/.fluxbox/usermenu
1449
# - If you miss apps please let me know and I will add them for the next
1452
# - The -r option prevents removing of empty menu entries and lines which
1453
# makes things much more readable.
1455
# - To prevent any other app from overwriting your menu
1456
# you can change the menu name in .fluxbox/init to:
1457
# session.menuFile: /home/you/.fluxbox/my-menu
1461
echo "[begin] (${MENUTITLE})" >> ${MENUFILENAME}
1463
append "[exec] (${DEFAULT_TERMNAME}) {${DEFAULT_TERM}}"
1465
case "$DEFAULT_BROWSERNAME" in
1466
links|w3m|lynx) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;;
1467
firefox|firebird|mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_BROWSER}}" ;;
1468
konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;;
1469
opera) append "[exec] (opera) {env QT_XFT=true opera}" ;;
1470
MozillaFirebird) append "[exec] (firebird) {MozillaFirebird}" ;;
1471
MozillaFirefox) append "[exec] (firefox) {MozillaFirefox}" ;;
1472
*) append "[exec] ($DEFAULT_BROWSERNAME) {$DEFAULT_BROWSER}" ;;
1475
find_it "${LAUNCHER}" append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}"
1478
append_submenu "${TERMINALMENU}"
1479
normal_find xterm urxvt urxvtc gnome-terminal multi-gnome-terminal Eterm \
1480
konsole aterm mlterm multi-aterm rxvt
1484
append_submenu "${NETMENU}"
1485
append_submenu "${BROWSERMENU}"
1486
normal_find firefox mozilla-firefox MozillaFirefox galeon mozilla dillo netscape vncviewer
1487
find_it links append "[exec] (links-graphic) {links -driver x ${HOMEPAGE}}"
1488
find_it opera append "[exec] (opera) {env QT_XFT=true opera}"
1489
find_it konqueror append "[exec] (konqueror) {kfmclient openProfile webbrowsing}"
1490
find_it links append "[exec] (links) {${DEFAULT_TERM} -e links ${HOMEPAGE}}"
1491
find_it w3m append "[exec] (w3m) {${DEFAULT_TERM} -e w3m ${HOMEPAGE}}"
1492
find_it lynx append "[exec] (lynx) {${DEFAULT_TERM} -e lynx ${HOMEPAGE}}"
1496
normal_find gaim kopete gnomemeeting sim kadu psi amsn
1497
find_it licq append "[exec] (licq) {env QT_XFT=true licq}"
1498
cli_find centericq micq
1502
normal_find sylpheed kmail evolution thunderbird mozilla-thunderbird \
1508
normal_find liferea pears
1513
normal_find xchat xchat-2 ksirc vyqchat lostirc logui konversation kvirc
1514
cli_find irssi epic4 weechat ninja
1515
find_it BitchX append "[exec] (BitchX) {${DEFAULT_TERM} -e BitchX -N}" || \
1516
find_it bitchx append "[exec] (BitchX) {${DEFAULT_TERM} -e bitchx -N}"
1517
find_it ircii append "[exec] (ircii) {${DEFAULT_TERM} -e ircii -s}"
1521
normal_find gtk-gnutella lopster nicotine pyslsk xmule amule \
1522
Valknut dcgui-qt dc_qt quickdc asami
1523
cli_find TekNap giFTcurs
1527
normal_find gftp IglooFTP-PRO
1528
cli_find ncftp pftp ftp lftp yafc
1531
normal_find pan xnmap skype x3270
1535
append_submenu "${EDITORMENU}"
1536
normal_find gvim bluefish nedit gedit xedit kword kwrite kate anjuta \
1537
wings xemacs emacs kvim cream evim scite
1538
cli_find nano vim vi zile jed joe
1539
find_it emacs append "[exec] (emacs-nw) {${DEFAULT_TERM} -e emacs -nw}"
1540
find_it xemacs append "[exec] (xemacs-nw) {${DEFAULT_TERM} -e xemacs -nw}"
1543
append_submenu "${EDUCATIONMENU}"
1544
normal_find celestia scilab geomview scigraphica oregano xcircuit electric \
1545
pymol chemtool xdrawchem
1546
find_it R append "[exec] (R) {${DEFAULT_TERM} -e R --gui=gnome}"
1547
cli_find maxima grace yacas octave gnuplot grass coq acl
1550
append_submenu "${FILEUTILSMENU}"
1551
find_it konqueror append "[exec] (konqueror) {kfmclient openProfile filemanagement}"
1552
normal_find gentoo krusader kcommander linuxcmd rox tuxcmd krename xfe xplore
1553
find_it nautilus append "[exec] (nautilus) {nautilus --no-desktop --browser}"
1557
append_submenu "${MULTIMEDIAMENU}"
1558
append_submenu "${GRAPHICMENU}"
1559
normal_find gimp gimp2 gimp-2.2 inkscape sodipodi xv gqview showimg xpaint kpaint kiconedit \
1560
ee xzgv xscreensaver-demo xlock gphoto tuxpaint
1561
find_it xnview append "[exec] (xnview browser) {xnview -browser}"
1562
find_it blender append "[exec] (blender) {blender -w}"
1563
find_it gears append "[exec] (Mesa gears) {gears}"
1564
find_it morph3d append "[exec] (Mesa morph) {morph3d}"
1565
find_it reflect append "[exec] (Mesa reflect) {reflect}"
1568
append_submenu "${MUSICMENU}"
1569
normal_find xmms noatun alsaplayer gqmpeg aumix xmixer gnome-alsamixer gmix kmix kscd \
1570
grecord kmidi xplaycd soundtracker grip easytag audacity \
1571
zinf rhythmbox kaboodle beep-media-player amarok
1572
cli_find cdcd cplay alsamixer orpheus mp3blaster
1576
append_submenu "${VIDEOMENU}"
1577
normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb realplay xawtv fxtv ogle goggles vlc
1578
find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}"
1581
append_submenu "${XUTILSMENU}"
1582
normal_find xfontsel xman xload xfigxbiff editres viewres xclock \
1583
xmag wmagnify gkrellm gkrellm2 vmware portagemaster celestia
1584
find_it xrdb append "[exec] (Reload .Xdefaults) {xrdb -load $HOME/.Xdefaults}"
1589
append_submenu "${OFFICEMENU}"
1590
normal_find xclock xcalc kcalc gv
1591
find_it gcalc append "[exec] (gcalc) {gcalc}" || \
1592
find_it gnome-calculator append "[exec] (gcalc) {gnome-calculator}"
1594
for ext in s o xo; do
1595
find_it ${ext}office append "[exec] (Open Office) {${ext}office}"
1596
find_it ${ext}ocalc append "[exec] (OO Calc) {${ext}ocalc}"
1597
find_it ${ext}owriter append "[exec] (OO Writer) {${ext}owriter}"
1598
find_it ${ext}oimpress append "[exec] (OO Impress) {${ext}oimpress}"
1599
find_it ${ext}odraw append "[exec] (OO Draw) {${ext}odraw}"
1600
find_it ${ext}omath append "[exec] (OO Math) {${ext}omath}"
1601
find_it ${ext}opadmin append "[exec] (OO Printer Admin) {${ext}opadmin}"
1602
find_it mrproject append "[exec] (Mr.Project) {mrproject}"
1605
normal_find abiword kword wordperfect katoob acroread xpdf lyx
1606
normal_find dia xfig
1609
append_submenu "${GAMESMENU}"
1610
normal_find bzflag gnibbles gnobots2 tuxpuck gataxx glines \
1611
gnect mahjongg gnomine gnome-stones gnometris gnotravex \
1612
gnotski iagno knights eboard xboard scid freecell pysol \
1613
gtali tuxracer xpenguins xsnow xeyes xpenguins smclone \
1614
openmortal quake2 quake3 skoosh same-gnome enigma xbill \
1615
icebreaker scorched3d sol dosbox black-box enigma freeciv \
1616
freeciv-server frozen-bubble liquidwar qt-nethack \
1617
nethack-gnome pathological scummvm xqf \
1618
wesnoth canfeild ace_canfeild golf merlin chickens \
1619
supertux tuxdash neverball cube_client blackjack \
1620
doom doom3 blackshades gltron kpoker
1623
find_it et append "[exec] (Enemy Territory) {et}"
1624
find_it ut append "[exec] (Unreal Tournament) {ut}"
1625
find_it ut2003 append "[exec] (Unreal Tournament 2003) {ut2003}"
1626
find_it ut2004 append "[exec] (Unreal Tournament 2004) {ut2004}"
1629
# We'll only use this once
1630
ETCAPPLNK=/etc/X11/applnk
1631
PARSING_DESKTOP="true"
1633
if [ "${GNOMEMENU}" ]; then
1634
append_submenu "${GNOMEMENUTEXT}"
1635
recurse_dir_menu "${GNOME_PREFIX}/share/gnome/apps" "$HOME/.gnome/apps" ${ETCAPPLNK}
1641
if [ -d "${KDE_PREFIX}/share/applnk/" -a "${KDEMENU}" ]; then
1642
append_submenu "${KDEMENUTEXT}"
1643
recurse_dir_menu "${KDE_PREFIX}/share/applnk" "$HOME/.kde/share/applnk" ${ETCAPPLNK}
1647
unset PARSING_DESKTOP
1650
if [ -r "${USERMENU}" ]; then
1651
cat ${USERMENU} >> ${MENUFILENAME}
1654
append_submenu "${FBSETTINGSMENU}"
1655
append "[config] (${CONFIGUREMENU})"
1657
append_menu "[submenu] (${SYSTEMSTYLES}) {${STYLEMENUTITLE}}"
1658
append "[stylesdir] (${PREFIX}/share/fluxbox/styles)"
1661
append_menu "[submenu] (${USERSTYLES}) {${STYLEMENUTITLE}}"
1662
append "[stylesdir] (~/.fluxbox/styles)"
1667
picturename=`basename "$1"`
1668
append "[exec] (${picturename%.???}) {fbsetbg -a \"$1\" }"
1671
if [ "$BACKGROUNDMENUITEM" = yes ]; then
1672
IFS=: # set delimetor for find
1673
NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l`
1674
if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then
1675
append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}"
1676
append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${HOME}/.fluxbox/backgrounds}"
1677
if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then
1678
menucounter=1 ; counter=1
1679
append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
1680
find $BACKGROUND_DIRS -follow -type f|sort|while read i; do
1681
counter=`expr $counter + 1`
1682
if [ $counter -eq 30 ]; then
1684
menucounter=`expr $menucounter + 1`
1686
append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
1692
find $BACKGROUND_DIRS -follow -type f|sort|while read i; do
1698
echo "Warning: You wanted a background-menu but I couldn't find any backgrounds in:
1699
$BACKGROUND_DIRS" >&2
1703
append "[workspaces] (${WORKSPACEMENU})"
1705
append_submenu ${TOOLS}
1706
normal_find fluxconf fluxkeys fluxmenu
1707
# if gxmessage exitst use it; else use xmessage
1708
find_it gxmessage append \
1709
"[exec] (${WINDOWNAME}) {xprop WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" || \
1710
find_it xmessage append \
1711
"[exec] (${WINDOWNAME}) {xprop WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}"
1712
find_it import append "[exec] (${SCREENSHOT} - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg}"
1713
find_it import append "[exec] (${SCREENSHOT} - PNG) {import screenshot.png && display -resize 50% screenshot.png}"
1714
find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}"
1715
find_it switch append "[exec] (gtk-theme-switch) {switch}"
1716
find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}"
1717
find_it fluxbox-generate_menu append "[exec] (${REGENERATEMENU}) {fluxbox-generate_menu}"
1720
append_submenu ${WINDOWMANAGERS}
1721
#hard to properly maintain since there are so many exceptions to the rule.
1722
for wm in icewm ion kde sawfish enlightenment fvwm openbox evilwm waimea xfce pekwm; do
1723
find_it start${wm} append "[restart] (${wm}) {start${wm}}" ||\
1724
find_it ${wm} append "[restart] (${wm}) {${wm}}"
1726
find_it startgnome append "[restart] (gnome) {startgnome}" ||\
1727
find_it gnome-session append "[restart] (gnome) {gnome-session}"
1729
find_it startwindowmaker append "[restart] (windowmaker) {startwindowmaker}" ||\
1730
find_it wmaker append "[restart] (windowmaker) {wmaker}"
1732
find_it xlock append "[exec] (${LOCKSCREEN}) {xlock}" ||\
1733
find_it xscreensaver-command append "[exec] (${LOCKSCREEN}) {xscreensaver-command -lock}"
1734
append "[commanddialog] (${FLUXBOXCOMMAND})"
1735
append "[reconfig] (${RELOADITEM})"
1736
append "[restart] (${RESTARTITEM})"
1737
append "[exec] (${ABOUTITEM}) {(fluxbox -v; fluxbox -info | sed 1d) 2> /dev/null | xmessage -file - -center}"
1738
append "[separator]"
1739
append "[exit] (${EXITITEM})"
1744
# this function removes empty menu items. It can not yet remove nested
1747
if [ ! "${REMOVE}" ]; then
1751
# escapes any parentheses in menu label
1752
# e.g., "[exec] (konqueror (web))" becomes "[exec] (konqueror (web\))"
1753
sed 's/(\(.*\)(\(.*\)))/(\1 (\2\\))/' $MENUFILENAME > menu.tmp
1754
mv -f menu.tmp $MENUFILENAME
1756
if [ -z "$INSTALL" ]; then
1757
if [ -z "$CHECKINIT" ]; then
1758
INITMENUFILENAME=`awk '/menuFile/ {print $2}' $HOME/.fluxbox/init`
1759
INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"`
1760
if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then
1761
echo "Note: In $HOME/.fluxbox/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2
1764
echo "Menu successfully generated: $MENUFILENAME"
1765
#echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init."
1766
echo 'Use fluxbox-generate_menu -h to read about all the latest features.'