diff --git a/base/.config/systemd/user/autocategorize b/base/.config/systemd/user/autocategorize index 35c16f10..df51f6b3 100755 --- a/base/.config/systemd/user/autocategorize +++ b/base/.config/systemd/user/autocategorize @@ -9,6 +9,34 @@ userdirs="${XDG_CONFIG_DIR:-$HOME/.config}"/user-dirs.dirs downloaddir="${XDG_DOWNLOAD_DIR:-$HOME/Downloads}" documentsdir="${XDG_DOCUMENTS_DIR:-$HOME/Documents}" picturesdir="${XDG_PICTURES_DIR:-$HOME/Pictures}" +videosdir="${XDG_VIDEOS_DIR:-$HOME/Videos}" + +# Take loose crap out of the home folder +echo "Sorting away videos from homedir..." +find "$HOME" \ + -maxdepth 1 \ + -type f \ + \( \ + -iname "*.mov" -or \ + -iname "*.webm" -or \ + -iname "*.mkv" -or \ + -iname "*.mp4" \ + \) \ + -print \ + -exec mv {} "$videosdir" \; +echo "Sorting away pictures from homedir..." +find "$HOME" \ + -maxdepth 1 \ + -type f \ + \( \ + -iname "*.jpg" -or \ + -iname "*.jpeg" -or \ + -iname "*.gif" -or \ + -iname "*.png" -or \ + -iname "*.webp" \ + \) \ + -print \ + -exec mv {} "$picturesdir" \; # Sort out downloads [ -e "$downloaddir" ] && { @@ -17,8 +45,10 @@ picturesdir="${XDG_PICTURES_DIR:-$HOME/Pictures}" echo "Sorting out books..." find "$downloaddir" \ -type f \ + \( \ -iname "*.epub" -or \ -iname "*.mobi" \ + \) \ -print \ -exec mv {} ~/Books \; fi