avoid using seq in awsetbg, and test for columns count argument of -m option.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Alexandre "kAworu" Perrin 2010-10-11 17:00:11 +02:00 committed by Uli Schlachter
parent bb52505bb8
commit 7c8e096a62
1 changed files with 15 additions and 8 deletions

View File

@ -218,14 +218,21 @@ while [ $# -gt 0 ]; do
montage=`which montage` montage=`which montage`
if test ! -z "$montage"; then if test ! -z "$montage"; then
shift shift
cols="$1"; shift if [ $# -eq 0 ]; then
fns="" echo "-m option need a columns argument"
for i in `seq $cols`; do exit # no more args
fns="$fns $1"; else
done; cols="$1"; shift
shift fns=""
$montage $fns -geometry +0+0 -tile ${cols}x $CONFIG_DIR/montage.png i=$cols
wallpaper=$CONFIG_DIR/montage.png while [ $i -gt 0 ]; do
fns="$fns $1"
i=$(($i - 1))
done
shift
$montage $fns -geometry +0+0 -tile ${cols}x $CONFIG_DIR/montage.png
wallpaper=$CONFIG_DIR/montage.png
fi
else else
shift shift
echo "montage not found. Falling back to single image" echo "montage not found. Falling back to single image"