forked from CastroFidel/PortWINE
major rebase: drop runlib and yad_gui scripts
This commit is contained in:
@ -129,7 +129,6 @@ export PW_PLUGINS_PATH="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}"
|
||||
export PW_GUI_ICON_PATH="${PORT_WINE_PATH}/data/img/gui"
|
||||
|
||||
. "${PORT_SCRIPTS_PATH}"/lang
|
||||
. "${PORT_SCRIPTS_PATH}"/yad_gui
|
||||
|
||||
export urlg="https://linux-gaming.ru/portproton/"
|
||||
export PW_WINELIB="${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}"
|
||||
@ -142,6 +141,10 @@ check_variables PW_LOG "0"
|
||||
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/update_pfx_log"
|
||||
|
||||
# TODO: remove this later...
|
||||
try_remove_file "${PORT_SCRIPTS_PATH}/runlib"
|
||||
try_remove_file "${PORT_SCRIPTS_PATH}/yad_gui"
|
||||
|
||||
if [[ "${INSTALLING_PORT}" == 1 ]] ; then
|
||||
return 0
|
||||
fi
|
||||
@ -195,14 +198,6 @@ fi
|
||||
|
||||
[[ "$MISSING_DESKTOP_FILE" == 1 ]] && portwine_missing_shortcut
|
||||
|
||||
# if [[ -f "$portwine_exe" ]] \
|
||||
# && [[ "${WARN_CYRILLIC_IN_PATH}" != 1 ]] \
|
||||
# && echo "${portwine_exe}" | grep -e $'[\u0430-\u044F\u0410-\u042F]' &>/dev/null
|
||||
# then
|
||||
# yad_info "$loc_warn_cyrillic_in_path"
|
||||
# export WARN_CYRILLIC_IN_PATH="1"
|
||||
# fi
|
||||
|
||||
if [[ -f "${PORT_WINE_TMP_PATH}/tmp_main_gui_size" ]] && [[ ! -z "$(cat ${PORT_WINE_TMP_PATH}/tmp_main_gui_size)" ]] ; then
|
||||
export PW_MAIN_SIZE_W="$(cat ${PORT_WINE_TMP_PATH}/tmp_main_gui_size | awk '{print $1}')"
|
||||
export PW_MAIN_SIZE_H="$(cat ${PORT_WINE_TMP_PATH}/tmp_main_gui_size | awk '{print $2}')"
|
||||
@ -242,427 +237,11 @@ if [[ ! -z $(basename "${portwine_exe}" | grep .ppack) ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
portwine_launch () {
|
||||
start_portwine
|
||||
PORTWINE_MSI=$(basename "${portwine_exe}" | grep .msi)
|
||||
PORTWINE_BAT=$(basename "${portwine_exe}" | grep .bat)
|
||||
if [[ ! -z "${PW_VIRTUAL_DESKTOP}" && "${PW_VIRTUAL_DESKTOP}" == "1" ]] ; then
|
||||
pw_run explorer "/desktop=PortProton,${PW_SCREEN_RESOLUTION}" ${WINE_WIN_START} "$portwine_exe"
|
||||
elif [ ! -z "${PORTWINE_MSI}" ]; then
|
||||
pw_run msiexec /i "$portwine_exe"
|
||||
elif [[ ! -z "${PORTWINE_BAT}" || -n "${portwine_exe}" ]] ; then
|
||||
pw_run ${WINE_WIN_START} "$portwine_exe"
|
||||
else
|
||||
pw_run winefile
|
||||
fi
|
||||
}
|
||||
### CLI ###
|
||||
|
||||
portwine_start_debug () {
|
||||
kill_portwine
|
||||
export PW_LOG=1
|
||||
if [[ -z "$VULKAN_DRIVER_NAME" ]] || [[ "$VULKAN_DRIVER_NAME" == "llvmpipe" ]] ; then
|
||||
yad_info "Attention working version of vulkan not detected!\nIt is recommended to run games in OpenGL (low performance possible)!"
|
||||
fi
|
||||
echo "${port_deb1}" > "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "${port_deb2}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-------------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "PortWINE version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
read install_ver < "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||
echo "${portname}-${install_ver}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "------------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Scripts version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
cat "${PORT_WINE_TMP_PATH}/scripts_ver" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [ "${PW_USE_RUNTIME}" = 0 ] ; then
|
||||
echo "RUNTIME is disabled" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else
|
||||
echo "RUNTIME is enabled" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "----------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [ ! -z "${portwine_exe}" ] ; then
|
||||
echo "Debug for programm:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "${portwine_exe}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "---------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "GLIBC version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo $(ldd --version | grep -m1 ldd | awk '{print $NF}') >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "--------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [[ "${PW_VULKAN_USE}" = "0" ]] ; then
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE} - DX9-11 to ${loc_gui_open_gl}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
elif [[ "${PW_VULKAN_USE}" = "1" ]] ; then
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE} - DXVK v.${DXVK_STABLE_VER} and VKD3D-PROTON v.${VKD3D_STABLE_VER}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
elif [[ "${PW_VULKAN_USE}" = "2" ]] ; then
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE} - DXVK v.${DXVK_GIT_VER} and VKD3D-PROTON v.${VKD3D_GIT_VER}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
elif [[ "${PW_VULKAN_USE}" = "3" ]] ; then
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE} - native DX9 on MESA drivers" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
elif [[ "${PW_VULKAN_USE}" = "4" ]] ; then
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE} - DirectX to wined3d vulkan" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else
|
||||
echo "PW_VULKAN_USE=${PW_VULKAN_USE}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "--------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Version WINE in use:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "$PW_WINE_USE" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Program bit depth:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [[ $(file "$portwine_exe") =~ x86-64 ]]; then
|
||||
echo "64 bit" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----------------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else
|
||||
echo "32 bit" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "--------------------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Date and time of start debug for ${portname}:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
date >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "The installation path of the ${portname}:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "$PORT_WINE_PATH" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Operating system:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
cat /etc/os-release | grep -oP 'PRETTY_NAME="\K[^"]+' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "--------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Desktop environment:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Desktop session: ${DESKTOP_SESSION}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Current desktop: ${XDG_CURRENT_DESKTOP}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Session type: ${XDG_SESSION_TYPE}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "---------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Kernel:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
uname -r >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "CPU:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "CPU physical cores:$(cat /proc/cpuinfo | grep 'cpu cores' | sort -u | cut -d':' -f2)" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "CPU logical cores: $(cat /proc/cpuinfo | grep 'processor' | wc -l)" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "CPU model name:$(cat /proc/cpuinfo | grep 'model name' | sort -u | cut -d':' -f2)" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "RAM:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
free -m >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Graphic cards and drivers:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo 'lspci -k | grep -EA3 VGA|3D|Display :' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "$(lspci -k | grep -EA3 'VGA|3D|Display')" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "----" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
[[ `command -v glxinfo` ]] && glxinfo -B >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "inxi -G:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if ! check_flatpak
|
||||
then "${PW_PLUGINS_PATH}/portable/bin/inxi" -Gc0 >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
if echo "$LSPCI_VGA" | grep -i nvidia &>/dev/null ; then
|
||||
if command -v ldconfig &>/dev/null ; then
|
||||
echo "------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "ldconfig -p | grep libGLX_nvidia" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
ldconfig -p | grep libGLX_nvidia >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
fi
|
||||
echo "PW_SCREEN_RESOLUTION=$PW_SCREEN_RESOLUTION" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "PW_SCREEN_PRIMARY=$PW_SCREEN_PRIMARY" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "----------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "Vulkan info device name:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
"$PW_VULKANINFO_PORTABLE" 2>/dev/null | grep -E '^GPU|deviceName|driverName' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
"${PW_PLUGINS_PATH}/portable/bin/vkcube" --c 50
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Vulkan cube test passed successfully" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else
|
||||
echo "Vulkan cube test completed with error" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "----------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo 'locale:' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
locale >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "---" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo 'locale -a | grep -i "$(locale | grep -e '^LANG=' | sed 's/LANG=//' | sed 's/\-8//')" :' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
locale -a | grep -i "$(locale | grep -e '^LANG=' | sed 's/LANG=//' | sed 's/\-8//')" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [[ "${PW_USE_D3D_EXTRAS}" != 1 ]]
|
||||
then echo "D3D_EXTRAS - disabled" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else echo "D3D_EXTRAS - enabled" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "winetricks.log:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
cat "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" | sed -e /"^d3dcomp*"/d -e /"^d3dx*"/d >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
echo "-----------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [ ! -z "${PORTWINE_DB_FILE}" ]; then
|
||||
echo "Use ${PORTWINE_DB_FILE} db file:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
cat "${PORTWINE_DB_FILE}" | sed '/##/d' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
else
|
||||
echo "Use ${PORT_SCRIPTS_PATH}/portwine_db/default db file:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
cat "${PORT_SCRIPTS_PATH}/portwine_db/default" | sed '/##/d' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "----------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
if [ -f "${USER_CONF}" ]; then
|
||||
cat "${USER_CONF}" | sed '/bash/d' >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
fi
|
||||
echo "---------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||
|
||||
export DXVK_HUD="full"
|
||||
|
||||
portwine_launch &
|
||||
sleep 3
|
||||
pw_stop_progress_bar_cover
|
||||
unset PW_TIMER
|
||||
while read -r line || [[ ! -z $(pgrep -a yad | grep "yad_v12_3 --text-info --tail --button="STOP":0 --title="DEBUG"" | awk '{print $1}') ]] ; do
|
||||
sleep 0.005
|
||||
if [[ ! -z "${line}" ]] && [[ -z "$(echo "${line}" | grep -i "kerberos")" ]] \
|
||||
&& [[ -z "$(echo "${line}" | grep -i "ntlm")" ]]
|
||||
then
|
||||
echo "# ${line}"
|
||||
fi
|
||||
if [[ "${PW_TIMER}" != 1 ]] ; then
|
||||
sleep 3
|
||||
PW_TIMER=1
|
||||
fi
|
||||
done < "${PORT_WINE_PATH}/${portname}.log" | "${pw_yad_v12_3}" --text-info --tail --button="STOP":0 --title="DEBUG" \
|
||||
--skip-taskbar --width=800 --height=400 --text "${port_debug}" 2>/dev/null &&
|
||||
kill_portwine
|
||||
sed -i '/.fx$/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
sed -i '/HACK_does_openvr_work/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
sed -i '/Uploading is disabled/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
sed -i '/wine: RLIMIT_NICE is <= 20/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
sed -i '/ALT_2.24/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
sed -i '/UDEV monitor/d' "${PORT_WINE_PATH}/${portname}.log"
|
||||
deb_text=$(cat "${PORT_WINE_PATH}/${portname}.log" | awk '! a[$0]++')
|
||||
echo "$deb_text" > "${PORT_WINE_PATH}/${portname}.log"
|
||||
"$pw_yad" --title="${portname}.log" --borders=${YAD_BORDERS} --no-buttons --text-align=center \
|
||||
--text-info --show-uri --wrap --width=1200 --height=550 --uri-color=red \
|
||||
--filename="${PORT_WINE_PATH}/${portname}.log"
|
||||
stop_portwine
|
||||
}
|
||||
|
||||
pw_winecfg () {
|
||||
start_portwine
|
||||
export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
pw_run winecfg
|
||||
}
|
||||
|
||||
pw_winefile () {
|
||||
start_portwine
|
||||
pw_run winefile
|
||||
}
|
||||
|
||||
pw_winecmd () {
|
||||
export PW_USE_TERMINAL=1
|
||||
start_portwine
|
||||
cd "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c"
|
||||
${pw_runtime} env LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" "${PW_PLUGINS_PATH}/portable/bin/xterm" -e "${WINELOADER}" cmd
|
||||
stop_portwine
|
||||
}
|
||||
|
||||
pw_winereg () {
|
||||
start_portwine
|
||||
export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
pw_run regedit
|
||||
}
|
||||
|
||||
pw_prefix_manager () {
|
||||
update_winetricks
|
||||
start_portwine
|
||||
if [ ! -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" ] ; then
|
||||
touch "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log"
|
||||
fi
|
||||
|
||||
pw_start_progress_bar_block "Starting prefix manager..."
|
||||
"${PORT_WINE_TMP_PATH}/winetricks" dlls list | awk -F'(' '{print $1}' 1> "${PORT_WINE_TMP_PATH}/dll_list"
|
||||
"${PORT_WINE_TMP_PATH}/winetricks" fonts list | awk -F'(' '{print $1}' 1> "${PORT_WINE_TMP_PATH}/fonts_list"
|
||||
"${PORT_WINE_TMP_PATH}/winetricks" settings list | awk -F'(' '{print $1}' 1> "${PORT_WINE_TMP_PATH}/settings_list"
|
||||
pw_stop_progress_bar
|
||||
|
||||
gui_prefix_manager () {
|
||||
pw_start_progress_bar_block "Starting prefix manager..."
|
||||
unset SET_FROM_PFX_MANAGER_TMP SET_FROM_PFX_MANAGER
|
||||
old_IFS=$IFS
|
||||
IFS=$'\n'
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/dll_list_tmp"
|
||||
while read PW_BOOL_IN_DLL_LIST ; do
|
||||
if [[ -z $(echo "${PW_BOOL_IN_DLL_LIST}" | grep -E 'd3d|directx9|dont_use|dxvk|vkd3d|galliumnine|faudio1') ]] ; then
|
||||
if grep "^$(echo ${PW_BOOL_IN_DLL_LIST} | awk '{print $1}')$" "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" ; then
|
||||
echo -e "true\n$(echo ${PW_BOOL_IN_DLL_LIST} | awk '{print $1}')\n`echo ${PW_BOOL_IN_DLL_LIST} | awk '{ $1 = ""; print substr($0, 2) }'`" >> "${PORT_WINE_TMP_PATH}/dll_list_tmp"
|
||||
else
|
||||
echo -e "false\n`echo "${PW_BOOL_IN_DLL_LIST}" | awk '{print $1}'`\n`echo ${PW_BOOL_IN_DLL_LIST} | awk '{ $1 = ""; print substr($0, 2) }'`" >> "${PORT_WINE_TMP_PATH}/dll_list_tmp"
|
||||
fi
|
||||
fi
|
||||
done < "${PORT_WINE_TMP_PATH}/dll_list"
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/fonts_list_tmp"
|
||||
while read PW_BOOL_IN_FONTS_LIST ; do
|
||||
if [[ -z $(echo "${PW_BOOL_IN_FONTS_LIST}" | grep -E 'dont_use') ]] ; then
|
||||
if grep "^$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')$" "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" ; then
|
||||
echo -e "true\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{ $1 = ""; print substr($0, 2) }')" >> "${PORT_WINE_TMP_PATH}/fonts_list_tmp"
|
||||
else
|
||||
echo -e "false\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{ $1 = ""; print substr($0, 2) }')" >> "${PORT_WINE_TMP_PATH}/fonts_list_tmp"
|
||||
fi
|
||||
fi
|
||||
done < "${PORT_WINE_TMP_PATH}/fonts_list"
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/settings_list_tmp"
|
||||
while read PW_BOOL_IN_FONTS_LIST ; do
|
||||
if [[ -z $(echo "${PW_BOOL_IN_FONTS_LIST}" | grep -E 'vista|alldlls|autostart_|bad|good|win|videomemory|vd=|isolate_home') ]] ; then
|
||||
if grep "^$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')$" "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" ; then
|
||||
echo -e "true\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{ $1 = ""; print substr($0, 2) }')" >> "${PORT_WINE_TMP_PATH}/settings_list_tmp"
|
||||
else
|
||||
echo -e "false\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{print $1}')\n$(echo "${PW_BOOL_IN_FONTS_LIST}" | awk '{ $1 = ""; print substr($0, 2) }')" >> "${PORT_WINE_TMP_PATH}/settings_list_tmp"
|
||||
fi
|
||||
fi
|
||||
done < "${PORT_WINE_TMP_PATH}/settings_list"
|
||||
pw_stop_progress_bar
|
||||
|
||||
KEY_EDIT_MANAGER_GUI=$RANDOM
|
||||
"${pw_yad_v12_3}" --plug=$KEY_EDIT_MANAGER_GUI --tabnum=1 --list --checklist \
|
||||
--text="${loc_prefix_manager_comp} <b>\"${PW_PREFIX_NAME}\"</b>, ${loc_prefix_manager_wine} <b>\"${PW_WINE_USE}\"</b>" \
|
||||
--column=set --column=dll --column=info < "${PORT_WINE_TMP_PATH}/dll_list_tmp" 1>> "${PORT_WINE_TMP_PATH}/to_winetricks" 2>/dev/null &
|
||||
|
||||
"${pw_yad_v12_3}" --plug=$KEY_EDIT_MANAGER_GUI --tabnum=2 --list --checklist \
|
||||
--text="${loc_prefix_manager_font} <b>\"${PW_PREFIX_NAME}\"</b>, ${loc_prefix_manager_wine} <b>\"${PW_WINE_USE}\"</b>" \
|
||||
--column=set --column=dll --column=info < "${PORT_WINE_TMP_PATH}/fonts_list_tmp" 1>> "${PORT_WINE_TMP_PATH}/to_winetricks" 2>/dev/null &
|
||||
|
||||
"${pw_yad_v12_3}" --plug=$KEY_EDIT_MANAGER_GUI --tabnum=3 --list --checklist \
|
||||
--text="${loc_prefix_manager_conf} <b>\"${PW_PREFIX_NAME}\"</b>" \
|
||||
--column=set --column=dll --column=info < "${PORT_WINE_TMP_PATH}/settings_list_tmp" 1>> "${PORT_WINE_TMP_PATH}/to_winetricks" 2>/dev/null &
|
||||
|
||||
"${pw_yad_v12_3}" --key=$KEY_EDIT_MANAGER_GUI --notebook --borders=${YAD_BORDERS} --width=900 --height=800 \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --title "$loc_pm" --tab-pos=bottom --tab="$loc_pm_dlls" --tab="$loc_pm_fonts" --tab="$loc_pm_settings" 2>/dev/null
|
||||
YAD_STATUS="$?"
|
||||
if [[ "$YAD_STATUS" == "1" || "$YAD_STATUS" == "252" ]] ; then
|
||||
stop_portwine
|
||||
exit 0
|
||||
fi
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/dll_list_tmp"
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/fonts_list_tmp"
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/settings_list_tmp"
|
||||
|
||||
for STPFXMNG in $(cat "${PORT_WINE_TMP_PATH}/to_winetricks") ; do
|
||||
grep $(echo ${STPFXMNG} | awk -F'|' '{print $2}') "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/winetricks.log" &>/dev/null
|
||||
if [ "$?" == "1" ] ; then
|
||||
[[ ! -z "${STPFXMNG}" ]] && SET_FROM_PFX_MANAGER+="$(echo "${STPFXMNG}" | awk -F'|' '{print $2}') "
|
||||
fi
|
||||
done
|
||||
IFS=${old_IFS}
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/to_winetricks"
|
||||
|
||||
if [[ ! -z ${SET_FROM_PFX_MANAGER} ]] ; then
|
||||
pw_update_pfx_cover_gui "winetricks"
|
||||
echo "START WINETRICKS..." >> "${PORT_WINE_TMP_PATH}/update_pfx_log"
|
||||
echo "Try to install DLL in prefix: ${SET_FROM_PFX_MANAGER}" >> "${PORT_WINE_TMP_PATH}/update_pfx_log"
|
||||
print_info "Try to install DLL in prefix: ${SET_FROM_PFX_MANAGER}"
|
||||
${pw_runtime} env PATH="${PATH}" LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" GST_PLUGIN_SYSTEM_PATH_1_0="" \
|
||||
"${PORT_WINE_TMP_PATH}/winetricks" -q -r -f ${SET_FROM_PFX_MANAGER} | tee -a "${PORT_WINE_TMP_PATH}/update_pfx_log"
|
||||
wait_wineserver
|
||||
kill_portwine
|
||||
pw_stop_progress_bar
|
||||
gui_prefix_manager
|
||||
else
|
||||
print_info "Nothing to do. Restarting PortProton..."
|
||||
stop_portwine &
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
gui_prefix_manager
|
||||
}
|
||||
|
||||
pw_start_cont_xterm () {
|
||||
cd "$HOME"
|
||||
unset PW_SANDBOX_HOME_PATH
|
||||
pw_init_runtime
|
||||
${pw_runtime} \
|
||||
env PATH="${PATH}" \
|
||||
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
|
||||
LD_PRELOAD="${PW_LD_PRELOAD}" \
|
||||
VK_LAYER_PATH="${PW_VK_LAYER_PATH}" \
|
||||
VK_INSTANCE_LAYERS="${PW_VK_INSTANCE_LAYERS}" \
|
||||
${PW_GAMEMODERUN_SLR} \
|
||||
${PW_MANGOHUD_SLR} \
|
||||
"${PW_PLUGINS_PATH}/portable/bin/xterm"
|
||||
}
|
||||
|
||||
pw_create_prefix_backup () {
|
||||
cd "$HOME"
|
||||
PW_PREFIX_TO_BACKUP=$("${pw_yad_v12_3}" --file --directory --borders=${YAD_BORDERS} --width=650 --height=500 --auto-close \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --title "$loc_create_pfx_backup_path" 2>/dev/null )
|
||||
YAD_STATUS="$?"
|
||||
if [[ "$YAD_STATUS" == "1" || "$YAD_STATUS" == "252" ]] ; then exit 0 ; fi
|
||||
if [[ ! -z "$(grep "/${PW_PREFIX_NAME}/" "${PORT_WINE_PATH}"/*.desktop )" ]] ; then
|
||||
try_remove_file "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.create_shortcut"
|
||||
grep "/${PW_PREFIX_NAME}/" "${PORT_WINE_PATH}"/*.desktop | awk -F"/${PW_PREFIX_NAME}/" '{print $2}' \
|
||||
| awk -F\" '{print $1}' > "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.create_shortcut"
|
||||
fi
|
||||
unset PW_SANDBOX_HOME_PATH
|
||||
export PW_ADD_TO_ARGS_IN_RUNTIME="--xterm"
|
||||
pw_init_runtime
|
||||
chmod -R u+w "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"
|
||||
${pw_runtime} env PATH="${PATH}" LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" mksquashfs "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}" "${PW_PREFIX_TO_BACKUP}/${PW_PREFIX_NAME}.ppack.part" -comp zstd &
|
||||
sleep 10
|
||||
while true ; do
|
||||
if [[ ! -z $(pgrep -a xterm | grep ".ppack.part" | head -n 1 | awk '{print $1}') ]] ; then
|
||||
sleep 0.5
|
||||
else
|
||||
kill -TERM $(pgrep -a mksquashfs | grep ".ppack.part" | head -n 1 | awk '{print $1}')
|
||||
sleep 0.3
|
||||
if [[ -z "$(pgrep -a mksquashfs | grep ".ppack.part" | head -n 1 | awk '{print $1}')" ]]
|
||||
then break
|
||||
else sleep 0.3
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ -f "${PW_PREFIX_TO_BACKUP}/${PW_PREFIX_NAME}.ppack.part" ]] ; then
|
||||
mv -f "${PW_PREFIX_TO_BACKUP}/${PW_PREFIX_NAME}.ppack.part" "${PW_PREFIX_TO_BACKUP}/${PW_PREFIX_NAME}.ppack"
|
||||
yad_info "$PW_PFX_BACKUP_SUCCESS $PW_PREFIX_NAME"
|
||||
if [[ ! -f "${PORT_WINE_TMP_PATH}/pfx_backup_info" ]] ; then
|
||||
yad_info "$PW_PFX_BACKUP_INFO"
|
||||
echo "1" > "${PORT_WINE_TMP_PATH}/pfx_backup_info"
|
||||
fi
|
||||
else
|
||||
yad_error "$PW_PFX_BACKUP_ERROR $PW_PREFIX_NAME"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
pw_edit_db () {
|
||||
if [[ "${XDG_SESSION_TYPE}" == "wayland" ]] ; then
|
||||
pw_gui_for_edit_db \
|
||||
PW_MANGOHUD PW_MANGOHUD_USER_CONF ENABLE_VKBASALT PW_VKBASALT_USER_CONF PW_NO_ESYNC PW_NO_FSYNC PW_USE_RAY_TRACING \
|
||||
PW_USE_NVAPI_AND_DLSS PW_USE_FAKE_DLSS PW_USE_FAKE_DLSS_3 PW_WINE_FULLSCREEN_FSR PW_HIDE_NVIDIA_GPU PW_VIRTUAL_DESKTOP \
|
||||
PW_USE_TERMINAL PW_GUI_DISABLED_CS PW_USE_GAMEMODE PW_USE_D3D_EXTRAS PW_FIX_VIDEO_IN_GAME PW_REDUCE_PULSE_LATENCY \
|
||||
PW_USE_GSTREAMER PW_FORCE_LARGE_ADDRESS_AWARE PW_USE_SHADER_CACHE PW_USE_WINE_DXGI PW_USE_EAC_AND_BE PW_USE_SYSTEM_VK_LAYERS \
|
||||
PW_USE_OBS_VKCAPTURE PW_USE_GALLIUM_ZINK PW_USE_GAMESCOPE PW_DISABLE_COMPOSITING PW_USE_RUNTIME
|
||||
else
|
||||
pw_gui_for_edit_db \
|
||||
PW_MANGOHUD PW_MANGOHUD_USER_CONF ENABLE_VKBASALT PW_VKBASALT_USER_CONF PW_NO_ESYNC PW_NO_FSYNC PW_USE_RAY_TRACING \
|
||||
PW_USE_NVAPI_AND_DLSS PW_USE_FAKE_DLSS PW_USE_FAKE_DLSS_3 PW_WINE_FULLSCREEN_FSR PW_HIDE_NVIDIA_GPU PW_VIRTUAL_DESKTOP \
|
||||
PW_USE_TERMINAL PW_GUI_DISABLED_CS PW_USE_GAMEMODE PW_USE_D3D_EXTRAS PW_FIX_VIDEO_IN_GAME PW_REDUCE_PULSE_LATENCY\
|
||||
PW_USE_US_LAYOUT PW_USE_GSTREAMER PW_FORCE_LARGE_ADDRESS_AWARE PW_USE_SHADER_CACHE PW_USE_WINE_DXGI PW_USE_EAC_AND_BE \
|
||||
PW_USE_SYSTEM_VK_LAYERS PW_USE_OBS_VKCAPTURE PW_USE_GALLIUM_ZINK PW_USE_GAMESCOPE PW_DISABLE_COMPOSITING PW_USE_RUNTIME
|
||||
fi
|
||||
# PW_FORCE_USE_VSYNC HEAP_DELAY_FREE
|
||||
}
|
||||
|
||||
pw_autoinstall_from_db () {
|
||||
export PW_USER_TEMP="${PORT_WINE_TMP_PATH}"
|
||||
export PW_FORCE_LARGE_ADDRESS_AWARE=1
|
||||
export PW_USE_GAMEMODE=0
|
||||
export PW_CHECK_AUTOINSTAL=1
|
||||
export PW_GUI_DISABLED_CS=1
|
||||
export PW_NO_WRITE_WATCH=0
|
||||
export PW_VULKAN_USE=1
|
||||
export PW_USE_EAC_AND_BE=0
|
||||
export PW_NO_FSYNC=1
|
||||
export PW_NO_ESYNC=1
|
||||
unset PORTWINE_CREATE_SHORTCUT_NAME
|
||||
export PW_DISABLED_CREATE_DB=1
|
||||
export PW_MANGOHUD=0
|
||||
export ENABLE_VKBASALT=0
|
||||
export PW_USE_D3D_EXTRAS=1
|
||||
. "${PORT_SCRIPTS_PATH}/pw_autoinstall/${PW_YAD_SET}"
|
||||
}
|
||||
|
||||
gui_credits () {
|
||||
. "${PORT_SCRIPTS_PATH}/credits"
|
||||
}
|
||||
export -f gui_credits
|
||||
|
||||
###MAIN###
|
||||
|
||||
# CLI
|
||||
case "${1}" in
|
||||
'--help' )
|
||||
files_from_autoinstall=$(ls "${PORT_SCRIPTS_PATH}/pw_autoinstall")
|
||||
files_from_autoinstall=$(ls "${PORT_SCRIPTS_PATH}/pw_autoinstall")
|
||||
echo -e "
|
||||
use: [--reinstall] [--autoinstall]
|
||||
|
||||
@ -683,13 +262,10 @@ use: [--reinstall] [--autoinstall]
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
PW_PREFIX_NAME="$(echo "${PW_PREFIX_NAME}" | sed -e s/[[:blank:]]/_/g)"
|
||||
PW_ALL_PREFIXES=$(ls "${PORT_WINE_PATH}/data/prefixes/" | sed -e s/"${PW_PREFIX_NAME}$"//g)
|
||||
export PW_PREFIX_NAME PW_ALL_PREFIXES
|
||||
### GUI ###
|
||||
|
||||
# if [[ ! -z "${PORTWINE_DB}" ]] && [[ -z `echo "${PW_PREFIX_NAME}" | grep -i "$(echo "${PORTWINE_DB}" | sed -e s/[[:blank:]]/_/g)"` ]] ; then
|
||||
# export PW_PREFIX_NAME="${PW_PREFIX_NAME}!`echo "${PORTWINE_DB}" | sed -e s/[[:blank:]]/_/g`"
|
||||
# fi
|
||||
export PW_PREFIX_NAME="$(echo "${PW_PREFIX_NAME}" | sed -e s/[[:blank:]]/_/g)"
|
||||
export PW_ALL_PREFIXES=$(ls "${PORT_WINE_PATH}/data/prefixes/" | sed -e s/"${PW_PREFIX_NAME}$"//g)
|
||||
|
||||
unset PW_ADD_PREFIXES_TO_GUI
|
||||
IFS_OLD=$IFS
|
||||
@ -790,99 +366,6 @@ if [[ -f "${portwine_exe}" ]] ; then
|
||||
portwine_launch
|
||||
fi
|
||||
else
|
||||
button_click () {
|
||||
[[ ! -z "$1" ]] && echo "$1" > "${PORT_WINE_TMP_PATH}/tmp_yad_form"
|
||||
if [[ ! -z $(pidof -s yad) ]] || [[ ! -z $(pidof -s yad_v12_3) ]] ; then
|
||||
kill -s SIGUSR1 $(pgrep -a yad | grep "\--key=${KEY} \--notebook" | awk '{print $1}') > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
export -f button_click
|
||||
|
||||
run_desktop_b_click () {
|
||||
[[ ! -z "$1" ]] && echo "$1" > "${PORT_WINE_TMP_PATH}/tmp_yad_form"
|
||||
if [[ ! -z $(pidof -s yad) ]] || [[ ! -z $(pidof -s yad_v12_3) ]] ; then
|
||||
kill -s SIGUSR1 $(pgrep -a yad | grep "\--key=${KEY} \--notebook" | awk '{print $1}') > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
if check_flatpak
|
||||
then PW_EXEC_FROM_DESKTOP="$(cat "${PORT_WINE_PATH}/${PW_YAD_SET//¬/" "}" | grep Exec | head -n 1 | sed 's|flatpak run ru.linux_gaming.PortProton|\"${PORT_SCRIPTS_PATH}/start.sh\"|' | awk -F'=' '{print $2}')"
|
||||
else PW_EXEC_FROM_DESKTOP="$(cat "${PORT_WINE_PATH}/${PW_YAD_SET//¬/" "}" | grep Exec | head -n 1 | awk -F"=env " '{print $2}')"
|
||||
fi
|
||||
|
||||
print_info "Restarting PP after choose desktop file..."
|
||||
# stop_portwine
|
||||
export SKIP_CHECK_UPDATES=1
|
||||
/usr/bin/env bash -c "${PW_EXEC_FROM_DESKTOP}" &
|
||||
exit 0
|
||||
}
|
||||
export -f run_desktop_b_click
|
||||
|
||||
gui_clear_pfx () {
|
||||
if yad_question "${port_clear_pfx}" ; then
|
||||
pw_clear_pfx
|
||||
print_info "Restarting PP after clearing prefix..."
|
||||
export SKIP_CHECK_UPDATES=1
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
export -f gui_clear_pfx
|
||||
|
||||
gui_rm_portproton () {
|
||||
if yad_question "${port_del2}" ; then
|
||||
rm -fr "${PORT_WINE_PATH}"
|
||||
rm -fr "${PORT_WINE_TMP_PATH}"
|
||||
rm -fr "${HOME}/PortWINE"
|
||||
rm -f $(grep -il PortProton "${HOME}/.local/share/applications"/*)
|
||||
update-desktop-database -q "${HOME}/.local/share/applications"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
export -f gui_rm_portproton
|
||||
|
||||
gui_pw_update () {
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||
print_info "Restarting PP for check update..."
|
||||
export SKIP_CHECK_UPDATES=1
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
}
|
||||
|
||||
change_loc () {
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/${portname}_loc"
|
||||
print_info "Restarting PP for change language..."
|
||||
export SKIP_CHECK_UPDATES=1
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
}
|
||||
|
||||
gui_wine_uninstaller () {
|
||||
start_portwine
|
||||
pw_run uninstaller
|
||||
}
|
||||
export -f gui_wine_uninstaller
|
||||
|
||||
gui_open_user_conf () {
|
||||
xdg-open "${PORT_WINE_PATH}/data/user.conf"
|
||||
}
|
||||
export -f gui_open_user_conf
|
||||
|
||||
gui_open_scripts_from_backup () {
|
||||
cd "${PORT_WINE_TMP_PATH}/scripts_backup/"
|
||||
PW_SCRIPT_FROM_BACKUP=$("${pw_yad_v12_3}" --file --borders=${YAD_BORDERS} --width=650 --height=500 --auto-close \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --title "SCRIPTS FROM BACKUP" --file-filter="backup_scripts|scripts_v*.tar.gz" 2>/dev/null )
|
||||
YAD_STATUS="$?"
|
||||
if [[ "$YAD_STATUS" == "1" || "$YAD_STATUS" == "252" ]] ; then exit 0 ; fi
|
||||
unpack_tar_gz "$PW_SCRIPT_FROM_BACKUP" "${PORT_WINE_PATH}/data/"
|
||||
echo "0" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||
print_info "Restarting PP after backup..."
|
||||
export SKIP_CHECK_UPDATES=1
|
||||
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||
exit 0
|
||||
}
|
||||
export -f gui_open_scripts_from_backup
|
||||
|
||||
|
||||
export KEY="$RANDOM"
|
||||
|
||||
orig_IFS="$IFS" && IFS=$'\n'
|
||||
|
Reference in New Issue
Block a user