Skip to content

Instantly share code, notes, and snippets.

@davawen
Last active September 10, 2023 11:21
Show Gist options
  • Save davawen/bdaa0f83343c512f3400973ffbc98f25 to your computer and use it in GitHub Desktop.
Save davawen/bdaa0f83343c512f3400973ffbc98f25 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Distributed with the MIT License (https://mit-license.org/)
# Launches satisfactory and syncs savefiles to S3 storage on exit
# Put this script anywhere you like such as ~/.local/bin/
# Make sure to make it executable with `chmod +x sync_saves.sh`
# You need to create an S3 bucket named satisfactory
# For exemple, you can use https://filebase.com/
# You need s3cmd to be installed and configured:
# Installation:
# From the AUR: https://aur.archlinux.org/packages/s3cmd-git
# Otherwise, manual installation:
# wget https://github.com/s3tools/s3cmd/releases/download/v2.2.0/s3cmd-2.2.0.tar.gz
# tar -xzvf s3cmd-2.2.0.tar.gz
# cd s3cmd-2.2.0
# sudo python3 ./setup.py install
# Configuration:
# Read https://docs.filebase.com/third-party-tools-and-clients/cli-tools/bash/backup-files-to-ipfs-with-bash#3.-next-configure-s3cmd-for-use-with-filebase
# Finally, to run the script:
# Launch the game as `<PATH_TO_SCRIPT> <WINEPREFIX> %command%`
# Prefix folder is the folder that contains `pfx`
# On steam:
# Put the command in the launch arguments
# Prefix is: `<STEAMFOLDER>/steamapps/compatdata/<APPID>`
PREFIX=$1
SAVEDIR="$PREFIX/pfx/drive_c/users/steamuser/AppData/Local/FactoryGame/Saved/SaveGames"
shift
# Launch input command
"$@"
# Sync save files
if [ -d "$SAVEDIR" ]; then
notify-send "Syncing Satisfactory saves"
s3cmd sync "$SAVEDIR" "s3://satisfactory/SaveGames/"
notify-send "Finished syncing Satisfactory saves"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment