-
-
Save falfaddaghi/3b70c02e060638a847b6e54798a723df 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment