update from Han

This commit is contained in:
fluxgen 2002-12-14 08:27:54 +00:00
parent 84ab46323e
commit 8fe75581d6

View file

@ -22,7 +22,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
# $Id: fluxbox-generate_menu,v 1.15 2002/11/29 13:39:37 rathnor Exp $ # $Id: fluxbox-generate_menu,v 1.16 2002/12/14 08:27:54 fluxgen Exp $
WHOAMI=`whoami` WHOAMI=`whoami`
[ "$WHOAMI" = "root" ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin [ "$WHOAMI" = "root" ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin
@ -32,7 +32,7 @@ display_usage() {
cat <<EOF cat <<EOF
Usage: fluxbox-generate_menu [-kgr] [-t terminal] [-w browser] Usage: fluxbox-generate_menu [-kgr] [-t terminal] [-w browser]
[-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path]
Options: Options:
-k Insert a kde menu -k Insert a kde menu
@ -114,8 +114,8 @@ append_menu_end() {
} }
menu_entry() { menu_entry() {
append "[exec] ("`grep -v GenericName $* | grep Name= | cut -d = -f 2`") \ append "[exec] (`grep -v GenericName $* | grep Name= | cut -d = -f 2`) \
{"`grep -v TryExec $* | grep Exec= | cut -d = -f 2`"}" {`grep -v TryExec $* | grep Exec= | cut -d = -f 2`}"
} }
menu_entry_dircheck() { menu_entry_dircheck() {
@ -146,6 +146,9 @@ N
mv -f ${FILENAME}.tmp ${FILENAME} mv -f ${FILENAME}.tmp ${FILENAME}
} }
# Save options for inclusion in menu
options="$@"
# Get options. # Get options.
while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in case "${COMMAND_LINE_ARGUMENT}" in
@ -166,7 +169,6 @@ while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do
esac esac
done done
# Set Defaults # Set Defaults
# menufile name # menufile name
@ -252,10 +254,9 @@ fi
# a unix system without any terms. that's odd # a unix system without any terms. that's odd
if [ -z "$DEFAULT_TERM" ];then if [ -z "$DEFAULT_TERM" ];then
cat <<EOF>&2 cat <<EOF>&2
Error: I can't find any terminal-emulators in your path. Warning: I can't find any terminal-emulators in your PATH.
Please specify your favourite terminal with the -t option. Please fix your PATH or specify your favourite terminal with the -t option
EOF EOF
exit 1
fi fi
@ -284,7 +285,7 @@ XUTILSMENU="X-utils"
# Check translation # Check translation
case ${LC_ALL} in case ${LC_ALL} in
ru_RU) #Russian locales ru_RU*) #Russian locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="âÒÁÕÚÅÒÙ" BROWSERMENU="âÒÁÕÚÅÒÙ"
CONFIGUREMENU="îÁÓÔÒÏÊËÁ" CONFIGUREMENU="îÁÓÔÒÏÊËÁ"
@ -305,7 +306,7 @@ case ${LC_ALL} in
WORKSPACEMENU="òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á" WORKSPACEMENU="òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á"
XUTILSMENU="X-ÕÔÉÌÉÔÙ" XUTILSMENU="X-ÕÔÉÌÉÔÙ"
;; ;;
sv_SE) #Swedish locales sv_SE*) #Swedish locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="Browsers" BROWSERMENU="Browsers"
CONFIGUREMENU="Konfiguration" CONFIGUREMENU="Konfiguration"
@ -326,7 +327,7 @@ case ${LC_ALL} in
WORKSPACEMENU="Arbetsytor" WORKSPACEMENU="Arbetsytor"
XUTILSMENU="X-program" XUTILSMENU="X-program"
;; ;;
nl_NL) #Nederlandse locales nl_NL*) #Nederlandse locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="Browsers" BROWSERMENU="Browsers"
CONFIGUREMENU="Instellingen" CONFIGUREMENU="Instellingen"
@ -347,7 +348,7 @@ case ${LC_ALL} in
WORKSPACEMENU="Werkveld Lijst" WORKSPACEMENU="Werkveld Lijst"
XUTILSMENU="X-utils" XUTILSMENU="X-utils"
;; ;;
fi_FI) #Finnish locales fi_FI*) #Finnish locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="Selaimet" BROWSERMENU="Selaimet"
CONFIGUREMENU="Konfigurointi" CONFIGUREMENU="Konfigurointi"
@ -368,7 +369,7 @@ case ${LC_ALL} in
WORKSPACEMENU="Työaluet" WORKSPACEMENU="Työaluet"
XUTILSMENU="X-Ohjelmat" XUTILSMENU="X-Ohjelmat"
;; ;;
ja_JP) #Japanese locales ja_JP*) #Japanese locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="¥Ö¥é¥¦¥¶" BROWSERMENU="¥Ö¥é¥¦¥¶"
CONFIGUREMENU="ÀßÄê" CONFIGUREMENU="ÀßÄê"
@ -389,7 +390,7 @@ case ${LC_ALL} in
WORKSPACEMENU="¥ï¡¼¥¯¥¹¥Ú¡¼¥¹" WORKSPACEMENU="¥ï¡¼¥¯¥¹¥Ú¡¼¥¹"
XUTILSMENU="X¥æ¡¼¥Æ¥£¥ê¥Æ¥£" XUTILSMENU="X¥æ¡¼¥Æ¥£¥ê¥Æ¥£"
;; ;;
fr_FR) # french locales fr_FR*) # french locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="Navigateurs" BROWSERMENU="Navigateurs"
CONFIGUREMENU="Configurer" CONFIGUREMENU="Configurer"
@ -410,7 +411,7 @@ case ${LC_ALL} in
WORKSPACEMENU="Liste des bureaux" WORKSPACEMENU="Liste des bureaux"
XUTILSMENU="X-utils" XUTILSMENU="X-utils"
;; ;;
it_IT|it_IT@euro) # italian locales it_IT*) # italian locales
#OFFICEMENU="Office" #OFFICEMENU="Office"
BROWSERMENU="Browsers" BROWSERMENU="Browsers"
CONFIGUREMENU="Configurazione" CONFIGUREMENU="Configurazione"
@ -593,10 +594,13 @@ fi
find_it fluxkeys append "[exec] (FluxKeys) {fluxkeys}" find_it fluxkeys append "[exec] (FluxKeys) {fluxkeys}"
find_it fluxmenu append "[exec] (FluxMenu) {fluxmenu}" find_it fluxmenu append "[exec] (FluxMenu) {fluxmenu}"
# if gxmessage exitst use it; else use xmessage # if gxmessage exitst use it; else use xmessage
find_it gxmessage append "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" find_it gxmessage append \
"[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}"
[ $? -ne 0 ] && \ [ $? -ne 0 ] && \
find_it xmessage append "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" find_it xmessage append \
"[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}"
find_it fbrun append "[exec] (Run) {fbrun}" find_it fbrun append "[exec] (Run) {fbrun}"
find_it fluxbox-generate_menu append "[exec] (Regen menu) {fluxbox-generate_menu $options}"
append_menu_end append_menu_end
append "[reconfig] (${RELOADITEM})" append "[reconfig] (${RELOADITEM})"
@ -613,3 +617,5 @@ append_menu_end
if [ ! "${REMOVE}" ];then if [ ! "${REMOVE}" ];then
clean_up clean_up
fi fi
echo "Menu succesfully generated."