forked from CastroFidel/PortWINE
cleaned
This commit is contained in:
parent
109b27b3ba
commit
4c5ce94067
@ -293,9 +293,7 @@ parseSteamShortcutEntryLaunchOptions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parseSteamTargetExe() {
|
parseSteamTargetExe() {
|
||||||
exe=$(sed -n 's/^export portwine_exe="\([^"]*\)"/\1/p' "$1")
|
grep -E '^[^# ]*?(rungame|flatpak|start\.sh)' "$1" | head -n 1 | sed 's/ "\$@"//' | awk -F'"' '{print $(NF-1)}'
|
||||||
[[ -z "${exe}" ]] && exe=$(grep -E 'flatpak|start\.sh' "$1" | head -n 1 | awk -F'"' '{print $(NF-1)}')
|
|
||||||
[[ -n "${exe}" ]] && echo "${exe}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
restartSteam() {
|
restartSteam() {
|
||||||
@ -483,11 +481,8 @@ addNonSteamGame() {
|
|||||||
cat <<-EOF > "${NOSTSHPATH}"
|
cat <<-EOF > "${NOSTSHPATH}"
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
export FLATPAK_IN_USE=$(check_flatpak && echo 1 || echo 0)
|
export FLATPAK_IN_USE=$(check_flatpak && echo 1 || echo 0)
|
||||||
export portwine_exe="${portwine_exe}"
|
source "${PORT_SCRIPTS_PATH}/add_in_steam.sh"
|
||||||
export PORT_WINE_PATH="${PORT_WINE_PATH}"
|
rungame "${portwine_exe}" "\$@"
|
||||||
export PORT_SCRIPTS_PATH="\${PORT_WINE_PATH}/data/scripts"
|
|
||||||
source "\${PORT_SCRIPTS_PATH}/add_in_steam.sh"
|
|
||||||
rungame "\$@"
|
|
||||||
EOF
|
EOF
|
||||||
chmod u+x "${NOSTSHPATH}"
|
chmod u+x "${NOSTSHPATH}"
|
||||||
|
|
||||||
@ -512,28 +507,31 @@ addNonSteamGame() {
|
|||||||
|
|
||||||
rungame() {
|
rungame() {
|
||||||
export START_FROM_STEAM=1
|
export START_FROM_STEAM=1
|
||||||
|
export portwine_exe="${1:-}"
|
||||||
if [[ -n "${portwine_exe:-}" ]]; then
|
if [[ -n "${portwine_exe:-}" ]]; then
|
||||||
if [[ -n "${STEAM_COMPAT_DATA_PATH:-}" ]]; then
|
if [[ -n "${STEAM_COMPAT_DATA_PATH:-}" ]]; then
|
||||||
cd "$(dirname "${portwine_exe}")"
|
cd "$(dirname "${portwine_exe}")"
|
||||||
PORTWINE_DB_FILE="${portwine_exe}.ppdb"
|
export PORTWINE_DB_FILE="${portwine_exe}.ppdb"
|
||||||
|
export PORT_SCRIPTS_PATH=$(readlink -f "${BASH_SOURCE[0]%/*}")
|
||||||
|
export PORT_WINE_PATH=${PORT_SCRIPTS_PATH%/*/*}
|
||||||
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
||||||
source "${PORT_WINE_PATH}/data/user.conf"
|
[[ -f "${PORT_WINE_PATH}/data/user.conf" ]] && source "${PORT_WINE_PATH}/data/user.conf"
|
||||||
|
[[ -f "${PORTWINE_DB_FILE}" ]] && source "${PORTWINE_DB_FILE}"
|
||||||
source "${PORT_SCRIPTS_PATH}/functions_helper"
|
source "${PORT_SCRIPTS_PATH}/functions_helper"
|
||||||
if [[ -f "${PORTWINE_DB_FILE}" ]]; then
|
PORT_WINE_PREFIX="${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME:-DEFAULT}"
|
||||||
source "${PORTWINE_DB_FILE}"
|
|
||||||
fi
|
|
||||||
for path in "ProgramData" "users/Public" "users/steamuser"; do
|
for path in "ProgramData" "users/Public" "users/steamuser"; do
|
||||||
|
mkdir -p "${PORT_WINE_PREFIX}/drive_c/${path}"
|
||||||
if [[ ! -L "${WINEPREFIX}/drive_c/${path}" ]]; then
|
if [[ ! -L "${WINEPREFIX}/drive_c/${path}" ]]; then
|
||||||
mkdir -p "${WINEPREFIX}/drive_c/users/"
|
mkdir -p "${WINEPREFIX}/drive_c/users/"
|
||||||
rm -rf "${WINEPREFIX}/drive_c/${path}"
|
rm -rf "${WINEPREFIX}/drive_c/${path}"
|
||||||
ln -sr "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME:-DEFAULT}/drive_c/${path}" "${WINEPREFIX}/drive_c/${path}"
|
ln -sr "${PORT_WINE_PREFIX}/drive_c/${path}" "${WINEPREFIX}/drive_c/${path}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[[ $PW_LOG != 1 ]] && debug_timer --start -s "PW_TIME_IN_GAME"
|
[[ $PW_LOG != 1 ]] && debug_timer --start -s "PW_TIME_IN_GAME"
|
||||||
"${STEAM_COMPAT_TOOL_PATHS%%:*}/proton" "run" "${portwine_exe}"
|
"${STEAM_COMPAT_TOOL_PATHS%%:*}/proton" "run" "${portwine_exe}" "${@:2}"
|
||||||
if [[ $PW_LOG != 1 ]] && [[ -n $START_PW_TIME_IN_GAME ]] ; then
|
if [[ $PW_LOG != 1 ]] && [[ -n $START_PW_TIME_IN_GAME ]] ; then
|
||||||
debug_timer --end -s "PW_TIME_IN_GAME"
|
debug_timer --end -s "PW_TIME_IN_GAME"
|
||||||
PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 )) # в секундах
|
PW_TIME_IN_GAME=$(( PW_TIME_IN_GAME / 1000 ))
|
||||||
search_desktop_file
|
search_desktop_file
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user