-
-
Save shmup/4e7050d50e1db2e9fc4071bf31efa934 to your computer and use it in GitHub Desktop.
| #!/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 | |
| # determine where your proton binary is, the below assumes default Steam location. | |
| # then update STEAM_ROOT and PROTON_VER | |
| PROTON_ROOT="$HOME/.proton" | |
| PROTON_VER="Proton - Experimental" | |
| STEAM_ROOT="$HOME/.steam/root" # expects: steamapps/common/$PROTON_VER/proton | |
| 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'Working super nicely. One thing is that you need to set the steam root path to where YOUR PROTON IS, this is usually the default, but if you're like me and moved the library to a dedicated SSD, then you need to change it, and it won't include root, it will just be whatever/mnt/you/have/SteamApps/common/<proton ver>/proton
Appreciate it @khaosdoctor , updated w/ comments
I just wanna say: Thank you so much!! This works perfectly. It's amazing! As a new linux user, I feel like a genius opening a .exe like I'm in Windows. But your're the true genius here. What a nice script!! Thaaank yooou!
I got here from google- this still works, thank you!