From 33a65073a955d850f2a9601ea1368862b36959ff Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 22 May 2003 13:10:59 +0000 Subject: [PATCH] update from Han --- util/fluxbox-generate_menu | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/util/fluxbox-generate_menu b/util/fluxbox-generate_menu index 161cd324..47f3c76b 100755 --- a/util/fluxbox-generate_menu +++ b/util/fluxbox-generate_menu @@ -22,7 +22,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # -# $Id: fluxbox-generate_menu,v 1.34 2003/05/22 10:05:37 fluxgen Exp $ +# $Id: fluxbox-generate_menu,v 1.35 2003/05/22 13:10:59 fluxgen Exp $ # # Portability notes: @@ -850,12 +850,20 @@ append_submenu "${FBSETTINGSMENU}" append_menu_end # Backgroundmenu + addbackground() { + picturename=`basename "$1"` + append "[exec] (${picturename%.???}) {fbsetbg -f \"$1\" }" + } if [ "$BACKGROUNDMENUITEM" = "yes" ]; then + [ -d ${HOME}/.fluxbox/backgrounds/ ] && \ + BACKGROUNDS="${HOME}/.fluxbox/backgrounds/*" + [ -d ${PKGDATADIR}/fluxbox/backgrounds/ ] && \ + BACKGROUNDS="${BACKGROUNDS} ${PKGDATADIR}/fluxbox/backgrounds/*" append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" - if [ `ls -1 ${HOME}/.fluxbox/backgrounds 2>/dev/null |wc -l` -gt 30 ]; then + if [ `ls -1 ${BACKGROUNDS} 2>/dev/null |wc -l` -gt 30 ]; then menucounter=1 ; counter=1 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" - for i in ${HOME}/.fluxbox/backgrounds/* ${PKGDATADIR}/fluxbox/backgrounds/* ; do + for i in ${BACKGROUNDS} ; do counter=`expr $counter + 1` if [ $counter -eq 30 ]; then counter=1 @@ -863,14 +871,12 @@ append_submenu "${FBSETTINGSMENU}" append_menu_end append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}" fi - picturename=`basename "$i"` - append "[exec] (${picturename%.???}) {fbsetbg -f \"$i\" }" + addbackground $i done append_menu_end else - for i in ${HOME}/.fluxbox/backgrounds/* ${PKGDATADIR}/fluxbox/backgrounds/* ; do - picturename=`basename "$i"` - append "[exec] (${picturename%.???}) {fbsetbg -f \"$i\" }" + for i in ${BACKGROUNDS} ; do + addbackground $i done fi append_menu_end