Skip to content

Commit

Permalink
Merge pull request #35 from rockerbacon/custom-proton
Browse files Browse the repository at this point in the history
Support custom Proton
  • Loading branch information
rockerbacon authored May 11, 2020
2 parents cebb305 + 1498bfd commit d893241
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions installers/modorganizer2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ script:
shared="$HOME/.local/share/modorganizer2"
echo -e \
"#!/bin/bash\n\n'$shared/proton-launcher.sh' $game_launcher_options $game_appid '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'" \
"#!/bin/bash\n\n'$shared/proton-launcher.sh' $game_launcher_options $game_appid \"\$@\" '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'" \
> "$GAMEDIR/run.sh"
echo -e \
"#!/bin/bash\n\n'$shared/proton-launcher.sh' $game_launcher_options $game_appid '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \"\$1\"" \
"#!/bin/bash\n\n'$shared/proton-launcher.sh' $game_launcher_options $game_appid \"\$@\" '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \"\$1\"" \
> "$GAMEDIR/download.sh"
Expand Down
18 changes: 16 additions & 2 deletions runners/proton-launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ EXECUTABLE: path to the .exe file to execute
EXECUTABLE_ARGS: arguments to pass to EXECUTABLE
OPTIONS:
--customver specify a custom version of proton to use
specified version must be a path within
\$HOME/.steam/steam/steamapps/common
--d9vk use DXVK instead of wined3d on DirectX9 apps
obsolete on Proton 5.0 or newer
Expand Down Expand Up @@ -88,13 +92,18 @@ protonver='*'
proton_extra_envs=()
proton_libdir="$HOME/.steam/steam"
restart_pulse=false
customver=""
### DEFAULTS ###

### PARSE NAMED ARGS ###
parsing_args=true
while [ "$parsing_args" == "true" ]; do
argname=$1
case "$argname" in
--customver)
customver="$2"; shift 2
;;

--d9vk)
proton_extra_envs+=("PROTON_USE_D9VK=1"); shift 1
;;
Expand Down Expand Up @@ -244,13 +253,18 @@ fi
### FIND GAME LIBRARY ####

### FIND PROTON EXECUTABLE ###
if [ -n "$customver" ]; then
proton_match="$customver"
else
proton_match="Proton $protonver"
fi
proton_dir=$(find "$proton_libdir/steamapps/common/" \
-maxdepth 1 -path "*/Proton $protonver" \
-maxdepth 1 -path "*/$proton_match" \
| sort -rV \
| head -n 1
)
if [ ! -d "$proton_dir" ]; then
$errorbox "Could not find proton version matching '$protonver' in directory '$proton_libdir/steamapps/common/'"
$errorbox "Could not find Proton version matching '$proton_match' in directory '$proton_libdir/steamapps/common/'"
print_help >&2
exit 1
fi
Expand Down

0 comments on commit d893241

Please sign in to comment.