#!/bin/sh

WALLDIR=$HOME/usr/pics/bg

setwall() {
    WALL=$(readlink -f $1)
    hsetroot -fill $WALL
    #hsetroot -fill $WALL -blur 8 -write $HOME/.blur.png
    ln -sf $WALL ~/.wall.png
}

test -n "$1" && setwall $1 && exit

find $WALLDIR -name '*.png' | meh -list | while read WALL; do
    setwall $WALL
done
