Last active
January 9, 2024 08:45
-
-
Save galister/2f09d6ab98430fc886380f2e643d078b to your computer and use it in GitHub Desktop.
protonrun - run a command in a proton prefix
This file contains 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 | |
steamapps="$HOME/.local/share/Steam/steamapps" | |
if [ "$1" == "" ]; then | |
echo "echo 'proton-enter <appId>'" | |
exit 1 | |
fi | |
compatdata_folder="$steamapps/compatdata/$1" | |
if ! [ -d "$compatdata_folder" ]; then | |
echo "echo 'No such compatdata: $1'" | |
exit 1 | |
fi | |
export WINEPREFIX="$compatdata_folder/pfx" | |
export WINE=$(cat "$compatdata_folder/config_info" | sed '3q;d')../bin/wine | |
export WINE64="${WINE}64" | |
export WINE_MULTI=$WINE | |
if ! [ -f "$WINE" ]; then | |
echo "echo 'wine not found at: $wine_exe'" | |
exit 1 | |
fi | |
if [ -f "$WINE64" ]; then | |
export WINE_ARCH=$WINE64 | |
export WINEARCH="win64" | |
else | |
export WINE_ARCH=$WINE | |
export WINEARCH="win32" | |
fi | |
echo "export WINEPREFIX='$WINEPREFIX'" | |
echo "export WINE='$WINE'" | |
echo "export WINE64='$WINE64'" | |
echo "export WINE_ARCH='$WINE_ARCH'" | |
echo "export WINEARCH='$WINEARCH'" | |
echo "export WINE_MULTI='$WINE_MULTI'" | |
echo "export WINEFSYNC=1" |
This file contains 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 | |
steamapps="$HOME/.local/share/Steam/steamapps" | |
if [ "$1" == "" ] || [ "$2" == "" ]; then | |
echo "protonrun <appId> <command> [args ...]" | |
exit 1 | |
fi | |
eval `proton-enter $1` | |
shift | |
"$WINE_ARCH" $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment