steamdeck screenshot fetcher
This commit is contained in:
parent
eef703140e
commit
4a91d11ffb
38
configs/scripts/fetch-steamdeck-screenshots
Executable file
38
configs/scripts/fetch-steamdeck-screenshots
Executable file
@ -0,0 +1,38 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
# If no arguments are given, print usage and exit
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <ssh_host>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prepare the script to run on the remote host
|
||||
cat <<EOF > /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
|
@ -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]
|
Loading…
x
Reference in New Issue
Block a user