#!/bin/sh # generate a wallpaper using wall_gen.sh using a random image from a directory # (including subdirectories; defaults to ~/Pictures/albums if no directory given) if [ $# -eq 0 ]; then IMG_DIR="$HOME/Pictures/albums" else IMG_DIR="$1" fi wall_gen.sh $(find "$IMG_DIR" -not -path '*/.*' -type f -printf "%p\n" | sort -R | sed -n '1p')