Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2023 05:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Randomly shuffle over 20 images script
# Assuming this Wallpapers folder is a nas mount
# Create temporary directory if it doesn't exist
mkdir -p $TMP_DIR
# Check if the temporary directory is empty
if [ -z "$(ls -A $TMP_DIR)" ]; then
# Find and copy 20 random images to the temporary directory
find $IMAGE_DIR -type f \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.png -o -iname \*.gif \) | shuf -n $NUM_IMAGES | xargs -I {} cp {} $TMP_DIR
# Set wallpaper using feh
feh --bg-max --randomize $TMP_DIR/*
# Optional: You might want to remove the copied images from /tmp after some time
# rm -f $TMP_DIR/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment