Skip to content

Instantly share code, notes, and snippets.

@shmup
Created December 7, 2023 19:41
Show Gist options
  • Save shmup/4e7050d50e1db2e9fc4071bf31efa934 to your computer and use it in GitHub Desktop.
Save shmup/4e7050d50e1db2e9fc4071bf31efa934 to your computer and use it in GitHub Desktop.
easily run an .exe with proton on linux
#!/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