diff options
author | fluxgen <fluxgen> | 2002-12-14 08:27:54 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-12-14 08:27:54 (GMT) |
commit | 8fe75581d6036a5bcadd9dc65798b60473619554 (patch) | |
tree | 3a0f15b4caafd12f04ffb5f84ae62beaf4498011 /util | |
parent | 84ab46323e6e08b6e4dc2909d06bb09ca0e10155 (diff) | |
download | fluxbox_lack-8fe75581d6036a5bcadd9dc65798b60473619554.zip fluxbox_lack-8fe75581d6036a5bcadd9dc65798b60473619554.tar.bz2 |
update from Han
Diffstat (limited to 'util')
-rwxr-xr-x | util/fluxbox-generate_menu | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu index 4a4f582..a3c6860 100755 --- a/util/fluxbox-generate_menu +++ b/util/fluxbox-generate_menu | |||
@@ -22,7 +22,7 @@ | |||
22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | # DEALINGS IN THE SOFTWARE. | 23 | # DEALINGS IN THE SOFTWARE. |
24 | # | 24 | # |
25 | # $Id: fluxbox-generate_menu,v 1.15 2002/11/29 13:39:37 rathnor Exp $ | 25 | # $Id: fluxbox-generate_menu,v 1.16 2002/12/14 08:27:54 fluxgen Exp $ |
26 | 26 | ||
27 | WHOAMI=`whoami` | 27 | WHOAMI=`whoami` |
28 | [ "$WHOAMI" = "root" ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin | 28 | [ "$WHOAMI" = "root" ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin |
@@ -32,7 +32,7 @@ display_usage() { | |||
32 | cat <<EOF | 32 | cat <<EOF |
33 | 33 | ||
34 | Usage: fluxbox-generate_menu [-kgr] [-t terminal] [-w browser] | 34 | Usage: fluxbox-generate_menu [-kgr] [-t terminal] [-w browser] |
35 | [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] | 35 | [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] |
36 | Options: | 36 | Options: |
37 | 37 | ||
38 | -k Insert a kde menu | 38 | -k Insert a kde menu |
@@ -114,8 +114,8 @@ append_menu_end() { | |||
114 | } | 114 | } |
115 | 115 | ||
116 | menu_entry() { | 116 | menu_entry() { |
117 | append "[exec] ("`grep -v GenericName $* | grep Name= | cut -d = -f 2`") \ | 117 | append "[exec] (`grep -v GenericName $* | grep Name= | cut -d = -f 2`) \ |
118 | {"`grep -v TryExec $* | grep Exec= | cut -d = -f 2`"}" | 118 | {`grep -v TryExec $* | grep Exec= | cut -d = -f 2`}" |
119 | } | 119 | } |
120 | 120 | ||
121 | menu_entry_dircheck() { | 121 | menu_entry_dircheck() { |
@@ -146,6 +146,9 @@ N | |||
146 | mv -f ${FILENAME}.tmp ${FILENAME} | 146 | mv -f ${FILENAME}.tmp ${FILENAME} |
147 | } | 147 | } |
148 | 148 | ||
149 | # Save options for inclusion in menu | ||
150 | options="$@" | ||
151 | |||
149 | # Get options. | 152 | # Get options. |
150 | while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do | 153 | while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do |
151 | case "${COMMAND_LINE_ARGUMENT}" in | 154 | case "${COMMAND_LINE_ARGUMENT}" in |
@@ -166,7 +169,6 @@ while getopts ":khragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do | |||
166 | esac | 169 | esac |
167 | done | 170 | done |
168 | 171 | ||
169 | |||
170 | # Set Defaults | 172 | # Set Defaults |
171 | 173 | ||
172 | # menufile name | 174 | # menufile name |
@@ -252,10 +254,9 @@ fi | |||
252 | # a unix system without any terms. that's odd | 254 | # a unix system without any terms. that's odd |
253 | if [ -z "$DEFAULT_TERM" ];then | 255 | if [ -z "$DEFAULT_TERM" ];then |
254 | cat <<EOF>&2 | 256 | cat <<EOF>&2 |
255 | Error: I can't find any terminal-emulators in your path. | 257 | Warning: I can't find any terminal-emulators in your PATH. |
256 | Please specify your favourite terminal with the -t option. | 258 | Please fix your PATH or specify your favourite terminal with the -t option |
257 | EOF | 259 | EOF |
258 | exit 1 | ||
259 | fi | 260 | fi |
260 | 261 | ||
261 | 262 | ||
@@ -284,7 +285,7 @@ XUTILSMENU="X-utils" | |||
284 | 285 | ||
285 | # Check translation | 286 | # Check translation |
286 | case ${LC_ALL} in | 287 | case ${LC_ALL} in |
287 | ru_RU) #Russian locales | 288 | ru_RU*) #Russian locales |
288 | #OFFICEMENU="Office" | 289 | #OFFICEMENU="Office" |
289 | BROWSERMENU="âÒÁÕÚÅÒÙ" | 290 | BROWSERMENU="âÒÁÕÚÅÒÙ" |
290 | CONFIGUREMENU="îÁÓÔÒÏÊËÁ" | 291 | CONFIGUREMENU="îÁÓÔÒÏÊËÁ" |
@@ -305,7 +306,7 @@ case ${LC_ALL} in | |||
305 | WORKSPACEMENU="òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á" | 306 | WORKSPACEMENU="òÁÂÏÞÉÅ ÐÒÏÓÔÒÁÎÓÔ×Á" |
306 | XUTILSMENU="X-ÕÔÉÌÉÔÙ" | 307 | XUTILSMENU="X-ÕÔÉÌÉÔÙ" |
307 | ;; | 308 | ;; |
308 | sv_SE) #Swedish locales | 309 | sv_SE*) #Swedish locales |
309 | #OFFICEMENU="Office" | 310 | #OFFICEMENU="Office" |
310 | BROWSERMENU="Browsers" | 311 | BROWSERMENU="Browsers" |
311 | CONFIGUREMENU="Konfiguration" | 312 | CONFIGUREMENU="Konfiguration" |
@@ -326,7 +327,7 @@ case ${LC_ALL} in | |||
326 | WORKSPACEMENU="Arbetsytor" | 327 | WORKSPACEMENU="Arbetsytor" |
327 | XUTILSMENU="X-program" | 328 | XUTILSMENU="X-program" |
328 | ;; | 329 | ;; |
329 | nl_NL) #Nederlandse locales | 330 | nl_NL*) #Nederlandse locales |
330 | #OFFICEMENU="Office" | 331 | #OFFICEMENU="Office" |
331 | BROWSERMENU="Browsers" | 332 | BROWSERMENU="Browsers" |
332 | CONFIGUREMENU="Instellingen" | 333 | CONFIGUREMENU="Instellingen" |
@@ -347,7 +348,7 @@ case ${LC_ALL} in | |||
347 | WORKSPACEMENU="Werkveld Lijst" | 348 | WORKSPACEMENU="Werkveld Lijst" |
348 | XUTILSMENU="X-utils" | 349 | XUTILSMENU="X-utils" |
349 | ;; | 350 | ;; |
350 | fi_FI) #Finnish locales | 351 | fi_FI*) #Finnish locales |
351 | #OFFICEMENU="Office" | 352 | #OFFICEMENU="Office" |
352 | BROWSERMENU="Selaimet" | 353 | BROWSERMENU="Selaimet" |
353 | CONFIGUREMENU="Konfigurointi" | 354 | CONFIGUREMENU="Konfigurointi" |
@@ -368,7 +369,7 @@ case ${LC_ALL} in | |||
368 | WORKSPACEMENU="Työaluet" | 369 | WORKSPACEMENU="Työaluet" |
369 | XUTILSMENU="X-Ohjelmat" | 370 | XUTILSMENU="X-Ohjelmat" |
370 | ;; | 371 | ;; |
371 | ja_JP) #Japanese locales | 372 | ja_JP*) #Japanese locales |
372 | #OFFICEMENU="Office" | 373 | #OFFICEMENU="Office" |
373 | BROWSERMENU="¥Ö¥é¥¦¥¶" | 374 | BROWSERMENU="¥Ö¥é¥¦¥¶" |
374 | CONFIGUREMENU="ÀßÄê" | 375 | CONFIGUREMENU="ÀßÄê" |
@@ -389,7 +390,7 @@ case ${LC_ALL} in | |||
389 | WORKSPACEMENU="¥ï¡¼¥¯¥¹¥Ú¡¼¥¹" | 390 | WORKSPACEMENU="¥ï¡¼¥¯¥¹¥Ú¡¼¥¹" |
390 | XUTILSMENU="X¥æ¡¼¥Æ¥£¥ê¥Æ¥£" | 391 | XUTILSMENU="X¥æ¡¼¥Æ¥£¥ê¥Æ¥£" |
391 | ;; | 392 | ;; |
392 | fr_FR) # french locales | 393 | fr_FR*) # french locales |
393 | #OFFICEMENU="Office" | 394 | #OFFICEMENU="Office" |
394 | BROWSERMENU="Navigateurs" | 395 | BROWSERMENU="Navigateurs" |
395 | CONFIGUREMENU="Configurer" | 396 | CONFIGUREMENU="Configurer" |
@@ -410,7 +411,7 @@ case ${LC_ALL} in | |||
410 | WORKSPACEMENU="Liste des bureaux" | 411 | WORKSPACEMENU="Liste des bureaux" |
411 | XUTILSMENU="X-utils" | 412 | XUTILSMENU="X-utils" |
412 | ;; | 413 | ;; |
413 | it_IT|it_IT@euro) # italian locales | 414 | it_IT*) # italian locales |
414 | #OFFICEMENU="Office" | 415 | #OFFICEMENU="Office" |
415 | BROWSERMENU="Browsers" | 416 | BROWSERMENU="Browsers" |
416 | CONFIGUREMENU="Configurazione" | 417 | CONFIGUREMENU="Configurazione" |
@@ -593,10 +594,13 @@ fi | |||
593 | find_it fluxkeys append "[exec] (FluxKeys) {fluxkeys}" | 594 | find_it fluxkeys append "[exec] (FluxKeys) {fluxkeys}" |
594 | find_it fluxmenu append "[exec] (FluxMenu) {fluxmenu}" | 595 | find_it fluxmenu append "[exec] (FluxMenu) {fluxmenu}" |
595 | # if gxmessage exitst use it; else use xmessage | 596 | # if gxmessage exitst use it; else use xmessage |
596 | find_it gxmessage append "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" | 597 | find_it gxmessage append \ |
598 | "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|gxmessage -file - -center}" | ||
597 | [ $? -ne 0 ] && \ | 599 | [ $? -ne 0 ] && \ |
598 | find_it xmessage append "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" | 600 | find_it xmessage append \ |
601 | "[exec] (Windowname) {xprop|grep WM_CLASS|cut -d \\\" -f 2|xmessage -file - -center}" | ||
599 | find_it fbrun append "[exec] (Run) {fbrun}" | 602 | find_it fbrun append "[exec] (Run) {fbrun}" |
603 | find_it fluxbox-generate_menu append "[exec] (Regen menu) {fluxbox-generate_menu $options}" | ||
600 | append_menu_end | 604 | append_menu_end |
601 | 605 | ||
602 | append "[reconfig] (${RELOADITEM})" | 606 | append "[reconfig] (${RELOADITEM})" |
@@ -613,3 +617,5 @@ append_menu_end | |||
613 | if [ ! "${REMOVE}" ];then | 617 | if [ ! "${REMOVE}" ];then |
614 | clean_up | 618 | clean_up |
615 | fi | 619 | fi |
620 | |||
621 | echo "Menu succesfully generated." | ||