summaryrefslogtreecommitdiff
path: root/rand_wall.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rand_wall.sh')
-rwxr-xr-xrand_wall.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/rand_wall.sh b/rand_wall.sh
new file mode 100755
index 0000000..062d231
--- /dev/null
+++ b/rand_wall.sh
@@ -0,0 +1,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')