diff --git a/configs/scripts/fetch-steamdeck-screenshots b/configs/scripts/fetch-steamdeck-screenshots new file mode 100755 index 0000000..2e758e7 --- /dev/null +++ b/configs/scripts/fetch-steamdeck-screenshots @@ -0,0 +1,38 @@ +#! /bin/bash +set -e + +# If no arguments are given, print usage and exit +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Prepare the script to run on the remote host +cat < /tmp/steamdeck-screenshot.sh +#!/bin/bash +set -e + +# Clean the screenshots directory +rm -rf /tmp/screenshot-bundle || true +mkdir -p /tmp/screenshot-bundle + +# Copy all screenshots to the bundle directory +IMAGES=\$(find /home/deck/.local/share/Steam/userdata | grep "screenshots/[0-9]") +for pathname in \$IMAGES; do + echo "Copying \$pathname" + cp --preserve=timestamps "\$pathname" /tmp/screenshot-bundle +done + +# Compress the bundle directory +tar -czf /tmp/screenshot-bundle.tar.gz /tmp/screenshot-bundle +EOF + +# Copy the script to the remote host +scp /tmp/steamdeck-screenshot.sh $1:/tmp/steamdeck-screenshot.sh + +# Run the script on the remote host +ssh $1 bash /tmp/steamdeck-screenshot.sh + +# Copy the bundle from the remote host +TIMESTAMP=$(date +%Y%m%d-%H%M%S) +scp $1:/tmp/screenshot-bundle.tar.gz ~/Downloads/steamdeck_screenshots_${TIMESTMAP}.tar.gz \ No newline at end of file diff --git a/install.conf.yaml b/install.conf.yaml index d795d26..bb59093 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -24,10 +24,14 @@ ~/bin/aspath: path: configs/scripts/aspath mode: 755 + ~/bin/fetch-steamdeck-screenshots: + path: configs/scripts/fetch-steamdeck-screenshots + mode: 755 - shell: - [git submodule update --init --recursive, Installing submodules] - [sh ./helpers/install-ssh-config.sh, Installing SSH config] - [chmod +x configs/scripts/catto, Making catto executable] - [chmod +x configs/scripts/aspath, Making aspath executable] + - [chmod +x configs/scripts/fetch-steamdeck-screenshots, Making fetch-steamdeck-screenshots executable] - [sh ./helpers/configure-gnome.sh, Configuring GNOME] \ No newline at end of file