updated tasks to new paths

This commit is contained in:
Danilo Reyes 2025-10-02 21:31:13 -06:00
parent e9fc085de1
commit 9ab256ded7

View File

@ -1,7 +1,9 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash trashy fd ripgrep file jq curl
directories=("$HOME/Pictures/To Organize/" "$HOME/Downloads/" "$HOME/Downloads/cache")
directories=("$HOME/Pictures/unorganized/" "$HOME/Downloads/" "$HOME/Downloads/cache")
screenshots_dir=$HOME/Pictures/screenshots/
photos_dir=$HOME/Pictures/photos/camera/
replace_extension() {
local file_basename
@ -45,12 +47,11 @@ while IFS= read -r file; do
if ! basename "$file" | rg -q 'Screenshot_\d{8}'; then
continue
fi
echo "moving screenshot $file into $HOME/Pictures/Screenshots/"
command mv -n "$file" "$HOME/Pictures/Screenshots/"
echo "moving screenshot $file into $screenshots_dir"
command mv -n "$file" "$screenshots_dir"
done < <(fd . "${directories[@]}" -d 1 -tf --absolute-path)
# screenshots=$HOME/Pictures/Screenshots
classify_directories=("$HOME/Pictures/Screenshots" "$HOME/Pictures/Photos/Camera")
classify_directories=("$screenshots_dir" "$photos_dir")
if (($(fd . "${classify_directories[@]}" -tf -d 1 | wc -l) > 0)); then
while IFS= read -r file; do
date=$(stat -c "%y" "$file" | rg -o "\d{4}-\d{2}-\d{2}")
@ -101,7 +102,7 @@ while IFS= read -r game_dir; do
continue
fi
# Modify this to store your screenshots somewhere else
dir_dest=$(realpath "$HOME/Pictures/Screenshots/Games")/"$game_name"
dir_dest=$(realpath "$screenshots_dir/Games")/"$game_name"
dir_game=$(realpath "$dir_steam")/"$game_id"/screenshots
# If there are not screenshots currently stored, why bother lol
if ! [[ -d $dir_game ]]; then
@ -120,7 +121,7 @@ cyberpunk_dir=$HOME/Games/gog/cyberpunk-2077/drive_c/users/jawz/Pictures/"Cyberp
if [[ -d $cyberpunk_dir ]]; then
while IFS= read -r file; do
echo "Moving cyberpunk screenshots $(basename "$file")"
command mv -n "$file" "$HOME/Pictures/Screenshots/Games/Cyberpunk 2077/"
command mv -n "$file" "$screenshots_dir/Games/Cyberpunk 2077/"
done < <(fd . "$cyberpunk_dir" -tf)
fi