#!/bin/sh

if [ -z "$1" ]; then
	file=$(find -L "$XDG_PICTURES_DIR/wallpapers" -type f | shuf -n 1)
else
	file=$(find -L "$@" -maxdepth 1 -type f | shuf -n 1)
fi

display -resize "${SCR_WIDTH}x$SCR_HEIGHT" -backdrop -window root "$file"