summaryrefslogtreecommitdiff
path: root/rand_wall.sh
diff options
context:
space:
mode:
authorhmj6502 <hashim@hmj6502.com>2025-12-28 20:16:20 +0000
committerhmj6502 <hashim@hmj6502.com>2025-12-28 20:35:35 +0000
commit968935e00f3dca2d0b64ca7eaf1b411c9ad1a344 (patch)
tree9d9eb4344c86323bdf84d09a85811683bf21d1b1 /rand_wall.sh
downloadalbum-wall-968935e00f3dca2d0b64ca7eaf1b411c9ad1a344.tar.gz
album-wall-968935e00f3dca2d0b64ca7eaf1b411c9ad1a344.tar.bz2
album-wall-968935e00f3dca2d0b64ca7eaf1b411c9ad1a344.zip
initial commit
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')