aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-28 18:39:11 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-09-03 18:08:14 (GMT)
commit2cfffee19b9848a9e39e6149cbd97e23e7adddbc (patch)
tree602cbfd6ac694262c4aa891064444b2039f10c3c
parentdb97f28e2528606cbe3cb8621ec7f8405c1f1b5d (diff)
downloadfluxbox-2cfffee19b9848a9e39e6149cbd97e23e7adddbc.zip
fluxbox-2cfffee19b9848a9e39e6149cbd97e23e7adddbc.tar.bz2
handle subdirs and symlinks in $wallpaperdir
Thanks for the base patch, kindly provided by some Anonymous coward on the bugtracker ;-) BUG: 1065
-rw-r--r--util/fbsetbg6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index 0cf9cfb..fb6f3af 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -511,7 +511,9 @@ if [ "$option" = random ]; then
511 exit 1 511 exit 1
512 fi 512 fi
513 if [ -d "$wallpaperdir" ]; then 513 if [ -d "$wallpaperdir" ]; then
514 number_of_wallpapers=`ls "$wallpaperdir"|wc -l` 514 cd "$wallpaperdir"
515 available_wallpapers=`find -L -type f ! -regex '.*/\..*'`
516 number_of_wallpapers=`echo "$available_wallpapers" | wc -l`
515 if find_it random_number; then 517 if find_it random_number; then
516 randomnumber=`random_number` 518 randomnumber=`random_number`
517 # some shells don't support $RANDOM 519 # some shells don't support $RANDOM
@@ -531,7 +533,7 @@ if [ "$option" = random ]; then
531 fi 533 fi
532 remember=false 534 remember=false
533 #set -x 535 #set -x
534 wallpaper="$wallpaperdir/`ls \"$wallpaperdir\"|sed -n ${wallpapernumber}p`" 536 wallpaper="`echo "$available_wallpapers" | sed -n ${wallpapernumber}p`"
535 option=$option2 # have to choose something... 537 option=$option2 # have to choose something...
536 else 538 else
537 message "Invalid random wallpaper directory specified: '$wallpaperdir'." 539 message "Invalid random wallpaper directory specified: '$wallpaperdir'."