Created
July 10, 2023 23:04
-
-
Save bgoewert/6d49acec4d14085e995d96fee74b7dd1 to your computer and use it in GitHub Desktop.
Linux Create Date Organized Screenshot Sub-Folders
This file contains hidden or 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
# 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