From e4b63778369c461980720bf345e95eb8e13579c2 Mon Sep 17 00:00:00 2001 From: fluxgen <fluxgen> Date: Fri, 24 May 2002 13:19:45 +0000 Subject: fixed so it runs on SunOS --- data/fluxbox-generate_menu | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/data/fluxbox-generate_menu b/data/fluxbox-generate_menu index 8b0fc30..6f40320 100755 --- a/data/fluxbox-generate_menu +++ b/data/fluxbox-generate_menu @@ -69,21 +69,21 @@ find_it() { } append() { - echo " $*" >> $FILENAME + echo " $*" >> ${FILENAME} } append_menu() { - echo "$*" >> $FILENAME + echo "$*" >> ${FILENAME} } append_submenu() { - echo >> $FILENAME + echo >> ${FILENAME} append_menu "[submenu] ($1)" } append_menu_end() { append_menu "[end]" - echo >> $FILENAME + echo >> ${FILENAME} } menu_entry() { @@ -150,19 +150,30 @@ done # Set Defaults # menufile name and make a backup -[ ! $FILENAME ] && FILENAME=~/.fluxbox/menu -[ -e $FILENAME ] && cp -f $FILENAME ${FILENAME}.bak +if [ -z ${FILENAME} ]; then + FILENAME=~/.fluxbox/menu +fi + +if [ ! -z ${FILENAME} ]; then + if [ -w ${FILENAME} ]; then + cp -f ${FILENAME} ${FILENAME}.bak + fi +fi #packagedatadir -[ ! $PKGDATADIR ] && PKGDATADIR=/usr/share +if [ -z "${PKGDATADIR}" ]; then + PKGDATADIR=/usr/share +fi # menutitle -[ ! $MENUTITLE ] && MENUTITLE="Fluxbox" +if [ -z "${MENUTITLE}" ]; then + MENUTITLE="Fluxbox" +fi # Start of menu -echo "[begin] ($MENUTITLE)" > $FILENAME +echo "[begin] ($MENUTITLE)" > ${FILENAME} find_it xterm append "[exec] (xterm) {xterm -fg white -bg black}" find_it nedit append "[exec] (nedit) {nedit}" @@ -298,7 +309,7 @@ if [ -d $PKGDATADIR/applnk/ ] && [ $KDEMENU ]; then fi -append_submenu Settings +append_submenu FB-Settings append "[workspaces] (Workspace List)" append_menu "[submenu] (Styles) {Choose a style...}" -- cgit v0.11.2