aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/fluxbox-generate_menu42
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
27WHOAMI=`whoami` 27WHOAMI=`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
31display_usage() { 31display_usage() {
32 cat <<EOF 32 cat <<EOF
33 33Usage: fluxbox-generate_menu [-kgrB] [-t terminal] [-w url] [-b browser]
34Usage: 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]
35EOF
36}
37
38display_help() {
39 display_usage
40 cat <<EOF
41
36Options: 42Options:
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:
60EOF 66EOF
61} 67}
62 68
63display_help() {
64 cat <<EOF
65
66This program generates a menu-file for fluxbox.
67Use fluxbox-generate_menu -h for brief usage instructions.
68EOF
69}
70
71display_authors() { 69display_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
174done 172done
175 173
@@ -488,8 +486,22 @@ case ${LC_ALL} in
488esac 486esac
489 487
490# Start of menu 488# Start of menu
489cat << 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
502EOF
491 503
492echo "[begin] (${MENUTITLE})" > ${FILENAME} 504echo "[begin] (${MENUTITLE})" >> ${FILENAME}
493 505
494 506
495append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}" 507append "[exec] (${DEFAULT_TERM}) {${DEFAULT_TERM}}"