update from Han

This commit is contained in:
fluxgen 2003-05-22 13:10:59 +00:00
parent 409e3ca38f
commit 33a65073a9

View file

@ -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