Last active
February 13, 2023 19:05
-
-
Save sackeyjason/484a758f78be09f6b957b5d0bfb98a94 to your computer and use it in GitHub Desktop.
SteamDeck screenshot management
This file contains 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
#!/bin/bash | |
# Store the user_id in a variable | |
user_id=0 | |
# Store the provided date in a variable | |
input_date=$1 | |
# Get the current date in the format yyyy-mm-dd | |
current_date=$(date +%F) | |
# Create a new directory in ~/Pictures with the current date as its name | |
mkdir ~/Pictures/$current_date | |
# Define the path to the screenshots directory | |
screenshots_dir="/home/deck/.local/share/Steam/userdata/$user_id/760/remote/" | |
# Loop through all the subdirectories in the screenshots directory | |
for dir in $screenshots_dir/*/; do | |
# Get the name of the subdirectory | |
subdir_name=$(basename "$dir") | |
# Go to the "screenshots" directory within each subdirectory | |
cd "$dir/screenshots" | |
# Find all the jpg files newer than the provided date | |
for file in $(find . -name "*.jpg" -newermt $input_date); do | |
# Copy each file to the newly created directory in ~/Pictures | |
cp "$file" ~/Pictures/$current_date/"$subdir_name-$(basename "$file")" | |
done | |
done |
This file contains 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
#!/bin/bash | |
# This script is used to copy all the JPG files in the Steam screenshots directory that are newer than a provided date. | |
# The Steam screenshots directory is located at "/home/deck/.local/share/Steam/userdata/XXXXXXX/760/remote/", where XXXXXXX is the user's ID. | |
# The script copies each JPG file to a new directory in the user's Pictures folder, which is named after the current date. | |
# Each copied file is renamed with a filename that is prepended with the subdirectory name in which the original file was located. | |
user_id=XXXXXXX | |
input_date=$1 | |
current_date=$(date +%F) | |
mkdir ~/Pictures/$current_date | |
screenshots_dir="/home/deck/.local/share/Steam/userdata/$user_id/760/remote/" | |
for dir in $screenshots_dir/*/; do | |
subdir_name=$(basename "$dir") | |
cd "$dir/screenshots" | |
for file in $(find . -maxdepth 1 -name "*.jpg" -newermt $input_date); do | |
cp "$file" ~/Pictures/$current_date/"$subdir_name-$(basename "$file")" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment