summaryrefslogtreecommitdiff
path: root/util/fluxbox-generate_menu
diff options
context:
space:
mode:
Diffstat (limited to 'util/fluxbox-generate_menu')
-rwxr-xr-xutil/fluxbox-generate_menu17
1 files changed, 9 insertions, 8 deletions
diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu
index 1a92180..727177a 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.42 2003/08/02 14:26:45 rathnor Exp $ 25# $Id: fluxbox-generate_menu,v 1.43 2003/08/02 14:42:43 rathnor Exp $
26 26
27# 27#
28# Portability notes: 28# Portability notes:
@@ -142,8 +142,8 @@ append_menu_end() {
142 142
143menu_entry() { 143menu_entry() {
144 if [ -f "$1" ]; then 144 if [ -f "$1" ]; then
145 append "[exec] (`grep -v GenericName $* 2>/dev/null | grep Name= | cut -d = -f 2`) \ 145 append "[exec] (`grep -v GenericName \"$*\" 2>/dev/null | grep Name= | cut -d = -f 2`) \
146 {`grep -v TryExec $* 2>/dev/null| grep Exec= | cut -d = -f 2`}" 146 {`grep -v TryExec \"$*\" 2>/dev/null| grep Exec= | cut -d = -f 2`}"
147 fi 147 fi
148} 148}
149 149
@@ -163,6 +163,7 @@ menu_entry_dir() {
163# recursively build a menu from the listed directories 163# recursively build a menu from the listed directories
164# the dirs are merged 164# the dirs are merged
165recurse_dir_menu () { 165recurse_dir_menu () {
166 echo "recurse on $@"
166 ls "$@"/ 2>/dev/null | sort | uniq | while read name; do 167 ls "$@"/ 2>/dev/null | sort | uniq | while read name; do
167 for dir in "$@"; do 168 for dir in "$@"; do
168 if [ -n "$name" -a -d "$dir/$name" ]; then 169 if [ -n "$name" -a -d "$dir/$name" ]; then
@@ -863,19 +864,19 @@ append_menu_end
863# We'll only use this once 864# We'll only use this once
864ETCAPPLNK=/etc/X11/applnk 865ETCAPPLNK=/etc/X11/applnk
865# gnome menu 866# gnome menu
866if [ -d "${GNOME_PREFIX}/share/gnome/apps" -a "${GNOMEMENU}" ]; then 867if [ "${GNOMEMENU}" ]; then
867 append_submenu "${GNOMEMENUTEXT}" 868 append_submenu "${GNOMEMENUTEXT}"
868 recurse_dir_menu "${GNOME_PREFIX}/share/gnome/apps" ${ETCAPPLNK} 869 recurse_dir_menu "${GNOME_PREFIX}/share/gnome/apps" "$HOME/.gnome/apps" ${ETCAPPLNK}
869 append_menu_end 870 append_menu_end
870 ETCAPPLNK= 871 unset ETCAPPLNK
871fi 872fi
872 873
873# kde submenu 874# kde submenu
874if [ -d "${KDE_PREFIX}/share/applnk/" -a "${KDEMENU}" ]; then 875if [ -d "${KDE_PREFIX}/share/applnk/" -a "${KDEMENU}" ]; then
875 append_submenu "${KDEMENUTEXT}" 876 append_submenu "${KDEMENUTEXT}"
876 recurse_dir_menu "${KDE_PREFIX}/share/applnk" ${ETCAPPLNK} 877 recurse_dir_menu "${KDE_PREFIX}/share/applnk" "$HOME/.kde/share/applnk" ${ETCAPPLNK}
877 append_menu_end 878 append_menu_end
878 ETCAPPLNK= 879 unset ETCAPPLNK
879fi 880fi
880 881
881#User menu 882#User menu