Last active
January 22, 2024 08:43
-
-
Save mops1k/2f333c9f63a34e4a41127a0a39c4faed to your computer and use it in GitHub Desktop.
Bash script to run app thru steam or system proton
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
[Desktop Entry] | |
Comment[ru_RU]= | |
Comment= | |
Exec='~/Games/fisher-online/drive_c/GameCenter/Fisher online/run.sh' | |
GenericName[ru_RU]=Симулятор рыбалки онлайн | |
GenericName=Симулятор рыбалки онлайн | |
Icon=~/Games/fisher-online/drive_c/GameCenter/Fisher online/icon.png | |
MimeType= | |
Name[ru_RU]=Fisher Online | |
Name=Fisher Online | |
Path=~/Games/fisher-online/drive_c/GameCenter/Fisher online/ | |
StartupNotify=true | |
Terminal=false | |
TerminalOptions= | |
Type=Application | |
X-KDE-SubstituteUID=false | |
X-KDE-Username= |
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
#!/bin/bash | |
# Usage examples: | |
# ./proton.sh relative/path/to/game.exe steamappid-if-needed | |
# ./proton.sh relative/path/to/game.exe | |
# PROTON_DIR=/usr/share/steam/compatibilitytools.d/proton-ge-custom ./proton.sh relative/path/to/game.exe steamappid-if-needed | |
# PROTON_DIR=/usr/share/steam/compatibilitytools.d/proton-ge-custom ./proton.sh relative/path/to/game.exe | |
if [ -z "${PROTON_DIR}" ]; then | |
printf "Please select proton path:\n" | |
PROTON_PATHS=(/usr/share/steam/compatibilitytools.d/* $HOME/.steam/steam/steamapps/common/Proton*) | |
select d in "${PROTON_PATHS[@]}"; do test -n "$d" && break; echo ">>> Invalid Selection"; done | |
PROTON_DIR=$d | |
fi | |
PWD_WITH_SLASH=$PWD"/" | |
RUNNING=${1/$PWD_WITH_SLASH/""} | |
STEAM_APP_ID="$2" | |
if [ ! -f "$PROTON_DIR/proton" ] ; then | |
echo "Proton in path $PROTON_DIR not found!"; | |
exit | |
fi | |
if [ ! -f "$RUNNING" ] ; then | |
echo "$RUNNING does not exist!"; | |
exit | |
fi | |
# Steam / Client path | |
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam/steam" | |
export STEAM_COMPAT_DATA_PATH="$HOME/.steam/steam/steamapps/compatdata/$STEAM_APP_ID" | |
PROTON_VERSION=`cat "$PROTON_DIR"/version` | |
printf "Proton (\033[32m$PROTON_VERSION\033[0m) script found at\n \033[32m$PROTON_DIR/proton\033[0m\n\n" | |
printf "Now running\n \033[32m$PWD/$RUNNING\033[0m\n" | |
printf "Steam app id\n \033[32m$STEAM_APP_ID\033[0m\n" | |
export MOUNT_PATH="/mnt/c" | |
pfx='${PROTON_DIR}/dist' | |
export PATH="$pfx/bin/:$PATH" | |
export WINEDLLPATH="$pfx/lib64/wine:$pfx/lib/wine" | |
export LD_LIBRARY_PATH="$pfx/lib64/:$pfx/lib/:/usr/lib/:/usr/lib64/" | |
export GST_PLUGIN_SYSTEM_PATH_1_0="/usr/lib/gstreamer-1.0/:/usr/lib64/gstreamer-1.0/" | |
PROTON_USE_WINED3D11=1 \ | |
#PROTON_NO_D3D11=0 \ | |
PROTON_NO_ESYNC=1 \ | |
"${PROTON_DIR}"/proton run $RUNNING \ | |
&> /dev/null | |
exit 0 |
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
#!/bin/bash | |
gamemoderun \ | |
mangohud \ | |
PROTON_DIR=$HOME/.steam/steam/steamapps/common/Proton\ 8.0 \ | |
~/proton.sh theFisher.exe 1493710 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment