1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/cabbage-v50-steamdeck-ge-proton-patch

Клонировать/Скачать
extra_exe_patch.sh 3.4 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
daizhiqiang Отправлено 29.01.2023 06:56 7ca339f
#!/bin/bash
#GE_PROTON_PATH="/d/BaiduNetdiskDownload"
GE_PROTON_PATH=`echo $HOME`"/.local/share/Steam/compatibilitytools.d"
GE_PROTON_BACKUP_NAME="proton.patch.backup"
PYTHON_PATCH_CODE="#then setup patch and run(author:kong version:v1.0.0)\
\n if os.environ.get(\"WINE_TASKMGR\", \"0\") == \"1\":\
\n subprocess.Popen([g_proton.wine64_bin, os.environ.get(\"STEAM_COMPAT_DATA_PATH\", \"\") + \'/pfx/drive_c/windows/syswow64/taskmgr.exe\'], env=g_session.env)\
\n if \"WINE_EXTRA_EXE\" in os.environ and file_exists(os.environ.get(\"WINE_EXTRA_EXE\", \"\"), follow_symlinks=True):\
\n subprocess.Popen([g_proton.wine64_bin, os.environ.get(\"WINE_EXTRA_EXE\", \"\")], env=g_session.env)\
\n"
function show_usage(){
echo "=== How to enable the patch on your SteamDeck? ==="
echo "* Setup 1: click your game->\"Properties\", force use the GE-Proton your patched ==="
echo "* Setup 2.1(setup taskmgr.exe): input \"WINE_TASKMGR=1 %command%\" in your game->\"LAUNCHER OPTIONS\"==="
echo "* Setup 2.2(or setup your application(*.exe)): input \"WINE_EXTRA_EXE=/home/deck/path_to_your.exe %command%\" in your game->\"LAUNCHER OPTIONS\"==="
}
g_select_index="1"
function select_ge_proton_func () {
i=1
for ge_proton in `ls ${GE_PROTON_PATH} -l | grep GE-Proton | awk '{print $9}'`
do
# show the ge-proton dir
if [[ -d "${GE_PROTON_PATH}/${ge_proton}" ]];then
echo "${i})${ge_proton}"
i=$(( $i + 1 ))
fi
done
read -n 1 -p "Please select target GE-Proton(max:9, default:1): > " select_index
printf "\n"
echo "Your select: ${select_index}"
g_select_index="${select_index}"
}
function main_func () {
cmd="$1"
select_ge_proton_func
select_index="${g_select_index}"
if [[ "${select_index}" == "" ]];then
select_index="1"
fi
# patch the target ge-proton
ge_proton_select_index=1
for ge_proton in `ls ${GE_PROTON_PATH} -l | grep GE-Proton | awk '{print $9}'`
do
# check the ge-proton dir exist?
if [[ -d "${GE_PROTON_PATH}/${ge_proton}" ]];then
if [[ "${ge_proton_select_index}" == "${select_index}" ]];then
target_path_installed="${GE_PROTON_PATH}/${ge_proton}"
echo "ready to ${cmd} ${ge_proton}"
if [[ "${cmd}" == "patch" ]];then
if [[ ! -f "${target_path_installed}/${GE_PROTON_BACKUP_NAME}" ]];then
cp -f "${target_path_installed}/proton" "${target_path_installed}/${GE_PROTON_BACKUP_NAME}"
fi
sed -i "s%#then run%$PYTHON_PATCH_CODE%g" "${target_path_installed}/proton"
echo "patch ${ge_proton} ok!"
show_usage
exit 0
elif [[ "${cmd}" == "revert" ]];then
if [[ -f "${target_path_installed}/${GE_PROTON_BACKUP_NAME}" ]];then
cp -f "${target_path_installed}/${GE_PROTON_BACKUP_NAME}" "${target_path_installed}/proton"
fi
echo "revert ${ge_proton} ok!"
exit 0
fi
fi
ge_proton_select_index=$(( $ge_proton_select_index + 1 ))
fi
done
}
# patch command
cmd="patch"
if [[ $1 == "revert" ]];then
# revert patch command
cmd="revert"
fi
echo "It's a GE-Proton patch script for support setup taskmgr.exe or extra application(*.exe 32bit or 64bit)"
main_func ${cmd}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/cabbage-v50-steamdeck-ge-proton-patch.git
git@api.gitlife.ru:oschina-mirror/cabbage-v50-steamdeck-ge-proton-patch.git
oschina-mirror
cabbage-v50-steamdeck-ge-proton-patch
cabbage-v50-steamdeck-ge-proton-patch
master