Skip to content

Instantly share code, notes, and snippets.

@bgoewert
Created July 10, 2023 23:04
Show Gist options
  • Save bgoewert/6d49acec4d14085e995d96fee74b7dd1 to your computer and use it in GitHub Desktop.
Save bgoewert/6d49acec4d14085e995d96fee74b7dd1 to your computer and use it in GitHub Desktop.
Linux Create Date Organized Screenshot Sub-Folders
# https://unix.stackexchange.com/a/24955/528905
# Requires inotify-tools and libnotify-bin
inotifywait -m ~/Pictures/Screenshots -e create |
while read dir action file; do
if [ -f "$dir$file" ]; then
sspath="$dir$(date -I)"
if [ ! -d $sspath ]; then
mkdir $sspath
notify-send "New Screenshot Folder Created" "\"$sspath\""
fi
mv "$dir$file" "$sspath/$file"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment