Skip to content

Instantly share code, notes, and snippets.

@smo0z
Last active November 4, 2024 19:20
Show Gist options
  • Save smo0z/620d9d98e27dbba01345a5b21948f545 to your computer and use it in GitHub Desktop.
Save smo0z/620d9d98e27dbba01345a5b21948f545 to your computer and use it in GitHub Desktop.
Proton Launch Script
#!/bin/sh
# Application path
APP_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd "$APP_PATH"
# Executable file
APP_EXEC="$APP_PATH/.exe"
# Steam / IDs
export SteamAppId=""
export SteamGameId=""
# Steam / Client path
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam/steam"
# Steam / Apps path
STEAM_APPS_PATH="$STEAM_COMPAT_CLIENT_INSTALL_PATH/steamapps"
# Steam / Compat data path
export STEAM_COMPAT_DATA_PATH="$STEAM_APPS_PATH/compatdata/$SteamAppId"
# Proton / Path
PROTON_PATH="$STEAM_APPS_PATH/common/Proton 4.11"
# Proton / Executable script
PROTON_EXEC="$PROTON_PATH/proton"
python "$PROTON_EXEC" run "$APP_EXEC"
@lunalucadou
Copy link

This script is nice, but it doesn't work if you are attempting to launch a game stored on a Steam library folder outside of the home directory default library.
It also does not use best practices with regards to variable expansion.

To deal with this, I took the liberty of forking the script. For anyone interested in launching games on external Steam libraries (or just a more robust script in general), check it out here:

https://gist.github.com/lunalucadou/132a84d6e5d248847f9e90160f7789d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment