diff options
author | fluxgen <fluxgen> | 2002-10-24 09:33:42 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-10-24 09:33:42 (GMT) |
commit | 5e521b66b776ab08885738f717e22df4963d6bf0 (patch) | |
tree | f7ba24ab65aed86caa3ad99b2511374b7557db4e | |
parent | 537d41c96e7bede9423598c91952c53d0a402374 (diff) | |
download | fluxbox_paul-5e521b66b776ab08885738f717e22df4963d6bf0.zip fluxbox_paul-5e521b66b776ab08885738f717e22df4963d6bf0.tar.bz2 |
update from Han
-rwxr-xr-x | util/fluxbox-generate_menu | 55 |
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 | ||
48 | EOF | 50 | EOF |
49 | } | 51 | } |
@@ -65,7 +67,7 @@ Henrik Kinnunnen: Project leader. | |||
65 | Han Boetes: Packaging, debugging and scripts. | 67 | Han Boetes: Packaging, debugging and scripts. |
66 | Jeramy B. Smith: Packaging assistance, gnome and kde menu system. | 68 | Jeramy B. Smith: Packaging assistance, gnome and kde menu system. |
67 | Xyrnix: Mysterious guest developer who made find_it module. | 69 | Xyrnix: Mysterious guest developer who made find_it module. |
68 | filipe: Italian locales and find_term module. | 70 | felipe: Italian locales and find_term module. |
69 | EOF | 71 | EOF |
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. |
113 | while getopts ":khagt:p:o:m:" COMMAND_LINE_ARGUMENT ; do | 115 | while 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 |
131 | if [ -z ${FILENAME} ]; then | 135 | if [ -z ${FILENAME} ]; then |
132 | FILENAME=${HOME}/.fluxbox/menu | 136 | FILENAME=${HOME}/.fluxbox/menu |
133 | fi | 137 | fi |
@@ -138,17 +142,26 @@ if ! touch ${FILENAME}; then | |||
138 | exit 1 | 142 | exit 1 |
139 | fi | 143 | fi |
140 | 144 | ||
141 | if [ ! -z ${FILENAME} ]; then | 145 | # backup menu |
142 | if [ -w ${FILENAME} ]; then | 146 | if [ -w ${FILENAME} ]; then |
143 | cp -f ${FILENAME} ${FILENAME}.bak | 147 | mv ${FILENAME} ${FILENAME}.bak |
144 | fi | ||
145 | fi | 148 | fi |
146 | 149 | ||
147 | #packagedatadir | 150 | #packagedatadir |
148 | if [ -z "${PKGDATADIR}" ]; then | 151 | if [ ! -d "${PKGDATADIR}" ]; then |
149 | PKGDATADIR=/usr/share | 152 | PKGDATADIR=/usr/share |
150 | fi | 153 | fi |
151 | 154 | ||
155 | #gnome packagedatadir | ||
156 | if [ ! -d "${GPKGDATADIR}" ]; then | ||
157 | GPKGDATADIR=${PKGDATADIR} | ||
158 | fi | ||
159 | |||
160 | #kde packagedatadir | ||
161 | if [ ! -d "${KPKGDATADIR}" ]; then | ||
162 | KPKGDATADIR=${PKGDATADIR} | ||
163 | fi | ||
164 | |||
152 | # menutitle | 165 | # menutitle |
153 | if [ -z "${MENUTITLE}" ]; then | 166 | if [ -z "${MENUTITLE}" ]; then |
154 | MENUTITLE="Fluxbox" | 167 | MENUTITLE="Fluxbox" |
@@ -464,12 +477,12 @@ append_submenu ${XUTILSMENU} | |||
464 | append_menu_end | 477 | append_menu_end |
465 | 478 | ||
466 | # gnome menu | 479 | # gnome menu |
467 | if [ -d ${PKGDATADIR}/gnome/apps -a "${GNOMEMENU}" ]; then | 480 | if [ -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 | |||
478 | fi | 491 | fi |
479 | 492 | ||
480 | # kde submenu | 493 | # kde submenu |
481 | if [ -d ${PKGDATADIR}/applnk/ -a "${KDEMENU}" ]; then | 494 | if [ -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 |
499 | fi | 512 | fi |
500 | 513 | ||