From a795d9612c44e675726e560d4a33ccb890606f86 Mon Sep 17 00:00:00 2001 From: mathias Date: Wed, 5 Jan 2005 05:57:12 +0000 Subject: added imlib2-check so fbgm would prefer *.png over *.xpm when trying to find icons --- util/fluxbox-generate_menu.in | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in index 24f8627..7322061 100755 --- a/util/fluxbox-generate_menu.in +++ b/util/fluxbox-generate_menu.in @@ -47,6 +47,13 @@ WHOAMI=`whoami` [ "$WHOAMI" = root ] && PATH=/bin:/usr/bin/:/usr/local/bin:/usr/X11R6/bin +# Check for Imlib2-support +if ( fluxbox -info 2> /dev/null | grep -- -IMLIB ); then + PNG_ICONS="no" +else + PNG_ICONS="yes" +fi + # Functions display_usage() { cat << EOF @@ -146,10 +153,20 @@ append() { if [ -z "${INSTALL}" ]; then echo -n " $*" >> ${MENUFILENAME} execname="`echo $*|cut -d\( -f2|cut -d\) -f1`" - if [ -r "${HOME}/.fluxbox/icons/$execname.xpm" ]; then - echo "<${HOME}/.fluxbox/icons/$execname.xpm>" >> ${MENUFILENAME} + if [ "${PNG_ICONS}" = "no" ]; then + if [ -r "${HOME}/.fluxbox/icons/$execname.xpm" ]; then + echo "<${HOME}/.fluxbox/icons/$execname.xpm>" >> ${MENUFILENAME} + else + echo >> ${MENUFILENAME} + fi else - echo >> ${MENUFILENAME} + if [ -r "${HOME}/.fluxbox/icons/$execname.png" ]; then + echo "<${HOME}/.fluxbox/icons/$execname.png>" >> ${MENUFILENAME} + elif [ -r "${HOME}/.fluxbox/icons/$execname.xpm" ]; then + echo "<${HOME}/.fluxbox/icons/$execname.xpm>" >> ${MENUFILENAME} + else + echo >> ${MENUFILENAME} + fi fi else echo " $*" >> ${MENUFILENAME} -- cgit v0.11.2