#!/bin/sh # # generate_menu for Fluxbox # # Copyright (c) 2005 Dung N. Lam # Copyright (c) 2002-2004 Han Boetes # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # # $Id: fluxbox-generate_menu.in 4091 2005-08-17 04:24:55Z mathias $ # # Portability notes: # To guarantee this script works on all platforms that support fluxbox # please keep the following restrictions in mind: # # - don't use [ "a" == "a" ]; use [ "a" = "a" ] (found with help from FreeBSD user relaxed) # - don't use if ! command;, use command; if [ $? -ne 0 ]; # - don't use [ -e file ] use [ -r file ] # - don't use $(), use `` # - don't use ~, use ${HOME} # - don't use id -u or $UID, use whoami # - getopts won't work on all platforms, but the config-file can # compensate for that. # - OpenBSD and Solaris grep do not have the -m option # - Traditional grep does NOT support -q or -s that POSIX.2 required. # - various software like grep/sed/perl may be not present or not # the version you have. for example grep '\W' only works on gnu-grep. # Keep this in mind, use bare basic defaults. # - Do _NOT_ suggest to use #!/bin/bash. Not everybody uses bash. # Non portable features like getopts in this script can be achieved in # other ways. dnlamVERBOSE=/bin/echo WHOAMI=`whoami` [ "$WHOAMI" = root ] && PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin # Natively supported icon formats INPUTICONFORMATS='.xpm' # Check for Imlib2-support if fluxbox -info 2> /dev/null | grep "^IMLIB" >/dev/null; then PNG_ICONS="yes" INPUTICONFORMATS="${INPUTICONFORMATS} .png" else # better assume to assume "no" PNG_ICONS="no" fi # now this crazy expression gets every file extension that ImageMagick is capable of reading # the grep -E expression needs to be tested more throughly on non-GNU platforms # the '[r]' is the core part here, that field can be '-' or 'r' to denote that # ImageMagick is not or is capable of reading that format respectively. #IMAGEMAGICFORMATS="`identify -list format -verbose 2>/dev/null | grep -E '^[[:space:]]*([[:alnum:]]+)\*?[[:space:]]+([[:alnum:]]+)[[:space:]]+([r][-w][-+])[[:space:]]+(.*)' 2>/dev/null | sed -e 's,*,,g;' | awk '{printf ".%s .%s.gz .%s.Z .%s.bz2 ",tolower($1),tolower($1),tolower($1),tolower($1) }'`" which convert &>/dev/null && IMAGEMAGICKFORMATS='.png .gif .svg .svgz .ico .icon' [ -n "$IMAGEMAGICKFORMATS" ] && INPUTICONFORMATS="${INPUTICONFORMATS} ${IMAGEMAGICKFORMATS}" echo $INPUTICONFORMATS # build a find expression to match ANY of the file extensions v="$INPUTICONFORMATS" while [ -n "${v}" ]; do e="${v/ *}" echo "e=$e v=$v" findexprformats="${findexprformats} -o -name '*${e}'" ov="$v" v="${v#* }" [ "$v" = "$ov" ] && v='' done # for the dangling OR at the front findexprformats="-false ${findexprformats}" echo $findexprformats # Functions display_usage() { cat << EOF Usage: fluxbox-generate_menu [-kgrBh] [-t terminal] [-w url] [-b browser] [-m menu-title] [-o /path] [-u /path] [-p /path] [-n /path] [-q /path] [-d /path ] [-ds] [-i /path] [-is] EOF } display_help() { display_usage cat << EOF Options: -k Insert a kde menu -g Add a gnome menu -B enable backgrounds menu -r Don't remove empty menu-entries; for templates -d other path(s) to recursively search for *.desktop files -ds wider search for *.desktop files (takes more time) -i other path(s) to search for icons e.g., "/usr/kde/3.3/share/icons/crystalsvg/16x16/*" -is wider search for icons (worth the extra time) -in skip icon search -t Favourite terminal -w Homepage for console-browsers. Default is fluxbox.org -b Favourite browser -m Menu-title; default is "Fluxbox" -o Outputfile; default is ~/.fluxbox/menu -u user sub-menu; default is ~/.fluxbox/usermenu -h Display this help -a Display the authors of this script Only for packagers: -p prefix; default is /usr -n Gnome-prefix; /opt, /usr, /usr/X11R6 and /usr/local autodetected -q KDE-prefix; idem dito Files: ~/.fluxbox/usermenu your own submenu which will be included in the menu ~/.fluxbox/menuconfig rc file for fluxbox-generate_menu EOF } display_authors() { cat << EOF fluxbox-generate_menu was brought to you by: Henrik Kinnunen: Project leader. Han Boetes: Packaging, debugging and scripts. Simon Bowden: Cleanups and compatibility for sun. Jeramy B. Smith: Packaging assistance, gnome and kde menu system. Filippo Pappalardo: Italian locales and -t option. $WHOAMI: Innocent bystander. EOF } # some which's have a reliable return code, some don't # Lets figure out which which we have. if which this_program_does_not_exist-no_really-aA1zZ9 2> /dev/null 1> /dev/null; then # can't rely on return value find_it() { file=`which $1 2> /dev/null` if [ -x "$file" ]; then if [ $# -gt 1 ]; then shift $* fi return 0 else return 1 fi } find_it_options() { file=`which $1 2> /dev/null` if [ -x "$file" ]; then return 0 else return 1 fi } else # can rely on return value find_it() { which $1 > /dev/null 2>&1 && shift && $* } find_it_options() { which $1 > /dev/null 2>&1 } fi #echo "replaceWithinString: $1, $2, $3" >&2 #echo ${1//$2/$3} # causes error in BSD even though not used replaceWithinString(){ echo $1 | awk "{ gsub(/$2/, \"$3\"); print }" } convertIcon(){ if [ ! -f "$1" ] ; then echo "Icon file not found: $1" >&2 return 1 fi if [ "$1" = "$2" ]; then $dnlamVERBOSE "Files are in the same location: $1 = $2" >&2 # not really an error; just nothing to do. return 0; fi local BASENAME BASENAME="${1##*/}" # make sure it is an icon by checking if it has an extension if [ "$BASENAME" = "${BASENAME%%.*}" ]; then $dnlamVERBOSE "File $1 does not have a filename extention." >&2 return 1; fi # don't have to convert xpm files case "$1" in *.xpm) echo "$1" return 0; ;; esac # may not have to convert png if imlib is enabled if [ "$PNG_ICONS" = "yes" ]; then case "$1" in *.png) echo "$1" return 0; ;; esac fi # convert all others icons and save it as xpm format under directory $2 entry_icon="$2/${BASENAME%.*}.xpm" if [ -f "${entry_icon}" ]; then : echo "File exists. To overwrite, type: convert \"$1\" \"$entry_icon\"" >&2 else if which convert &> /dev/null; then $dnlamVERBOSE "Converting $1" >&2 convert "$1" -normalize "$entry_icon" #echo convert "$1" , "$entry_icon" >> $ICONMAPPING else echo "Please install ImageMagick's convert utility" >&2 fi fi echo "$entry_icon" } removePath(){ execname="$1" local progname progname="${execname%% *}" # separate program name and its parameters if [ "$progname" = "$execname" ]; then # no params # remove path from only program name execname="${progname##*/}" else local params params="${execname#* }" # remove path from only program name execname="${progname##*/} $params" fi echo $execname } doSearchLoop(){ EXTLIST="$1" shift for ICONPATH in "$@"; do ##$dnlVERBOSE ": $ICONPATH" >> $ICONMAPPING [ -d "$ICONPATH" ] || continue #echo -n "." ##$dnlVERBOSE ":: $ICONPATH/$temp_icon" >> $ICONMAPPING if [ -f "$ICONPATH/$temp_icon" ]; then echo "$ICONPATH/$temp_icon" return 0; else # try different extensions; # remove extension iconNOext="${temp_icon%%.*}" FILELIST="`find $ICONPATH -maxdepth 1 -name "$iconNOext.*" -a \( ${findexprformats} \)`" for F in $FILELIST; do ## echo "::: $ICONPATH/$iconNOext$ICONEXT" >> $ICONMAPPING if [ -f "$F" ]; then echo "$F" return 0; fi done fi done #echo "done" return 1 } doIconSearch(){ # remove '(' from '(fluxbox ...) | ...' local execname temp_icon execname=`replaceWithinString "$1" "\("` temp_icon="$2" ##$dnlamVERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING # check in $ICONMAPPING before searching directories entry_icon=`lookupEntry $ICONMAPPING "${execname}"` if [ -n "$entry_icon" ]; then entry_icon=`replaceWithinString "$entry_icon" "<"` entry_icon=`replaceWithinString "$entry_icon" ">"` echo $entry_icon return 0; fi # echo "$ICONMAPPING for $execname: $entry_icon" # the following paths include a user-defined variable, listing paths to search for icons # echo -n "for $temp_icon" eval doSearchLoop "${INPUTICONFORMATS}" \ $USER_ICONPATHS \ "$FB_ICONDIR" \ "/usr/share/${execname%% *}" \ ${OTHER_ICONPATHS} } searchForDesktop() { # remove '&' and everything after it entry_exec="${1%%&*}" entry_desktop="$2" $dnlamVERBOSE "searchForDesktop \"$entry_exec\" \"$entry_desktop\"" >&2 # get the basename and parameters of entry_exec -- no path entry_exec=`removePath "${entry_exec}"` [ -z "$entry_exec" ] && { echo "Exec is NULL $1 with desktop $2"; return 1; } # remove parameters local execname execname="${entry_exec%% *}" if [ -r "$entry_desktop" ]; then grep "^.${entry_exec}.[[:space:]]*<.*/${entry_desktop}\..*>" $DESKTOPMAPPING 2>/dev/null >/dev/null if [ $? -ne 0 ]; then echo -e "\"${entry_exec}\" \t <${entry_desktop}>" >> $DESKTOPMAPPING else : echo "# mapping already exists for ${entry_exec}" >> $DESKTOPMAPPING fi else echo "# No .desktop file found for $entry_exec" >> $DESKTOPMAPPING fi } searchForIcon(){ # remove '&' and everything after it entry_exec="${1%%&*}" entry_icon="$2" $dnlamVERBOSE "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2 # get the basename and parameters of entry_exec -- no path entry_exec=`removePath "${entry_exec}"` [ -z "$entry_exec" ] && { echo "Exec is NULL $1 with icon $2"; return 1; } # search for specified icon if it does not exists if [ -n "$entry_icon" ] && [ ! "$entry_exec" = "$entry_icon" ] && [ ! -f "$entry_icon" ]; then # to search for icon in other paths, # get basename local temp_icon temp_icon="${entry_icon##*/}" # remove parameters temp_icon="${temp_icon#* }" # clear entry_icon until temp_icon is found unset entry_icon if [ ! -f "$entry_icon" ]; then entry_icon=`doIconSearch "$entry_exec" "$temp_icon"` fi fi # remove parameters local execname execname="${entry_exec%% *}" # echo "search for icon named $execname.{xpm,png,gif}" if [ ! -f "$entry_icon" ]; then entry_icon=`doIconSearch "$entry_exec" "$execname"` fi # ----------- done with search ------------ $dnlamVERBOSE "::: $entry_icon" >&2 # convert icon file, if needed if [ -f "$entry_icon" ] && [ -n "yes$ConvertIfNecessary" ]; then entry_icon=`convertIcon "$entry_icon" "$HOME/.fluxbox/icons"` $dnlamVERBOSE ":::: $entry_icon" >&2 fi # remove path to icon; just get basename local icon_base icon_base="${entry_icon##*/}" # remove extension icon_base="${icon_base%%.*}" # echo "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" if [ -f "$entry_icon" ]; then # if icon exists and entry does not already exists, add it grep "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2>/dev/null >/dev/null if [ $? -ne 0 ]; then echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING else : echo "# mapping already exists for ${entry_exec}" >> $ICONMAPPING fi else echo "# No icon file found for $entry_exec" >> $ICONMAPPING fi } toSingleLine(){ echo "$@"; } createMapping(){ $dnlamVERBOSE "# creating `date`" >> $ICONMAPPING $dnlamVERBOSE "# using desktop files in $@" >> $ICONMAPPING $dnlamVERBOSE "# searching for icons in `eval toSingleLine $OTHER_ICONPATHS`" >> $ICONMAPPING # need to determine when to use .fluxbox/icons/$execname.xpm over those listed in iconmapping $dnlamVERBOSE "createIconMapping: $@" >&2 for DIR in "$@" ; do if [ -d "$DIR" ]; then $dnlamVERBOSE "# ------- Looking in $DIR" >&2 # >> $ICONMAPPING find "$DIR" -type f -name "*.desktop" >${DESKTOPMAPPING}.tmp # this route does NOT spawn a subshell # unlike: foo | while read ... while read DESKTOP_FILE; do #echo $DESKTOP_FILE; #entry_name=`grep '^[ ]*Name=' $DESKTOP_FILE | head -n 1` #entry_name=${entry_name##*=} entry_exec=`grep '^[ ]*Exec=' "$DESKTOP_FILE" | head -n 1` entry_exec=${entry_exec##*=} entry_exec=`replaceWithinString "$entry_exec" "\""` if [ -z "$entry_exec" ]; then entry_exec=${DESKTOP_FILE%%.desktop*} fi entry_exec_nopath=`removePath ${entry_exec}` searchForDesktop "$entry_exec" "$DESKTOP_FILE" #echo -e "\"${entry_exec}\" \t <$DESKTOP_FILE>" >>${DESKTOPMAPPING} entry_icon=`getDesktopField "$DESKTOP_FILE" "Icon"` $dnlamVERBOSE "--- $entry_exec $entry_icon" >&2 case "$entry_icon" in "" | mime_empty | no_icon ) : echo "no icon for $entry_exec" ;; *) searchForIcon "$entry_exec" "$entry_icon" ;; esac done <${DESKTOPMAPPING}.tmp # safety reasons unset DESKTOP_FILE entry_name entry_exec entry_icon fi done $dnlamVERBOSE "# done `date`" >> $ICONMAPPING } lookupEntry() { srcfile="$1" shift key="$@" ##$dnlamVERBOSE "src=$srcfile key='$key'" >&2 grep "^\"${key}\"" $srcfile | head -n 1 | grep -o '<.*>' ##$dnlamVERBOSE "done lookupEntry" >&2 } lookupIcon() { local execname execname="$1" shift $dnlamVERBOSE "lookupIcon $execname..." >&2 iconString=`lookupIconRaw "${execname}"` # ok, the icon direct name didn't help, look at the .desktop file next if [ -z "${iconString}" ]; then desktopFile="`lookupDesktop "${execname}"`" desktopExec="" [ -f "${desktopFile}" ] && desktopExec="`getDesktopField "${desktopFile}" "Exec"`" $dnlamVERBOSE "lookupIcon $execname-${desktopFile}-${desktopExec}" >&2 if [ -n "${desktopExec}" -a "${desktopExec}" != "${execname}" ]; then iconString=`lookupIconRaw "${desktopExec}"` fi fi # hard-core last ditch if [ -z "$iconString" ] && [ -z "$PARSING_DESKTOP" ] ; then $dnlamVERBOSE "lookupIcon: Searching ... should only be needed for icons not gotten from *.desktop (manual-created ones): $execname" >&2 searchForIcon "$execname" "$execname" [ -n "$entry_icon" ] && iconString="<$entry_icon>" fi $dnlamVERBOSE "lookupIcon $execname, $iconString" >&2 echo $iconString } lookupIconRaw() { if [ ! -f "$ICONMAPPING" ]; then echo "!!! Icon map file not found: $ICONMAPPING" >&2 return 1 fi local execname execname="$1" shift $dnlamVERBOSE "lookupIconRaw $execname..." >&2 [ -n "$1" ] && echo "!! Ignoring extra paramters: $*" >&2 [ -z "$execname" ] && { echo "execname is NULL; cannot lookup"; return 1; } execname=`removePath "$execname"` #echo "grepping ${execname}" iconString=`lookupEntry $ICONMAPPING "${execname}"` $dnlamVERBOSE "lookupIconRaw $execname, $iconString" >&2 if [ -z "$iconString" ] ; then iconString=`lookupEntry $ICONMAPPING "${execname%% *}"` fi # [ -n "$iconString" ] && echo " Found icon for $execname: $iconString" >&2 echo $iconString } # given a desktop file, return the Exec String # getDesktopField(char* desktopFile, char* fieldname) getDesktopField() { local desktopFile="$1" local fieldname="$2" desktopFile=`replaceWithinString "${desktopFile}" "<"` desktopFile=`replaceWithinString "${desktopFile}" ">"` value="`grep '^[[:space:]]*'${fieldname}'=' "$desktopFile" | head -n 1`" value="${value#*=}" } lookupDesktop() { if [ ! -f "$DESKTOPMAPPING" ]; then echo "!!! Desktop map file not found: $DESKTOPMAPPING" >&2 return 1 fi local execname execname="$1" shift [ -n "$1" ] && echo "!! Ignoring extra paramters: $*" >&2 [ -z "$execname" ] && { echo "execname is NULL; cannot lookup"; return 1; } execname=`removePath "$execname"` #echo "grepping ${execname}" >&2 desktopString=`lookupEntry $DESKTOPMAPPING "${execname}"` $dnlamVERBOSE "lookupDesktop $execname, $desktopString" >&2 # ignore arguments if [ -z "$desktopString" ] ; then e="${execname%% *}" desktopString=`lookupEntry $DESKTOPMAPPING "${e}"` fi # ignore extensions and arguments # if [ -z "$desktopString" ] ; then e="${execname%% *}" e="${e%.*}" desktopString=`lookupEntry $DESKTOPMAPPING "${e}"` fi $dnlamVERBOSE "lookupDesktop $execname, $desktopString" >&2 # [ -n "$desktopString" ] && echo " Found icon for $execname: $desktopString" >&2 echo $desktopString } append() { if [ -z "${INSTALL}" ]; then $dnlamVERBOSE "append: $*" >&2 local iconString iconString="`echo $* | grep -o '<.*>'`" # echo "iconString=$iconString" >&2 if [ -z "$iconString" ] && [ -z "$NO_ICON" ]; then echo -n " $* " >> ${MENUFILENAME} # get the program name between '{}' from parameters local execname execname="$*" execname=${execname#*\{} execname=${execname%%\}*} $dnlamVERBOSE "execname=$execname" >&2 # if execname hasn't changed from original $*, then no '{...}' was given if [ ! "$execname" = "$*" ]; then case "$execname" in $DEFAULT_TERM*) # remove quotes execname=`replaceWithinString "$execname" "\""` # remove "$DEFAULT_TERM -e " # needed in case calling another program (e.g., vi) via "xterm -e" execname=${execname##*$DEFAULT_TERM -e } ;; esac # lookup execname in icon map file iconString=`lookupIcon "$execname"` #[ -n "$iconString" ] || echo "No icon found for $execname" fi echo "${iconString}" >> ${MENUFILENAME} else echo " $*" >> ${MENUFILENAME} fi else echo " $*" >> ${MENUFILENAME} fi $dnlamVERBOSE doneAppend >&2 } append_menu() { echo "$*" >> ${MENUFILENAME} } append_submenu() { [ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates append_menu "[submenu] ($1)" } append_menu_end() { append_menu '[end]' [ "${REMOVE}" ] && echo >> ${MENUFILENAME} # only an empty line in templates } menu_entry() { if [ -f "$1" ]; then entry_name=`getDesktopField "$1" "Name"` entry_exec=`getDesktopField "$1" "Exec"` if [ -z "$entry_exec" ]; then entry_exec="`removePath ${1}`" entry_exec="${entry_exec%.desktop}" $dnlamVERBOSE echo "Exec not found in $1, using $entry_exec" >&2 fi if [ -n "$entry_name" -a -n "$entry_exec" ]; then append "[exec] ($entry_name) {$entry_exec}" fi fi } menu_entry_dir() { for b in "$*"/*.desktop; do menu_entry "${b}" done } menu_entry_dircheck() { if [ -d "$*" ]; then menu_entry_dir "$*" fi } # recursively build a menu from the listed directories # the dirs are merged recurse_dir_menu () { ls "$@"/ 2>/dev/null | sort | uniq | while read name; do for dir in "$@"; do if [ -n "$name" -a -d "$dir/$name" ]; then # recurse append_submenu "${name}" # unfortunately, this is messy since we can't easily expand # them all. Only allow for 3 atm. Add more if needed recurse_dir_menu ${1:+"$1/$name"} ${2:+"$2/$name"} ${3:+"$3/$name"} append_menu_end break; # found one, it'll pick up all the rest fi # ignore it if it is a file, since menu_entry_dir picks those up done done # Make entries for current dir after all submenus for dir in "$@"; do menu_entry_dircheck "${dir}" done } # for a given name, look for $1.desktop OR # $1 in the Exec section of all desktop files. gui_build() { local execname desktopString desktopFile execname="$1" desktopString="`lookupDesktop "$execname"`" desktopFile="" if [ -n "${desktopString}" ]; then desktopFile="${desktopString/<}" desktopFile="${desktopFile%>}" fi if [ -n "${desktopFile}" -a -r "${desktopFile}" ]; then #echo "gui_build[y]=${desktopFile}" >&2 menu_entry "${desktopFile}" else #echo "gui_build[n]=${desktopString}" >&2 append "[exec] ($1) {$1}" fi } # $1 is cli program to run cli_build() { append "[exec] ($1) {${DEFAULT_TERM} -e $1}" } normal_find() { while [ "$1" ]; do find_it $1 gui_build $1 shift done } cli_find() { while [ "$1" ]; do find_it $1 cli_build $1 shift done } clean_up() { #[ -f "$ICONMAPPING" ] && rm -f "$ICONMAPPING" #[ -f "$DESKTOPMAPPING" ] && rm -f "$DESKTOPMAPPING" [ -f "$DESKTOPMAPPING.tmp" ] && rm -f "$DESKTOPMAPPING.tmp" # Some magic to clean up empty menus rm -f ${MENUFILENAME}.tmp touch ${MENUFILENAME}.tmp counter=10 # prevent looping in odd circumstances until [ $counter -lt 1 ] || \ cmp ${MENUFILENAME} ${MENUFILENAME}.tmp 2>&1 > /dev/null; do [ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME} counter=`expr $counter - 1` grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{ n N /^\[submenu].*\n\[end]/d }"|sed -e "/^\[submenu].*/{ N /^\[submenu].*\n\[end]/d }" > ${MENUFILENAME}.tmp done rm -f ${MENUFILENAME}.tmp } # menu defaults (if translation forget to set one of them) ABOUTITEM='About' BACKGROUNDMENU='Backgrounds' BACKGROUNDMENUTITLE='Set the Background' BROWSERMENU='Browsers' CDBURNING='CD Burning' CONFIGUREMENU='Configure' DEVELOPMENTMENU='Development' DEVELOPMENTDEBUGGERSMENU='Debugging' DEVELOPMENTVCSMENU='Version Control' EDITORMENU='Editors' EDUCATIONMENU='Education' EXITITEM='Exit' FBSETTINGSMENU='fluxbox menu' FILEUTILSMENU='File utils' FLUXBOXCOMMAND='Fluxbox Command' GAMESACTIONMENU='Action' GAMESARCADEMENU='Arcade' GAMESBOARDMENU='Board' GAMESCARDMENU='Card' GAMESEMULATIONMENU='Emulation' GAMESFPSMENU='FPS' # First Person Shooter GAMESMENU='Games' GAMESPUZZLEMENU='Puzzle' GAMESRPGMENU='RPG' # Role Playing Game GAMESSPORTMENU='Sport' GAMESSTRATEGYMENU='Strategy' GNOMEMENUTEXT='Gnome-menus' GRAPHICMENU='Graphics' KDEMENUTEXT='KDE-menus' LOCKSCREEN='Lock screen' MISCMENU='Misc' MULTIMEDIAMENU='Multimedia' MUSICMENU='Audio' NETMENU='Net' NEWS='News' OFFICEMENU='Office' OPENOFFICEMENU='OpenOffice' RANDOMBACKGROUND='Random Background' REGENERATEMENU='Regen Menu' RELOADITEM='Reload config' RESTARTITEM='Restart' RUNCOMMAND='Run' SCREENSHOT='Screenshot' STYLEMENUTITLE='Choose a style...' SYSTEMSTYLES='System Styles' TERMINALMENU='Terminals' TOOLS='Tools' USERSTYLES='User Styles' UTILITIES='Utilities' VIDEOMENU='Video' WINDOWMANAGERS='Window Managers' WINDOWNAME='Window name' WORKSPACEMENU='Workspace List' XUTILSMENU='X-utils' # Check translation case ${LC_ALL} in ru_RU*) #Russian locales # Ah my Russian hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU='ïÂÏÉ' BACKGROUNDMENUTITLE='õÓÔÁÎÏ×ÉÔØ ÏÂÏÉ' BROWSERMENU='âÒÁÕÚÅÒÙ' CONFIGUREMENU='îÁÓÔÒÏÊËÁ' EDITORMENU='òÅÄÁËÔÏÒÙ' EXITITEM='÷ÙÊÔÉ' FBSETTINGSMENU='FB-ÎÁÓÔÒÏÊËÉ' FILEUTILSMENU='æÁÊÌÏ×ÙÅ ÕÔÉÌÉÔÙ' FLUXBOXCOMMAND='÷ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ' GAMESMENU='éÇÒÙ' GNOMEMENUTEXT='Gnome-ÍÅÎÀ' GRAPHICMENU='çÒÁÆÉËÁ' KDEMENUTEXT='KDE-ÍÅÎÀ' LOCKSCREEN='úÁÂÌÏËÉÒÏ×ÁÔØ ÜËÒÁÎ' MISCMENU='ðÒÏÞÅÅ' MUSICMENU='ú×ÕË' NETMENU='óÅÔØ' OFFICEMENU='ïÆÉÓÎÙÅ ÐÒÉÌÏÖÅÎÉÑ' RANDOMBACKGROUND='óÌÕÞÁÊÎÙÅ ÏÂÏÉ' REGENERATEMENU='óÏÚÄÁÔØ ÍÅÎÀ ÚÁÎÏ×Ï' RELOADITEM='ðÅÒÅÎÁÓÔÒÏÉÔØ' RESTARTITEM='ðÅÒÅÚÁÐÕÓÔÉÔØ' RUNCOMMAND='÷ÙÐÏÌÎÉÔØ' SCREENSHOT='óÎÉÍÏË ÜËÒÁÎÁ' STYLEMENUTITLE='÷ÙÂÅÒÉÔÅ ÓÔÉÌØ' SYSTEMSTYLES='óÉÓÔÅÍÎÙÅ ÓÔÉÌÉ' TERMINALMENU='ôÅÒÍÉÎÁÌÙ' TOOLS='õÔÉÌÉÔÙ' USERSTYLES='ðÏÌØÚÏ×ÁÔÅÌØÓËÉÅ ÓÔÉÌÉ' WINDOWMANAGERS='íÅÎÅÄÖÅÒÙ ÏËÏÎ' WINDOWNAME='éÍÑ ÏËÎÁ' WORKSPACEMENU='òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á' XUTILSMENU='X-ÕÔÉÌÉÔÙ' ;; cs_CZ.ISO*) # Czech locales (ISO-8859-2 encodings) ABOUTITEM='O programu...' BACKGROUNDMENU='Pozadí' BACKGROUNDMENUTITLE='Nastavení pozadí' BROWSERMENU='Prohlí¾eèe' CONFIGUREMENU='Konfigurace' EDITORMENU='Editory' EXITITEM='Ukonèit' FBSETTINGSMENU='Fluxbox Menu' FILEUTILSMENU='Souborové utility' FLUXBOXCOMMAND='Pøíkaz Fluxboxu' GAMESMENU='Hry' GNOMEMENUTEXT='Gnome-menu' GRAPHICMENU='Grafika' KDEMENUTEXT='KDE-menu' LOCKSCREEN='Zamknout obrazovku' MISCMENU='Rùzné' MULTIMEDIAMENU='Multimédia' MUSICMENU='Audio' NETMENU='Internet' NEWS='News' OFFICEMENU='Kanceláø' RANDOMBACKGROUND='Náhodné pozadí' REGENERATEMENU='Obnovení menu' RELOADITEM='Obnovení konfigurace' RESTARTITEM='Restart' RUNCOMMAND='Spustit program...' SCREENSHOT='Screenshot' STYLEMENUTITLE='Volba stylu...' SYSTEMSTYLES='Systémové styly' TERMINALMENU='Terminály' TOOLS='Nástroje' USERSTYLES='U¾ivatelské styly' VIDEOMENU='Video' WINDOWMANAGERS='Okenní mana¾ery' WINDOWNAME='Jméno okna' WORKSPACEMENU='Seznam ploch' XUTILSMENU='X-utility' ;; de_DE*) # german locales BACKGROUNDMENU='Hintergrundbilder' BACKGROUNDMENUTITLE='Hintergrundbild setzen' BROWSERMENU='Internet-Browser' CONFIGUREMENU='Einstellungen' EDITORMENU='Editoren' EXITITEM='Beenden' FBSETTINGSMENU='Fluxbox-Einstellungen' FILEUTILSMENU='Datei-Utilities' FLUXBOXCOMMAND='Fluxbox Befehl' GAMESMENU='Spiele' GNOMEMENUTEXT='Gnome-Menues' GRAPHICMENU='Grafik' KDEMENUTEXT='Kde-Menues' LOCKSCREEN='Bildschirmsperre' MISCMENU='Sonstiges' MUSICMENU='Musik' NETMENU='Netzwerk' OFFICEMENU='Bueroprogramme' RANDOMBACKGROUND='Zufaelliger Hintergrund' REGENERATEMENU='Menu-Regeneration' RELOADITEM='Konfiguration neu laden' RESTARTITEM='Neustarten' RUNCOMMAND='Ausführen' SCREENSHOT='Bildschirmfoto' STYLEMENUTITLE='Einen Stil auswaehlen...' SYSTEMSTYLES='Systemweite Stile' TERMINALMENU='Terminals' TOOLS='Helfer' USERSTYLES='Eigene Stile' WINDOWMANAGERS='Window Manager' WINDOWNAME='Window Name' WORKSPACEMENU='Arbeitsflaechenliste' XUTILSMENU='X-Anwendungen' ;; sv_SE*) #Swedish locales # Ah my Swedish hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU='Bakgrunder' BACKGROUNDMENUTITLE='Sätt bakgrund' BROWSERMENU='Webbläsare' CONFIGUREMENU='Konfiguration' EDITORMENU='Editorer' EXITITEM='Avsluta' FBSETTINGSMENU='FB-inställningar' FILEUTILSMENU='Filverktyg' FLUXBOXCOMMAND='Fluxbox kommando' GAMESMENU='Spel' GNOMEMENUTEXT='Gnome-menyer' GRAPHICMENU='Grafik' KDEMENUTEXT='KDE-menyer' LOCKSCREEN='Lås skärm' MISCMENU='Blandat' MULTIMEDIAMENU='Multimedia' MUSICMENU='Musik' NETMENU='Internet' OFFICEMENU='Office' RANDOMBACKGROUND='Slumpmässig bakgrund' REGENERATEMENU='Generera meny' RELOADITEM='Ladda om konfig' RESTARTITEM='Starta om' RUNCOMMAND='Kör' SCREENSHOT='Skärmdump' STYLEMENUTITLE='Välj en stil' SYSTEMSTYLES='Stiler' TERMINALMENU='Terminaler' TOOLS='Verktyg' USERSTYLES='Stiler' VIDEOMENU='Video' WINDOWMANAGERS='Fönsterhanterare' WINDOWNAME='Fönsternamn' WORKSPACEMENU='Arbetsytor' XUTILSMENU='X-program' ;; nl_*) #Nederlandse locales BACKGROUNDMENU='Achtergrond' BACKGROUNDMENUTITLE='Kies een achtergrond' BROWSERMENU='Browsers' CONFIGUREMENU='Instellingen' EDITORMENU='Editors' EXITITEM='Afsluiten' FBSETTINGSMENU='FB-Instellingen' FILEUTILSMENU='Verkenners' FLUXBOXCOMMAND='Fluxbox Commando' GAMESMENU='Spelletjes' GNOMEMENUTEXT='Gnome-menu' GRAPHICMENU='Grafisch' KDEMENUTEXT='KDE-menu' LOCKSCREEN='Scherm op slot' MISCMENU='Onregelmatig' MUSICMENU='Muziek' NETMENU='Internet' OFFICEMENU='Office' RANDOMBACKGROUND='Willekeurige Achtergrond' REGENERATEMENU='Nieuw Menu' RELOADITEM='Vernieuw instellingen' RESTARTITEM='Herstart' RUNCOMMAND='Voer uit' SCREENSHOT='Schermafdruk' STYLEMENUTITLE='Kies een stijl' SYSTEMSTYLES='Systeem Stijlen' TERMINALMENU='Terminals' TOOLS='Gereedschap' USERSTYLES='Gebruikers Stijlen' WINDOWMANAGERS='Venster Managers' WINDOWNAME='Venster Naam' WORKSPACEMENU='Werkveld menu' XUTILSMENU='X-Gereedschap' ;; fi_FI*) #Finnish locales BACKGROUNDMENU='Taustakuvat' BACKGROUNDMENUTITLE='Määritä taustakuva' BROWSERMENU='Selaimet' CONFIGUREMENU='Asetukset' EDITORMENU='Editorit' EXITITEM='Lopeta' FBSETTINGSMENU='Fluxboxin säädöt' FILEUTILSMENU='Tiedostotyökalut' FLUXBOXCOMMAND='Komentorivi' GAMESMENU='Pelit' GNOMEMENUTEXT='Gnomen valikot' GRAPHICMENU='Grafiikka' KDEMENUTEXT='KDE:n valikot' LOCKSCREEN='Lukitse työpöytä' MISCMENU='Sekalaista' MUSICMENU='Musiikki' NETMENU='Verkko' OFFICEMENU='Toimistotyökalut' RANDOMBACKGROUND='Satunnainen taustakuva' REGENERATEMENU='Päivitä valikko' RELOADITEM='Päivitä' RESTARTITEM='Käynnistä uudelleen' RUNCOMMAND='Suorita' SCREENSHOT='Kuvakaappaus' STYLEMENUTITLE='Valitse tyyli' SYSTEMSTYLES='Järjestelmän tyylit' TERMINALMENU='Terminaalit' TOOLS='Työkalut' USERSTYLES='Käyttäjän tyylit' WINDOWMANAGERS='Ikkunanhallintaohjelmat' WINDOWNAME='Ikkunan nimi' WORKSPACEMENU='Työalueet' XUTILSMENU='X-Ohjelmat' ;; ja_JP*) #Japanese locales # Ah my Japanese hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU='ÇØ·Ê' BACKGROUNDMENUTITLE='ÇطʤÎÀßÄê' BROWSERMENU='¥Ö¥é¥¦¥¶' CONFIGUREMENU='ÀßÄê' EDITORMENU='¥¨¥Ç¥£¥¿' EXITITEM='½ªÎ»' FBSETTINGSMENU='Fluxbox¤ÎÀßÄê' FILEUTILSMENU='¥Õ¥¡¥¤¥ëÁàºî' FLUXBOXCOMMAND='Fluxbox¥³¥Þ¥ó¥É' GAMESMENU='¥²¡¼¥à' GNOMEMENUTEXT='Gnome¥á¥Ë¥å¡¼' GRAPHICMENU='²èÁü' KDEMENUTEXT='KDE¥á¥Ë¥å¡¼' LOCKSCREEN='¥¹¥¯¥ê¡¼¥ó¥í¥Ã¥¯' MISCMENU='¤¤¤í¤¤¤í' MUSICMENU='²»³Ú' NETMENU='¥Í¥Ã¥È¥ï¡¼¥¯' OFFICEMENU='¥ª¥Õ¥£¥¹(Office)' RANDOMBACKGROUND='ÇØ·Ê(¥é¥ó¥À¥à)' REGENERATEMENU='¥á¥Ë¥å¡¼ºÆ¹½À®' RELOADITEM='ºÆÆɤ߹þ¤ß' RESTARTITEM='ºÆµ¯Æ°' RUNCOMMAND='¥³¥Þ¥ó¥É¤Î¼Â¹Ô' SCREENSHOT='¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È' STYLEMENUTITLE='¥¹¥¿¥¤¥ëÁªÂò...' SYSTEMSTYLES='¥¹¥¿¥¤¥ë' TERMINALMENU='¥¿¡¼¥ß¥Ê¥ë' TOOLS='¥Ä¡¼¥ë' USERSTYLES='¥¹¥¿¥¤¥ë' WINDOWMANAGERS='¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã' WINDOWNAME='¥¦¥£¥ó¥É¥¦Ì¾' WORKSPACEMENU='¥ï¡¼¥¯¥¹¥Ú¡¼¥¹' XUTILSMENU='X¥æ¡¼¥Æ¥£¥ê¥Æ¥£' ;; fr_FR*) # french locales # Ah my french hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU="Fond d'écran" BACKGROUNDMENUTITLE="Changer le fond d'écran" BROWSERMENU='Navigateurs' CONFIGUREMENU='Configurer' EDITORMENU='Editeurs' EXITITEM='Sortir' FBSETTINGSMENU='Configurer Fluxbox' FILEUTILSMENU='Outils fichiers' FLUXBOXCOMMAND='Commande Fluxbox' GAMESMENU='Jeux' GNOMEMENUTEXT='Menus Gnome' GRAPHICMENU='Graphisme' KDEMENUTEXT='Menus KDE' LOCKSCREEN="Verouiller l'écran" MISCMENU='Divers' MUSICMENU='Musique' NETMENU='Réseau' OFFICEMENU='Bureautique' RANDOMBACKGROUND="Fond d'écran aléatoire" REGENERATEMENU='Régénérer le menu' RELOADITEM='Recharger la configuration' RESTARTITEM='Redémarrer Fluxbox' RUNCOMMAND='Run' SCREENSHOT="Capture d'écran" STYLEMENUTITLE='Choisir un style...' SYSTEMSTYLES='Styles Systeme' TERMINALMENU='Terminaux' TOOLS='Outils' USERSTYLES='Styles Utilisateur' WINDOWMANAGERS='Gestionnaires de fenêtres' WINDOWNAME='Nom de la fenetre' WORKSPACEMENU='Liste des bureaux' XUTILSMENU='Outils X' ;; it_IT*) # italian locales BACKGROUNDMENU='Sfondi' BACKGROUNDMENUTITLE='Imposta lo sfondo' BROWSERMENU='Browsers' CONFIGUREMENU='Configurazione' EDITORMENU='Editori' EXITITEM='Esci' FBSETTINGSMENU='Preferenze' FILEUTILSMENU='Utilità' FLUXBOXCOMMAND='Comando Fluxbox' GAMESMENU='Giochi' GNOMEMENUTEXT='Gnome' GRAPHICMENU='Grafica' KDEMENUTEXT='KDE' LOCKSCREEN='Blocca lo schermo' MISCMENU='Varie' MUSICMENU='Musica' NETMENU='Internet' OFFICEMENU='Office' RANDOMBACKGROUND='Sfondo casuale' REGENERATEMENU='Rigenera il menu' RELOADITEM='Rileggi la configurazione' RESTARTITEM='Riavvia' RUNCOMMAND='Esegui' SCREENSHOT='Schermata' STYLEMENUTITLE='Scegli uno stile' SYSTEMSTYLES='Stile' TERMINALMENU='Terminali' TOOLS='Attrezzi' USERSTYLES='Stile' WINDOWMANAGERS='Gestori finestre' WINDOWNAME='Nome della finestra' WORKSPACEMENU='Aree di lavoro' XUTILSMENU='Utilità X' ;; ro_RO*) # Romanian locales # Ah my Romanian hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU='Fundaluri' BACKGROUNDMENUTITLE='Alege fundalul' BROWSERMENU='Navigatoare' CONFIGUREMENU='Configurare' EDITORMENU='Editoare' EXITITEM='Iesire' FBSETTINGSMENU='Meniul Fluxbox' FILEUTILSMENU='Utilitare de fisier' FLUXBOXCOMMAND='Comanda Fluxbox' GAMESMENU='Jocuri' GNOMEMENUTEXT='Meniu Gnome' GRAPHICMENU='Grafica' KDEMENUTEXT='Meniu KDE' LOCKSCREEN='Incuie ecranul' MISCMENU='Diverse' MULTIMEDIAMENU='Multimedia' MUSICMENU='Muzica' NETMENU='Retea' OFFICEMENU='Office' RANDOMBACKGROUND='Fundal aleator' REGENERATEMENU='Regenereaza meniul' RELOADITEM='Reincarca configuratia' RESTARTITEM='Restart' RUNCOMMAND='Lanseaza' SCREENSHOT='Captura ecran' STYLEMENUTITLE='Alege un stil...' SYSTEMSTYLES='Stiluri sistem' TERMINALMENU='Terminale' TOOLS='Unelte' USERSTYLES='Stiluri utilizator' WINDOWMANAGERS='WindowManagers' WINDOWNAME='Nume fereastra' WORKSPACEMENU='Lista workspace-uri' XUTILSMENU='Utilitare X' ;; es_ES*) # spanish locales # Ah my Spanish hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENUTITLE='Seleccionar Fondo' BROWSERMENU='Navegadores' CONFIGUREMENU='Configurar' EDITORMENU='Editores' EXITITEM='Salir' FBSETTINGSMENU='Menú fluxbox' GAMESMENU='Juegos' GNOMEMENUTEXT='Menús Gnome' GRAPHICMENU='Gráficos' KDEMENUTEXT='Menús KDE' MISCMENU='Varios' MULTIMEDIAMENU='Multimedia' MUSICMENU='Música' NETMENU='Red' OFFICEMENU='Oficina' RELOADITEM='Reconfigurar' RESTARTITEM='Reiniciar' STYLEMENUTITLE='Escoge un Estilo...' SYSTEMSTYLES='Estilos del Sistema' TERMINALMENU='Terminales' USERSTYLES='Estilos del Usuario' WORKSPACEMENU='Lista de Escritorios' XUTILSMENU='Utilidades X' BACKGROUNDMENU='Fondos' FILEUTILSMENU='Utilidades' FLUXBOXCOMMAND='Comandos de Fluxbox' LOCKSCREEN='Bloquear Pantalla' RANDOMBACKGROUND='Fondo Aleatoreo' REGENERATEMENU='Regenerar Menú' RUNCOMMAND='Ejecutar' SCREENSHOT='Captura de Pantalla' TOOLS='Herramienta' WINDOWMANAGERS='Gestores de Ventanas' WINDOWNAME='Nombre de Ventana' ;; pl_PL*) # Polish locales # Ah my Russian hero. Please help me update the translation # $ cp fluxbox-generate-menu.in fluxbox-generate-menu.in.orig # $ $EDITOR fluxbox-generate-menu.in # $ diff u fluxbox-generate-menu.in.orig fluxbox-generate-menu.in > fbgm.diff # email fbgm.diff to han@mijncomputer.nl BACKGROUNDMENU='Tapety' BACKGROUNDMENUTITLE='Ustaw tapetê' BROWSERMENU='Przegl±darki' CONFIGUREMENU='Konfiguracja' EDITORMENU='Edytory' EXITITEM='Wyj¶cie' FBSETTINGSMENU='Menu Fluxbox' FILEUTILSMENU='Narzêdzia do plików' FLUXBOXCOMMAND='Polecenia Fluxbox' GAMESMENU='Gry' GNOMEMENUTEXT='Menu Gnome' GRAPHICMENU='Grafika' KDEMENUTEXT='Menu KDE' LOCKSCREEN='Zablokuj ekran' MISCMENU='Ró¿ne' MULTIMEDIAMENU='Multimedia' MUSICMENU='Muzyka' NETMENU='Sieæ' OFFICEMENU='Aplikacje biurowe' RANDOMBACKGROUND='Losowa tapeta' REGENERATEMENU='Wygeneruj menu' RELOADITEM='Od¶wie¿ konfiguracjê' RESTARTITEM='Restartuj' RUNCOMMAND='Uruchom...' SCREENSHOT='Zrzut ekranu' STYLEMENUTITLE='Wybierz styl...' SYSTEMSTYLES='Style systemowe' TERMINALMENU='Terminale' TOOLS='Narzêdzia' USERSTYLES='Style u¿ytkownika' WINDOWMANAGERS='Menad¿ery okien' WINDOWNAME='Nazwy okien' WORKSPACEMENU='Lista pulpitów' XUTILSMENU='Narzêdzia X' ;; pt_PT*) # Portuguese locales BACKGROUNDMENU='Imagens de Fundo' BACKGROUNDMENUTITLE='Definir Imagem de Fundo' BROWSERMENU='Browsers' CONFIGUREMENU='Configuração' EDITORMENU='Editores' EXITITEM='Sair' FBSETTINGSMENU='Menu Fluxbox' FILEUTILSMENU='Utilitários de Ficheiros' FLUXBOXCOMMAND='Comando Fluxbox' GAMESMENU='Jogos' GNOMEMENUTEXT='Menu Gnome' GRAPHICMENU='Gráficos' KDEMENUTEXT='Menu KDE' LOCKSCREEN='Trancar Ecrã' MISCMENU='Misc.' MULTIMEDIAMENU='Multimédia' MUSICMENU='Áudio' NETMENU='Rede' OFFICEMENU='Escritório' RANDOMBACKGROUND='Imagem Aleatória' REGENERATEMENU='Regenerar Menu' RELOADITEM='Recarregar configuração' RESTARTITEM='Reiniciar' RUNCOMMAND='Executar' SCREENSHOT='Capturar Ecrã' STYLEMENUTITLE='Escolha um estilo...' SYSTEMSTYLES='Estilos do Sistema' TERMINALMENU='Terminais' TOOLS='Ferramentas' USERSTYLES='Estilos do Utilizador' VIDEOMENU='Vídeo' WINDOWMANAGERS='Gestores de Janelas' WINDOWNAME='Nome da Janela' WORKSPACEMENU='Lista de Áreas de Trabalho' XUTILSMENU='Utilitários X' ;; *) ;; esac # Set Defaults MENUFILENAME="${MENUFILENAME:=${HOME}/.fluxbox/menu}" MENUTITLE="${MENUTITLE:=Fluxbox}" HOMEPAGE="${HOMEPAGE:=fluxbox.org}" USERMENU="${USERMENU:=${HOME}/.fluxbox/usermenu}" # Read the menuconfig file if it exists or else create it. # But not during install time, use envvar for sun if [ ! "${INSTALL}" = Yes ]; then if [ -r ${HOME}/.fluxbox/menuconfig ]; then . ${HOME}/.fluxbox/menuconfig else if [ ! "$WHOAMI" = root ]; then # this is only for users. if touch ${HOME}/.fluxbox/menuconfig; then cat << EOF > ${HOME}/.fluxbox/menuconfig # This file is read by fluxbox-generate_menu. If you don't like a # default you can change it here. Don't forget to remove the # in front # of the line. # Your favourite terminal. Put the command in quotes if you want to use # options. Put a backslash in before odd chars # MY_TERM='Eterm --tint \#123456' # MY_TERM='aterm -tint `random_color`' # Your favourite browser. You can also specify options. # MY_BROWSER=mozilla # Name of the outputfile # MENUFILENAME=${HOME}/.fluxbox/menu # MENUTITLE=\`fluxbox -version|cut -d " " -f-2\` # standard url for console-browsers # HOMEPAGE=fluxbox.org # location with your own menu-entries # USERMENU=~/.fluxbox/usermenu # Put the launcher you would like to use here # LAUNCHER=fbrun # LAUNCHER=fbgm # Options for fbrun # FBRUNOPTIONS='-font 10x20 -fg grey -bg black -title run' # --- PREFIX'es # These are prefixes; So if fluxbox is installed in /usr/bin/fluxbox # your prefix is: /usr # fluxbox-generate already looks in /usr/X11R6, /usr, /usr/local and /opt so # there should be no need to specify them. # # PREFIX=/usr # GNOME_PREFIX=/opt/gnome # KDE_PREFIX=/opt/kde # Sepparate the list of background-dirs with semicolumns ':' # BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:/usr/share/fluxbox/backgrounds/:/usr/share/wallpapers" # --- Boolean variables. # Setting a variable to ``no'' won't help. Comment them out if you don't # want them. Setting are overruled by the command-line options. # Include all backgrounds in your backgrounds-directory # BACKGROUNDMENUITEM=yes # Include kde-menus # KDEMENU=yes # Include gnome-menus # GNOMEMENU=yes # Don't cleanup the menu # REMOVE=no EOF else echo "Warning: I couldn't create ${HOME}/.fluxbox/menuconfig" >&2 fi fi fi fi testoption() { if [ -z "$3" -o -n "`echo $3|grep '^-'`" ]; then echo "Error: The option $2 requires an argument." >&2 exit 1 fi case $1 in ex) # executable if find_it "$3"; then : else echo "Error: The option $2 needs an executable as argument, and \`$3' is not." >&2 fi ;; di) # directory if [ -d "$3" ]; then : else echo "Error: The option $2 needs a directory as argument, and \`$3' is not." >&2 fi ;; fl) # file if [ -r "$3" ]; then : else echo "Error: The option $2 needs a readable file as argument, and \`$3' is not." >&2 fi ;; sk) # skip : ;; esac } # Get options. OUTPUTICONSIZE="16x16" INPUTICONSIZE="scalable,16x16" while [ $# -gt 0 ]; do case "$1" in -B) BACKGROUNDMENUITEM=yes; shift;; -k) KDEMENU=yes; shift;; -g) GNOMEMENU=yes; shift;; -in) NO_ICON=yes; shift;; -is) OTHER_ICONPATHS=" /usr{,/local}/share{,/xclass}/{icons,pixmaps} /usr{,/local}/share/icons/mini /usr{,/local}/{,X11R6/}share/icons/{default.kde,hicolor}/{$INPUTICONSIZE}/* /usr/kde/[234]*/share/icons/{default.kde,hicolor}/{$INPUTICONSIZE}/* " shift;; -ds) OTHER_DESKTOP_PATHS=" /usr/share/mimelnk /usr/share/applications /usr/share/xsessions /usr/share/services " # /usr/share/apps \ shift;; -i) USER_ICONPATHS=${2}; #needs testing for aPath in $2; do testoption di $1 $aPath; done shift 2;; -d) USER_DESKTOP_PATHS=${2}; #needs testing for aPath in $2; do testoption di $1 $aPath; done shift 2;; -t) MY_TERM=${2}; testoption ex $1 $2; shift 2;; -b) MY_BROWSER=${2}; testoption ex $1 $2; shift 2;; -o) MENUFILENAME=${2}; shift 2; CHECKINIT=NO ;; -p) PREFIX=${2}; testoption di $1 $2; shift 2;; -n) GNOME_PREFIX=${2}; testoption di $1 $2; shift 2;; -q) KDE_PREFIX=${2}; testoption di $1 $2; shift 2;; -m) MENUTITLE=${2}; testoption sk $1 $2; shift 2;; -w) HOMEPAGE=${2}; testoption sk $1 $2; shift 2;; -u) USERMENU=${2}; testoption fl $1 $2; shift 2;; -r) REMOVE=no; shift;; -h) display_help ; exit 0 ;; -a) display_authors ; exit 0 ;; --*) echo "fluxbox-generate_menu doesn't recognize -- gnu-longopts." echo 'Use fluxbox-generate_menu -h for a long help message.' display_usage exit 1 ;; -[a-zA-Z][a-zA-Z]*) # split concatenated single-letter options apart FIRST="$1"; shift set -- `echo "$FIRST" | sed 's/^-\(.\)\(.*\)/-\1 -\2/'` "$@" ;; -*) echo 1>&2 "fluxbox-generate_menu: unrecognized option "\`"$1'" display_usage exit 1 ;; *) break ;; esac done # Check defaults # Can we actually create ${MENUFILENAME} touch ${MENUFILENAME} 2> /dev/null if [ $? -ne 0 ]; then echo "Fatal error: can't create or write to $MENUFILENAME" >&2 exit 1 fi # backup menu if [ -w "${MENUFILENAME}" ]; then if [ -f ${MENUFILENAME}.firstbak ]; then cp ${MENUFILENAME} ${MENUFILENAME}.firstbak fi if [ -s "${MENUFILENAME}" ]; then mv ${MENUFILENAME} ${MENUFILENAME}.bak fi fi # prefix PREFIX="${PREFIX:=/usr}" if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then PREFIX=`which fluxbox | sed 's,/bin/fluxbox$,,'` fi # gnome prefix for GNOME_PREFIX in "${GNOME_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; do if [ -n "${GNOME_PREFIX}" -a -d "$GNOME_PREFIX/share/gnome" ]; then break; fi done # Will remain $PREFIX if all else fails # kde prefix for KDE_PREFIX in "${KDE_PREFIX}" /usr/local /usr/kde/[23]* /usr/X11R6 /usr /opt "${PREFIX}"; do if [ -n "${KDE_PREFIX}" -a -d "$KDE_PREFIX/share/applnk" ]; then break; fi done $dnlamVERBOSE echo "KDE_PREFIX=$KDE_PREFIX" >&2 if [ -z "${INSTALL}" ] && [ -z "${NO_ICON}" ]; then # [ -z "$dnlamVERBOSE" ] && dnlamVERBOSE=": echo" # for debugging FB_ICONDIR="$HOME/.fluxbox/icons" [ -d "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR" ICONMAPPING="$HOME/.fluxbox/iconmapping" DESKTOPMAPPING="$HOME/.fluxbox/desktopmapping" if [ "$GNOMEMENU" ] ; then OTHER_DESKTOP_PATHS="\"$HOME/.gnome/apps\" \"${GNOME_PREFIX}/share/gnome/apps\" $OTHER_DESKTOP_PATHS" #[ "OTHER_ICONPATHS" ] && OTHER_ICONPATHS= fi if [ "$KDEMENU" ] ; then OTHER_DESKTOP_PATHS="\"$HOME/.kde/share/applnk\" \"${KDE_PREFIX}/share/applnk\" $OTHER_DESKTOP_PATHS" [ "OTHER_ICONPATHS" ] && OTHER_ICONPATHS="\"$HOME\"/.kde/share/icons/{,*} $OTHER_ICONPATHS" fi [ "$GNOMEMENU$KDEMENU" ] && OTHER_DESKTOP_PATHS="\"$ETCAPPLNK\" $OTHER_DESKTOP_PATHS" # kde/share/applications/{,kde} contains lots of .desktop files that we should use for titles/icons OTHER_DESKTOP_PATHS="\"${KDE_PREFIX}/share/applications\" $OTHER_DESKTOP_PATHS" checkDirs(){ #echo checkDirs: $* >&2 local CHECKED_DIRS="" for DIR in "$@"; do if [ -d "$DIR" ]; then # todo: should check if there are duplicates CHECKED_DIRS="$CHECKED_DIRS \"$DIR\"" fi done #echo checkDirs - $CHECKED_DIRS >&2 echo $CHECKED_DIRS } OTHER_ICONPATHS=`eval checkDirs $OTHER_ICONPATHS` OTHER_DESKTOP_PATHS=`eval checkDirs $OTHER_DESKTOP_PATHS` $dnlamVERBOSE "Using USER_DESKTOP_PATHS=\"$USER_DESKTOP_PATHS\" and USER_ICONPATHS=\"$USER_ICONPATHS\"" >&2 $dnlamVERBOSE "Using OTHER_ICONPATHS=$OTHER_ICONPATHS" >&2 $dnlamVERBOSE "Using OTHER_DESKTOP_PATHS=$OTHER_DESKTOP_PATHS" >&2 $dnlamVERBOSE "Calling function: createMapping" >&2 $dnlamVERBOSE "Creating $ICONMAPPING" >&2 touch "$ICONMAPPING" eval createMapping $USER_DESKTOP_PATHS $OTHER_DESKTOP_PATHS $dnlamVERBOSE "Done createMapping." >&2 fi # directory for the backgrounds if [ -z "$BACKGROUND_DIRS" ]; then BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PREFIX}/share/fluxbox/backgrounds/" fi # find the default terminal if find_it_options $MY_TERM; then DEFAULT_TERM=$MY_TERM else [ -n "$MY_TERM" ] && echo "Warning: you chose an invalid term." >&2 #The precise order is up for debate. for term in Eterm urxvt urxvtc aterm rxvt wterm xterm konsole gnome-terminal; do if find_it $term; then DEFAULT_TERM=$term break fi done fi # a unix system without any terms. that's odd if [ -z "$DEFAULT_TERM" ]; then cat << EOF >&2 Warning: I can't find any terminal-emulators in your PATH. Please fix your PATH or specify your favourite terminal-emulator with the -t option EOF DEFAULT_TERM=xterm fi DEFAULT_TERMNAME=`echo $DEFAULT_TERM|awk '{print $1}'` DEFAULT_TERMNAME=`basename $DEFAULT_TERMNAME` # find the default browser if find_it_options $MY_BROWSER; then DEFAULT_BROWSER=$MY_BROWSER else [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2 #The precise order is up for debate. for browser in firefox mozilla-firefox mozilla-firebird MozillaFirebird opera skipstone mozilla galeon konqueror dillo netscape w3m links lynx; do if find_it $browser; then DEFAULT_BROWSER=$browser break fi done fi DEFAULT_BROWSERNAME=`echo $DEFAULT_BROWSER|awk '{print $1}'` DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME` # Start of menu cat << EOF > ${MENUFILENAME} # Generated by fluxbox-generate_menu # # If you read this it means you want to edit this file manually, so here # are some useful tips: # # - You can add your own menu-entries to ~/.fluxbox/usermenu # # - If you miss apps please let me know and I will add them for the next # release. # # - The -r option prevents removing of empty menu entries and lines which # makes things much more readable. # # - To prevent any other app from overwriting your menu # you can change the menu name in .fluxbox/init to: # session.menuFile: /home/you/.fluxbox/my-menu EOF echo "[begin] (${MENUTITLE})" >> ${MENUFILENAME} append "[exec] (${DEFAULT_TERMNAME}) {${DEFAULT_TERM}}" case "$DEFAULT_BROWSERNAME" in links|w3m|lynx) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_TERM} -e ${DEFAULT_BROWSER} ${HOMEPAGE}}" ;; firefox|firebird|mozilla|phoenix|galeon|dillo|netscape) append "[exec] (${DEFAULT_BROWSERNAME}) {${DEFAULT_BROWSER}}" ;; konqueror) append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" ;; opera) append "[exec] (opera) {env QT_XFT=true opera}" ;; MozillaFirebird) append "[exec] (firebird) {MozillaFirebird}" ;; MozillaFirefox) append "[exec] (firefox) {MozillaFirefox}" ;; *) append "[exec] ($DEFAULT_BROWSERNAME) {$DEFAULT_BROWSER}" ;; esac find_it "${LAUNCHER}" append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}" append_submenu "${TERMINALMENU}" normal_find xterm urxvt urxvtc gnome-terminal multi-gnome-terminal Eterm \ konsole aterm mlterm multi-aterm rxvt putty tsclient append_menu_end append_submenu "${NETMENU}" append_submenu "${BROWSERMENU}" normal_find firefox mozilla-firefox MozillaFirefox galeon mozilla dillo netscape vncviewer find_it links append "[exec] (links-graphic) {links -driver x ${HOMEPAGE}}" find_it opera append "[exec] (opera) {env QT_XFT=true opera}" find_it konqueror append "[exec] (konqueror) {kfmclient openProfile webbrowsing}" find_it links append "[exec] (links) {${DEFAULT_TERM} -e links ${HOMEPAGE}}" find_it w3m append "[exec] (w3m) {${DEFAULT_TERM} -e w3m ${HOMEPAGE}}" find_it lynx append "[exec] (lynx) {${DEFAULT_TERM} -e lynx ${HOMEPAGE}}" append_menu_end append_submenu IM normal_find gaim kopete gnomemeeting sim kadu psi amsn skype find_it licq append "[exec] (licq) {env QT_XFT=true licq}" cli_find centericq micq append_menu_end append_submenu Mail normal_find sylpheed kmail evolution thunderbird mozilla-thunderbird \ sylpheed-claws cli_find mutt pine append_menu_end append_submenu News normal_find liferea pears cli_find slrn tin append_menu_end append_submenu IRC normal_find xchat xchat-2 ksirc vyqchat lostirc logui konversation kvirc cli_find irssi epic4 weechat ninja find_it BitchX append "[exec] (BitchX) {${DEFAULT_TERM} -e BitchX -N}" || \ find_it bitchx append "[exec] (BitchX) {${DEFAULT_TERM} -e bitchx -N}" find_it ircii append "[exec] (ircii) {${DEFAULT_TERM} -e ircii -s}" append_menu_end append_submenu P2P normal_find gtk-gnutella lopster nicotine pyslsk xmule amule \ Valknut dcgui-qt dc_qt quickdc asami bittorrent limewire cli_find TekNap giFTcurs append_menu_end append_submenu ftp normal_find gftp IglooFTP-PRO cli_find ncftp pftp ftp lftp yafc append_menu_end normal_find pan xnmap skype x3270 append_menu_end append_submenu "${EDITORMENU}" normal_find gvim bluefish nedit gedit xedit kword kwrite kate \ wings xemacs emacs kvim cream evim scite jedit nvu xxe cli_find nano vim vi zile jed joe find_it emacs append "[exec] (emacs-nw) {${DEFAULT_TERM} -e emacs -nw}" find_it xemacs append "[exec] (xemacs-nw) {${DEFAULT_TERM} -e xemacs -nw}" append_menu_end # Development IDEs and other similar things append_submenu "${DEVELOPMENTMENU}" append_submenu "${DEVELOPMENTDEBUGGERSMENU}" normal_find insight alleyoop memprof sysprof append_menu_end append_submenu "${DEVELOPMENTVCSMENU}" normal_find rapidsvn archway gquilt meld append_menu_end normal_find idea eclipse-2 eclipse-3 eclipse-3.1 eric3 netbeans \ netbeans-4.0 poseidonCE pikdev monodevelop \ vdkbuilder glimmer diasce glade anjuta pida gazpacho \ documancer regexxer pilrc devhelp append_menu_end # educational and scientific applications append_submenu "${EDUCATIONMENU}" normal_find celestia scilab geomview scigraphica oregano xcircuit electric \ pymol chemtool xdrawchem nam celestia coqide stellarium kunit qcad \ qtiplot find_it R append "[exec] (R) {${DEFAULT_TERM} -e R --gui=gnome}" cli_find maxima grace yacas octave gnuplot grass coq acl append_menu_end append_submenu "${FILEUTILSMENU}" find_it konqueror append "[exec] (konqueror) {kfmclient openProfile filemanagement}" normal_find gentoo krusader kcommander linuxcmd rox tuxcmd krename xfe xplore find_it nautilus append "[exec] (nautilus) {nautilus --no-desktop --browser}" cli_find mc append_menu_end append_submenu "${MULTIMEDIAMENU}" append_submenu "${GRAPHICMENU}" normal_find gimp gimp2 gimp-2.2 inkscape sodipodi xv gqview \ showimg xpaint kpaint kiconedit ee xzgv gphoto tuxpaint \ imgseek iscan iv truevision find_it xnview append "[exec] (xnview browser) {xnview -browser}" find_it blender append "[exec] (blender) {blender -w}" find_it gears append "[exec] (Mesa gears) {gears}" find_it morph3d append "[exec] (Mesa morph) {morph3d}" find_it reflect append "[exec] (Mesa reflect) {reflect}" append_menu_end append_submenu "${MUSICMENU}" normal_find xmms noatun alsaplayer gqmpeg aumix xmixer \ gnome-alsamixer gmix kmix kscd grecord kmidi xplaycd soundtracker \ grip easytag audacity zinf rhythmbox kaboodle beep-media-player \ amarok asunder hydrogen ipodder kmp pympd cli_find cdcd cplay alsamixer orpheus mp3blaster append_menu_end append_submenu "${VIDEOMENU}" normal_find xine aviplay gtv gmplayer xmovie xgdb realplay xawtv fxtv ogle \ goggles vlc totem alevt avidemux2 dvdrip dvdstyler find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" append_menu_end append_menu_end append_submenu "${OFFICEMENU}" normal_find xclock xcalc kcalc gv sunbird-bin texmaker jabref find_it gcalc append "[exec] (gcalc) {gcalc}" || \ find_it gnome-calculator append "[exec] (gcalc) {gnome-calculator}" # old versions didn't ship with .desktop files for ext in s o xo; do find_it ${ext}office append "[exec] (Open Office) {${ext}office}" find_it ${ext}ocalc append "[exec] (OO Calc) {${ext}ocalc}" find_it ${ext}owriter append "[exec] (OO Writer) {${ext}owriter}" find_it ${ext}oimpress append "[exec] (OO Impress) {${ext}oimpress}" find_it ${ext}odraw append "[exec] (OO Draw) {${ext}odraw}" find_it ${ext}omath append "[exec] (OO Math) {${ext}omath}" find_it ${ext}opadmin append "[exec] (OO Printer Admin) {${ext}opadmin}" done # openoffice 2 does ship with some at the very least append_submenu "${OPENOFFICEMENU}" find_it ooffice2 append "[exec] (Open Office 2) {ooffice2}" normal_find oobase2 oocalc2 oowriter2 ooimpress2 oodraw2 oomath2 find_it ooweb2 append "[exec] (OO2 Writer-Web) {ooweb2}" append_menu_end find_it mrproject append "[exec] (Mr.Project) {mrproject}" normal_find abiword kword wordperfect katoob acroread xpdf lyx texmacs normal_find dia xfig append_menu_end append_submenu "${GAMESMENU}" append_submenu "${GAMESACTIONMENU}" normal_find armagetronad bomberclone bzflag chromium descent3 \ fakk2 heavygear2 lugaru luola maelstrom rune trackballs append_menu_end append_submenu "${GAMESARCADEMENU}" normal_find briquolo ceferino crack-attack critter frozen-bubble \ jumpnbump lbreakout2 penguin-command rocksndiamonds solarwolf \ spout tomatoes xgalaga append_menu_end append_submenu "${GAMESBOARDMENU}" normal_find cgoban gtkatlantic jrisk append_menu_end append_submenu "${GAMESCARDMENU}" normal_find hearts pysol kpoker blackjack append_menu_end append_submenu "${GAMESEMULATIONMENU}" # maybe shortcuts to launch scummvm straight into a specific game? normal_find GSnes9x pcsx2 stella zsnes scummvm append_menu_end append_submenu "${GAMESFPSMENU}" normal_find armyops blackshades cube_client cube_client-bin doom doom3 \ doom3-demo legends nexuiz-glx nexuiz-sdl quake2 quake2-qmax \ quake3 quake3-bin q3demo quake4 quake4-demo rtcwmp rtcwsp sof \ transfusion t2launch # check desktop files, the following should work fine wiht normal_find find_it et append "[exec] (Enemy Territory) {et}" find_it ut append "[exec] (Unreal Tournament) {ut}" find_it ut2003 append "[exec] (Unreal Tournament 2003) {ut2003}" find_it ut2003-demo append "[exec] (Unreal Tournament 2003 Demo) {ut2003-demo}" find_it ut2004 append "[exec] (Unreal Tournament 2004) {ut2004}" find_it ut2004-demo append "[exec] (Unreal Tournament 2004 Demo) {ut2004-demo}" append_menu_end append_submenu "${GAMESPUZZLEMENU}" normal_find concentration fillets gnurobbo gtkballs ltris neverball \ pathological pingus tong twind GNUDoku append_menu_end append_submenu "${GAMESRPGMENU}" normal_find el el-mapedit nwn openglad adonthell-wastesedge append_menu_end append_submenu "${GAMESSPORTMENU}" normal_find bugfoot foobillard trophy ustunts append_menu_end append_submenu "${GAMESSTRATEGYMENU}" normal_find bos coldwar-demo crimson darwinia darwinia-demo \ dominions2 glest glob2 heroes3 lgeneral magnant maj_demo \ mindrover-demo netpanzer smac smacx wargus widelands append_menu_end # need to clean up this list into to categories normal_find gnibbles gnobots2 tuxpuck gataxx glines \ gnect mahjongg gnomine gnome-stones gnometris gnotravex \ gnotski iagno knights eboard xboard scid freecell \ gtali tuxracer xpenguins xsnow xeyes smclone \ openmortal skoosh same-gnome xbill \ icebreaker scorched3d sol dosbox black-box enigma freeciv \ freeciv-server liquidwar qt-nethack \ nethack-gnome xqf \ wesnoth canfeild ace_canfeild golf merlin chickens \ supertux tuxdash openttd \ gltron Point2Play cli_find gnugo nethack append_menu_end append_submenu "${UTILITIES}" append_submenu "${CDBURNING}" normal_find xcdroast nero gcdmaster simplecdrx cdw append_menu_end append_submenu "${VIRTUALIZATION}" normal_find vmware vmplayer # waiting for a qemu GUI append_menu_end append_submenu "${XUTILSMENU}" normal_find xfontsel xman xload xfigxbiff editres viewres xclock \ xmag wmagnify find_it xrdb append "[exec] (Reload .Xdefaults) {xrdb -load $HOME/.Xdefaults}" append_menu_end normal_find gkrellm gkrellm2 portagemaster porthole nvidia-settings \ gnome-cups-manager xscreensaver-demo xlock electricsheep \ fireglcontrol usbview bacula hal-device-manager \ ethereal cutecom fwbuilder gpa alexandria freemind cli_find minicom append_menu_end # We'll only use this once ETCAPPLNK=/etc/X11/applnk PARSING_DESKTOP="true" # gnome menu if [ "${GNOMEMENU}" ]; then append_submenu "${GNOMEMENUTEXT}" recurse_dir_menu "${GNOME_PREFIX}/share/gnome/apps" "$HOME/.gnome/apps" ${ETCAPPLNK} append_menu_end unset ETCAPPLNK fi # kde submenu if [ -d "${KDE_PREFIX}/share/applnk/" -a "${KDEMENU}" ]; then append_submenu "${KDEMENUTEXT}" recurse_dir_menu "${KDE_PREFIX}/share/applnk" "$HOME/.kde/share/applnk" ${ETCAPPLNK} # unfortunetly all of the items in $KDE_PREFIX/share/applications can't be easily included append_menu_end unset ETCAPPLNK fi unset PARSING_DESKTOP #User menu if [ -r "${USERMENU}" ]; then cat ${USERMENU} >> ${MENUFILENAME} fi append_submenu "${FBSETTINGSMENU}" append "[config] (${CONFIGUREMENU})" append_submenu "Styles" append "[include] (/usr/share/fluxbox/menu.d/styles/)" append_menu_end # Backgroundmenu addbackground() { picturename=`basename "$1"` append "[exec] (${picturename%.???}) {fbsetbg -a \"$1\" }" } if [ "$BACKGROUNDMENUITEM" = yes ]; then IFS=: # set delimetor for find NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l` if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" append "[exec] (${RANDOMBACKGROUND}) {fbsetbg -r ${HOME}/.fluxbox/backgrounds}" if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then menucounter=1 ; counter=1 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" find $BACKGROUND_DIRS -follow -type f|sort|while read i; do counter=`expr $counter + 1` if [ $counter -eq 30 ]; then counter=1 menucounter=`expr $menucounter + 1` append_menu_end append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" fi addbackground "$i" done append_menu_end else find $BACKGROUND_DIRS -follow -type f|sort|while read i; do addbackground "$i" done fi append_menu_end else echo "Warning: You wanted a background-menu but I couldn't find any backgrounds in: $BACKGROUND_DIRS" >&2 fi fi append "[workspaces] (${WORKSPACEMENU})" append_submenu ${TOOLS} normal_find fluxconf fluxkeys fluxmenu # if gxmessage exitst use it; else use xmessage find_it gxmessage append \ "[exec] (${WINDOWNAME}) {xprop WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" || \ find_it xmessage append \ "[exec] (${WINDOWNAME}) {xprop WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" find_it import append "[exec] (${SCREENSHOT} - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg}" find_it import append "[exec] (${SCREENSHOT} - PNG) {import screenshot.png && display -resize 50% screenshot.png}" find_it ${LAUNCHER} append "[exec] (${RUNCOMMAND}) {${LAUNCHER} $FBRUNOPTIONS}" find_it switch append "[exec] (gtk-theme-switch) {switch}" find_it switch2 append "[exec] (gtk2-theme-switch) {switch2}" find_it fluxbox-generate_menu append "[exec] (${REGENERATEMENU}) {fluxbox-generate_menu}" append_menu_end append_submenu ${WINDOWMANAGERS} #hard to properly maintain since there are so many exceptions to the rule. for wm in icewm ion kde sawfish enlightenment fvwm openbox evilwm waimea xfce pekwm; do find_it start${wm} append "[restart] (${wm}) {start${wm}}" ||\ find_it ${wm} append "[restart] (${wm}) {${wm}}" done find_it startgnome append "[restart] (gnome) {startgnome}" ||\ find_it gnome-session append "[restart] (gnome) {gnome-session}" find_it startwindowmaker append "[restart] (windowmaker) {startwindowmaker}" ||\ find_it wmaker append "[restart] (windowmaker) {wmaker}" append_menu_end find_it xlock append "[exec] (${LOCKSCREEN}) {xlock}" ||\ find_it xscreensaver-command append "[exec] (${LOCKSCREEN}) {xscreensaver-command -lock}" append "[commanddialog] (${FLUXBOXCOMMAND})" append "[reconfig] (${RELOADITEM})" append "[restart] (${RESTARTITEM})" append "[exec] (${ABOUTITEM}) {(fluxbox -v; fluxbox -info | sed 1d) 2> /dev/null | xmessage -file - -center}" append "[separator]" append "[exit] (${EXITITEM})" append_menu_end append_menu_end # this function removes empty menu items. It can not yet remove nested # empty submenus :\ if [ ! "${REMOVE}" ]; then clean_up fi # escapes any parentheses in menu label # e.g., "[exec] (konqueror (web))" becomes "[exec] (konqueror (web\))" sed 's/(\(.*\)(\(.*\)))/(\1 (\2\\))/' $MENUFILENAME > menu.tmp mv -f menu.tmp $MENUFILENAME if [ -z "$INSTALL" ]; then if [ -z "$CHECKINIT" ]; then INITMENUFILENAME=`awk '/menuFile/ {print $2}' $HOME/.fluxbox/init` INITMENUFILENAME=`replaceWithinString "$INITMENUFILENAME" "~" "$HOME"` if [ ! "$INITMENUFILENAME" = "$MENUFILENAME" ]; then echo "Note: In $HOME/.fluxbox/init, your \"session.menuFile\" does not point to $MENUFILENAME but to $INITMENUFILENAME" >&2 fi fi echo "Menu successfully generated: $MENUFILENAME" #echo " Make sure \"session.menuFile: $MENUFILENAME\" is in $HOME/.fluxbox/init." echo 'Use fluxbox-generate_menu -h to read about all the latest features.' fi