updated tasks to new paths
This commit is contained in:
parent
e9fc085de1
commit
9ab256ded7
@ -1,7 +1,9 @@
|
|||||||
#! /usr/bin/env nix-shell
|
#! /usr/bin/env nix-shell
|
||||||
#! nix-shell -i bash -p bash trashy fd ripgrep file jq curl
|
#! 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() {
|
replace_extension() {
|
||||||
local file_basename
|
local file_basename
|
||||||
@ -45,12 +47,11 @@ while IFS= read -r file; do
|
|||||||
if ! basename "$file" | rg -q 'Screenshot_\d{8}'; then
|
if ! basename "$file" | rg -q 'Screenshot_\d{8}'; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "moving screenshot $file into $HOME/Pictures/Screenshots/"
|
echo "moving screenshot $file into $screenshots_dir"
|
||||||
command mv -n "$file" "$HOME/Pictures/Screenshots/"
|
command mv -n "$file" "$screenshots_dir"
|
||||||
done < <(fd . "${directories[@]}" -d 1 -tf --absolute-path)
|
done < <(fd . "${directories[@]}" -d 1 -tf --absolute-path)
|
||||||
|
|
||||||
# screenshots=$HOME/Pictures/Screenshots
|
classify_directories=("$screenshots_dir" "$photos_dir")
|
||||||
classify_directories=("$HOME/Pictures/Screenshots" "$HOME/Pictures/Photos/Camera")
|
|
||||||
if (($(fd . "${classify_directories[@]}" -tf -d 1 | wc -l) > 0)); then
|
if (($(fd . "${classify_directories[@]}" -tf -d 1 | wc -l) > 0)); then
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
date=$(stat -c "%y" "$file" | rg -o "\d{4}-\d{2}-\d{2}")
|
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
|
continue
|
||||||
fi
|
fi
|
||||||
# Modify this to store your screenshots somewhere else
|
# 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
|
dir_game=$(realpath "$dir_steam")/"$game_id"/screenshots
|
||||||
# If there are not screenshots currently stored, why bother lol
|
# If there are not screenshots currently stored, why bother lol
|
||||||
if ! [[ -d $dir_game ]]; then
|
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
|
if [[ -d $cyberpunk_dir ]]; then
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
echo "Moving cyberpunk screenshots $(basename "$file")"
|
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)
|
done < <(fd . "$cyberpunk_dir" -tf)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user