summaryrefslogtreecommitdiff
path: root/rand_wall.sh
blob: 062d231ecdc093ded4b2c1df136ffdc686fbda51 (plain)
1
2
3
4
5
6
7
8
9
10
#!/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')