Created
April 8, 2020 21:41
-
-
Save ghostrydr/fb7b017f5901a13a64a824862c5332dc to your computer and use it in GitHub Desktop.
Aggregate and symlink images from subdirectories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage | |
# --------- | |
# ./aggregate-desktop-bgs /path/to/source /path/to/target | |
# then set deskto background to pull from /path/to/target in system settings | |
# default values | |
SOURCE=${1-~/Pictures/desktops} | |
TARGET=${2-~/Pictures/aggregated-bgs} | |
HIDDEN=${3-.hidden} | |
# clear directory | |
find $TARGET -type l -delete | |
# link desired files | |
find $SOURCE -name $HIDDEN -prune -o -regex '.*\.jpe*g' -exec ln -s {} $TARGET \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment