diff options
author | fluxgen <fluxgen> | 2002-12-17 16:42:20 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-12-17 16:42:20 (GMT) |
commit | bc9afac2de6bcb047f4d3d0908022f8890b207a0 (patch) | |
tree | 46515e726969db0e7ac0fcb82bbe17ee05c11819 /util/fluxbox-generate_menu | |
parent | 6fd4093d4c1ffb4f67899344094a08b59519fab5 (diff) | |
download | fluxbox-bc9afac2de6bcb047f4d3d0908022f8890b207a0.zip fluxbox-bc9afac2de6bcb047f4d3d0908022f8890b207a0.tar.bz2 |
update from Han
Diffstat (limited to 'util/fluxbox-generate_menu')
-rwxr-xr-x | util/fluxbox-generate_menu | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu index 2e3cac3..da7cfad 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.19 2002/12/16 11:34:06 fluxgen Exp $ | 25 | # $Id: fluxbox-generate_menu,v 1.20 2002/12/17 16:42:20 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 |
@@ -30,9 +30,15 @@ WHOAMI=`whoami` | |||
30 | # Functions | 30 | # Functions |
31 | display_usage() { | 31 | display_usage() { |
32 | cat <<EOF | 32 | cat <<EOF |
33 | 33 | Usage: fluxbox-generate_menu [-kgrB] [-t terminal] [-w url] [-b browser] | |
34 | Usage: fluxbox-generate_menu [-kgr] [-t terminal] [-w browser] | ||
35 | [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] | 34 | [-m menu-title] [-p /path] [-n /path] [-q /path] [-o /path] |
35 | EOF | ||
36 | } | ||
37 | |||
38 | display_help() { | ||
39 | display_usage | ||
40 | cat <<EOF | ||
41 | |||
36 | Options: | 42 | Options: |
37 | 43 | ||
38 | -k Insert a kde menu | 44 | -k Insert a kde menu |
@@ -40,7 +46,7 @@ Options: | |||
40 | -B enable backgroundmenu | 46 | -B enable backgroundmenu |
41 | 47 | ||
42 | -m Menu-title; default is "Fluxbox" | 48 | -m Menu-title; default is "Fluxbox" |
43 | -r Don't remove empty menu-entries; Better for templates. | 49 | -r Don't remove empty menu-entries; for templates. |
44 | -o Outputfile; default is ~/.fluxbox/menu | 50 | -o Outputfile; default is ~/.fluxbox/menu |
45 | -t Favourite terminal | 51 | -t Favourite terminal |
46 | -b Favourite browser | 52 | -b Favourite browser |
@@ -60,14 +66,6 @@ Options: | |||
60 | EOF | 66 | EOF |
61 | } | 67 | } |
62 | 68 | ||
63 | display_help() { | ||
64 | cat <<EOF | ||
65 | |||
66 | This program generates a menu-file for fluxbox. | ||
67 | Use fluxbox-generate_menu -h for brief usage instructions. | ||
68 | EOF | ||
69 | } | ||
70 | |||
71 | display_authors() { | 69 | display_authors() { |
72 | cat <<EOF | 70 | cat <<EOF |
73 | 71 | ||
@@ -167,9 +165,9 @@ while getopts ":Bkhragb:t:p:w:n:q:o:m:" COMMAND_LINE_ARGUMENT ; do | |||
167 | m) MENUTITLE=${OPTARG} ;; | 165 | m) MENUTITLE=${OPTARG} ;; |
168 | w) HOMEPAGE=${OPTARG} ;; | 166 | w) HOMEPAGE=${OPTARG} ;; |
169 | r) REMOVE=no ;; | 167 | r) REMOVE=no ;; |
170 | h) display_usage ; exit 0 ;; | 168 | h) display_help ; exit 0 ;; |
171 | a) display_authors ; exit 0 ;; | 169 | a) display_authors ; exit 0 ;; |
172 | *) display_help ; exit 1 ;; | 170 | *) display_usage ; exit 1 ;; |
173 | esac | 171 | esac |
174 | done | 172 | done |
175 | 173 | ||
@@ -488,8 +486,22 @@ case ${LC_ALL} in | |||
488 | esac | 486 | esac |
489 | 487 | ||
490 | # Start of menu | 488 | # Start of menu |
489 | cat << EOF > ${FILENAME} | ||
490 | # Generated by fluxbox-genereate_menu | ||
491 | # | ||
492 | # If you read this it means you want to edit this file manualy, | ||
493 | # so here are some usefull tips: | ||
494 | # | ||
495 | # - The -r option prevents removing of empty menu entries and makes | ||
496 | # thing much more readable. | ||
497 | # | ||
498 | # - To prevent any other app from overwriting your menu | ||
499 | # you can change the menu name in .fluxbox/init to: | ||
500 | # session.menuFile: /home/you/.fluxbox/my-menu | ||
501 | |||
502 | EOF | ||
491 | 503 | ||
492 | echo "[begin] (${MENUTITLE})" > ${FILENAME} | 504 | echo "[begin] (${MENUTITLE})" >> ${FILENAME} |
493 | 505 | ||
494 | 506 | ||
495 | append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" | 507 | append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" |