aboutsummaryrefslogtreecommitdiff
path: root/util/fluxbox-generate_menu
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-06 02:18:34 (GMT)
committerrathnor <rathnor>2003-06-06 02:18:34 (GMT)
commit6d91153212f2215042d3c91631f2b11329bfc226 (patch)
treeb6fdd28af4d33dc5bf30ef648c382866d6902e40 /util/fluxbox-generate_menu
parent49c57942f36e0f01fd80313a4095be9e0b757704 (diff)
downloadfluxbox-6d91153212f2215042d3c91631f2b11329bfc226.zip
fluxbox-6d91153212f2215042d3c91631f2b11329bfc226.tar.bz2
some updates from Han
Diffstat (limited to 'util/fluxbox-generate_menu')
-rwxr-xr-xutil/fluxbox-generate_menu70
1 files changed, 41 insertions, 29 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu
index 47f3c76..c9177cf 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.35 2003/05/22 13:10:59 fluxgen Exp $ 25# $Id: fluxbox-generate_menu,v 1.36 2003/06/06 02:18:34 rathnor Exp $
26 26
27# 27#
28# Portability notes: 28# Portability notes:
@@ -72,9 +72,9 @@ Options:
72 72
73 Only for packagers: 73 Only for packagers:
74 74
75 -p Package-datadir; default is /usr/share 75 -p Package-datadir; /usr/local/share
76 -n Gnome-datadir; default is Package-datadir 76 -n Gnome-datadir
77 -q KDE-datadir; default is Package-datadir 77 -q KDE-datadir
78 78
79 79
80Files: 80Files:
@@ -526,7 +526,11 @@ if [ ! "${INSTALL}" = "Yes" ];then
526# location with your own menu-entries 526# location with your own menu-entries
527# USERMENU=~/.fluxbox/usermenu 527# USERMENU=~/.fluxbox/usermenu
528 528
529# Boolean variables. 529# Sepparate the list of background-dirs with semicolumns ':'
530# BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:/usr/local/share/fluxbox/backgrounds/:/usr/share/wallpapers"
531
532
533# --- Boolean variables.
530# Setting a variable to no won't help. Comment them out if you don't want them. 534# Setting a variable to no won't help. Comment them out if you don't want them.
531# Setting are overruled by the command-line options. 535# Setting are overruled by the command-line options.
532 536
@@ -613,6 +617,10 @@ if [ ! -d "${KPKGDATADIR}" -o -z "${KPKGDATADIR}" ]; then
613 KPKGDATADIR=${PKGDATADIR} 617 KPKGDATADIR=${PKGDATADIR}
614fi 618fi
615 619
620# directory for the backgrounds
621if [ -z "$BACKGROUND_DIRS" ]; then
622 BACKGROUND_DIRS="${HOME}/.fluxbox/backgrounds/:${PKGDATADIR}/fluxbox/backgrounds/"
623fi
616 624
617# find the default terminal 625# find the default terminal
618find_it $MY_TERM 626find_it $MY_TERM
@@ -635,7 +643,7 @@ find_it $MY_BROWSER
635if [ $? -ne 0 ]; then 643if [ $? -ne 0 ]; then
636 [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2 644 [ -n "$MY_BROWSER" ] && echo "Warning: you chose an invalid browser." >&2
637 #The precise order is up for debate. 645 #The precise order is up for debate.
638 for browser in firebird opera skipstone phoenix mozilla galeon konqueror dillo netscape links w3m lynx; do 646 for browser in MozillaFirebird firebird opera skipstone phoenix mozilla galeon konqueror dillo netscape links w3m lynx; do
639 if find_it $browser; then 647 if find_it $browser; then
640 DEFAULT_BROWSER=$browser 648 DEFAULT_BROWSER=$browser
641 break 649 break
@@ -768,7 +776,7 @@ append_submenu "${MULTIMEDIAMENU}"
768 append_menu_end 776 append_menu_end
769 777
770 append_submenu "${XUTILSMENU}" 778 append_submenu "${XUTILSMENU}"
771 normal_find xfontsel xman xload xfigxbiff editres viewres xclock xmag wmagnify 779 normal_find xfontsel xman xload xfigxbiff editres viewres xclock xmag wmagnify gkrellm
772 append_menu_end 780 append_menu_end
773append_menu_end 781append_menu_end
774 782
@@ -854,32 +862,36 @@ append_submenu "${FBSETTINGSMENU}"
854 picturename=`basename "$1"` 862 picturename=`basename "$1"`
855 append "[exec] (${picturename%.???}) {fbsetbg -f \"$1\" }" 863 append "[exec] (${picturename%.???}) {fbsetbg -f \"$1\" }"
856 } 864 }
865
857 if [ "$BACKGROUNDMENUITEM" = "yes" ]; then 866 if [ "$BACKGROUNDMENUITEM" = "yes" ]; then
858 [ -d ${HOME}/.fluxbox/backgrounds/ ] && \ 867 IFS=: # set delimetor for find
859 BACKGROUNDS="${HOME}/.fluxbox/backgrounds/*" 868 NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2>/dev/null|wc -l`
860 [ -d ${PKGDATADIR}/fluxbox/backgrounds/ ] && \ 869 if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then
861 BACKGROUNDS="${BACKGROUNDS} ${PKGDATADIR}/fluxbox/backgrounds/*" 870 append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}"
862 append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" 871 if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then
863 if [ `ls -1 ${BACKGROUNDS} 2>/dev/null |wc -l` -gt 30 ]; then 872 menucounter=1 ; counter=1
864 menucounter=1 ; counter=1 873 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
865 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" 874 find $BACKGROUND_DIRS -follow -type f|sort|while read i; do
866 for i in ${BACKGROUNDS} ; do 875 counter=`expr $counter + 1`
867 counter=`expr $counter + 1` 876 if [ $counter -eq 30 ]; then
868 if [ $counter -eq 30 ]; then 877 counter=1
869 counter=1 878 menucounter=`expr $menucounter + 1`
870 menucounter=`expr $menucounter + 1` 879 append_menu_end
871 append_menu_end 880 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"
872 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" 881 fi
873 fi 882 addbackground "$i"
874 addbackground $i 883 done
875 done 884 append_menu_end
885 else
886 find $BACKGROUND_DIRS -follow -type f|sort|while read i; do
887 addbackground "$i"
888 done
889 fi
876 append_menu_end 890 append_menu_end
877 else 891 else
878 for i in ${BACKGROUNDS} ; do 892 echo "Warning: You wanted a background-menu but I couldn't find any backgrounds in:
879 addbackground $i 893 $BACKGROUND_DIRS"
880 done
881 fi 894 fi
882 append_menu_end
883 fi 895 fi
884 896
885 append "[workspaces] (${WORKSPACEMENU})" 897 append "[workspaces] (${WORKSPACEMENU})"