Created
December 7, 2023 19:41
-
-
Save shmup/4e7050d50e1db2e9fc4071bf31efa934 to your computer and use it in GitHub Desktop.
easily run an .exe with proton on linux
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # This script launches a Windows executable using Proton within a Linux environment. | |
| # It requires exactly one argument: the path to the executable to run. | |
| # It sets up a separate Proton prefix for each executable to avoid conflicts. | |
| # Usage: proton <path-to-executable> | |
| if [ "$#" -ne 1 ]; then | |
| echo "Usage: $0 <executable-path>" | |
| exit 1 | |
| fi | |
| PROTON_ROOT="$HOME/.proton" | |
| STEAM_ROOT="$HOME/.steam/root" | |
| PROTON_VER="Proton - Experimental" | |
| GAME_ROOT="$(dirname "$1")" | |
| GAME="$(basename "$1")" | |
| cd "$GAME_ROOT" || exit | |
| mkdir -p "$PROTON_ROOT/$GAME" | |
| export STEAM_COMPAT_DATA_PATH="$PROTON_ROOT/$GAME" | |
| export STEAM_COMPAT_CLIENT_INSTALL_PATH="$STEAM_ROOT" | |
| "$STEAM_ROOT/steamapps/common/$PROTON_VER/proton" run "$1" >/dev/null 2>&1 |
I just want to say that this works like a charm!
In case it does break in the future, it will most likely be due to the hardcoded Proton - Experimental variable (e.g. due to name changes).
If the script does not work for you, paste the following command in the terminal and replace the value of PROTON_VER with your preferred Proton version:
ls -1 ~/.steam/root/steamapps/common/ | grep 'Proton'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got here from google- this still works, thank you!