aboutsummaryrefslogtreecommitdiff
path: root/util/fluxbox-generate_menu
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-10-24 09:33:42 (GMT)
committerfluxgen <fluxgen>2002-10-24 09:33:42 (GMT)
commit5e521b66b776ab08885738f717e22df4963d6bf0 (patch)
treef7ba24ab65aed86caa3ad99b2511374b7557db4e /util/fluxbox-generate_menu
parent537d41c96e7bede9423598c91952c53d0a402374 (diff)
downloadfluxbox_paul-5e521b66b776ab08885738f717e22df4963d6bf0.zip
fluxbox_paul-5e521b66b776ab08885738f717e22df4963d6bf0.tar.bz2
update from Han
Diffstat (limited to 'util/fluxbox-generate_menu')
-rwxr-xr-xutil/fluxbox-generate_menu55
1 files changed, 34 insertions, 21 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu
index 005ccb1..3e82a49 100755
--- a/util/fluxbox-generate_menu
+++ b/util/fluxbox-generate_menu
@@ -43,7 +43,9 @@ Options:
43 43
44 only for packagers: 44 only for packagers:
45 45
46 -p Package-datadir; default is /usr/local/share 46 -p Package-datadir; default is /usr/share
47 -n Gnome-datadir; default is Package-datadir
48 -q KDE-datadir; default is Package-datadir
47 49
48EOF 50EOF
49} 51}
@@ -65,7 +67,7 @@ Henrik Kinnunnen: Project leader.
65Han Boetes: Packaging, debugging and scripts. 67Han Boetes: Packaging, debugging and scripts.
66Jeramy B. Smith: Packaging assistance, gnome and kde menu system. 68Jeramy B. Smith: Packaging assistance, gnome and kde menu system.
67Xyrnix: Mysterious guest developer who made find_it module. 69Xyrnix: Mysterious guest developer who made find_it module.
68filipe: Italian locales and find_term module. 70felipe: Italian locales and find_term module.
69EOF 71EOF
70 echo -e `whoami`": Innocent bystander.\n" 72 echo -e `whoami`": Innocent bystander.\n"
71} 73}
@@ -110,13 +112,15 @@ menu_entry_dir() {
110} 112}
111 113
112# Get options. 114# Get options.
113while getopts ":khagt:p:o:m:" COMMAND_LINE_ARGUMENT ; do 115while getopts ":khagt:p:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do
114 case "${COMMAND_LINE_ARGUMENT}" in 116 case "${COMMAND_LINE_ARGUMENT}" in
115 k) KDEMENU=yes ;; 117 k) KDEMENU=yes ;;
116 g) GNOMEMENU=yes ;; 118 g) GNOMEMENU=yes ;;
117 t) MY_TERM=${OPTARG};; 119 t) MY_TERM=${OPTARG};;
118 o) FILENAME=${OPTARG} ;; 120 o) FILENAME=${OPTARG} ;;
119 p) PKGDATADIR=${OPTARG} ;; 121 p) PKGDATADIR=${OPTARG} ;;
122 n) GPKGDATADIR=${OPTARG} ;;
123 q) KPKGDATADIR=${OPTARG} ;;
120 m) MENUTITLE=${OPTARG} ;; 124 m) MENUTITLE=${OPTARG} ;;
121 h) display_usage ; exit 0 ;; 125 h) display_usage ; exit 0 ;;
122 a) display_authors ; exit 0 ;; 126 a) display_authors ; exit 0 ;;
@@ -127,7 +131,7 @@ done
127 131
128# Set Defaults 132# Set Defaults
129 133
130# menufile name and make a backup 134# menufile name
131if [ -z ${FILENAME} ]; then 135if [ -z ${FILENAME} ]; then
132 FILENAME=${HOME}/.fluxbox/menu 136 FILENAME=${HOME}/.fluxbox/menu
133fi 137fi
@@ -138,17 +142,26 @@ if ! touch ${FILENAME}; then
138 exit 1 142 exit 1
139fi 143fi
140 144
141if [ ! -z ${FILENAME} ]; then 145# backup menu
142 if [ -w ${FILENAME} ]; then 146if [ -w ${FILENAME} ]; then
143 cp -f ${FILENAME} ${FILENAME}.bak 147 mv ${FILENAME} ${FILENAME}.bak
144 fi
145fi 148fi
146 149
147#packagedatadir 150#packagedatadir
148if [ -z "${PKGDATADIR}" ]; then 151if [ ! -d "${PKGDATADIR}" ]; then
149 PKGDATADIR=/usr/share 152 PKGDATADIR=/usr/share
150fi 153fi
151 154
155#gnome packagedatadir
156if [ ! -d "${GPKGDATADIR}" ]; then
157 GPKGDATADIR=${PKGDATADIR}
158fi
159
160#kde packagedatadir
161if [ ! -d "${KPKGDATADIR}" ]; then
162 KPKGDATADIR=${PKGDATADIR}
163fi
164
152# menutitle 165# menutitle
153if [ -z "${MENUTITLE}" ]; then 166if [ -z "${MENUTITLE}" ]; then
154 MENUTITLE="Fluxbox" 167 MENUTITLE="Fluxbox"
@@ -464,12 +477,12 @@ append_submenu ${XUTILSMENU}
464append_menu_end 477append_menu_end
465 478
466# gnome menu 479# gnome menu
467if [ -d ${PKGDATADIR}/gnome/apps -a "${GNOMEMENU}" ]; then 480if [ -d ${GPKGDATADIR}/gnome/apps -a "${GNOMEMENU}" ]; then
468 append_submenu ${GNOMEMENUTEXT} 481 append_submenu ${GNOMEMENUTEXT}
469 for a in `ls ${PKGDATADIR}/gnome/apps`; do 482 for a in `ls ${GPKGDATADIR}/gnome/apps`; do
470 if [ -d ${PKGDATADIR}/gnome/apps/"${a}" ] ; then 483 if [ -d ${GPKGDATADIR}/gnome/apps/"${a}" ] ; then
471 append_submenu "${a}" 484 append_submenu "${a}"
472 menu_entry_dir "${PKGDATADIR}/gnome/apps/"${a}"" 485 menu_entry_dir "${GPKGDATADIR}/gnome/apps/"${a}""
473 menu_entry_dircheck "/etc/X11/applnk/"${a}"" 486 menu_entry_dircheck "/etc/X11/applnk/"${a}""
474 append_menu_end 487 append_menu_end
475 fi 488 fi
@@ -478,23 +491,23 @@ if [ -d ${PKGDATADIR}/gnome/apps -a "${GNOMEMENU}" ]; then
478fi 491fi
479 492
480# kde submenu 493# kde submenu
481if [ -d ${PKGDATADIR}/applnk/ -a "${KDEMENU}" ]; then 494if [ -d ${KPKGDATADIR}/applnk/ -a "${KDEMENU}" ]; then
482 append_submenu ${KDEMENUTEXT} 495 append_submenu ${KDEMENUTEXT}
483 for a in `ls ${PKGDATADIR}/applnk/`; do 496 for a in `ls ${KPKGDATADIR}/applnk/`; do
484 if [ -d ${PKGDATADIR}/applnk/"${a}" ]; then 497 if [ -d ${KPKGDATADIR}/applnk/"${a}" ]; then
485 append_submenu "${a}" 498 append_submenu "${a}"
486 for x in `ls ${PKGDATADIR}/applnk/"${a}"`; do 499 for x in `ls ${KPKGDATADIR}/applnk/"${a}"`; do
487 if [ -d ${PKGDATADIR}/applnk/"${a}"/"${x}" ]; then 500 if [ -d ${KPKGDATADIR}/applnk/"${a}"/"${x}" ]; then
488 append_submenu "${x}" 501 append_submenu "${x}"
489 menu_entry_dir ${PKGDATADIR}/applnk/"${a}"/"${x}" 502 menu_entry_dir ${KPKGDATADIR}/applnk/"${a}"/"${x}"
490 append_menu_end 503 append_menu_end
491 fi 504 fi
492 done 505 done
493 menu_entry_dir ${PKGDATADIR}/applnk/"${a}" 506 menu_entry_dir ${KPKGDATADIR}/applnk/"${a}"
494 append_menu_end 507 append_menu_end
495 fi 508 fi
496 done 509 done
497 menu_entry_dir ${PKGDATADIR}/applnk/ 510 menu_entry_dir ${KPKGDATADIR}/applnk/
498 append_menu_end 511 append_menu_end
499fi 512fi
500 513