Commit ed608456 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Scripts version 2083

parent 89b8c3cf
......@@ -2,6 +2,11 @@ You can help us in the development of the project on the website: https://boosty
-----------------------------------------
Changelog:
###Scripts version 2083###
* added displaying the icon of the file being launched in the PortProton GUI
* fixed creation of multiple .png files in .exe directory during shortcut creation
* in the PortProton interface, the "CREATE_SHORTCUT" button expands to "DELETE_SHORTCUT" when the shortcut is enabled in the menu -> games
###Scripts version 2082###
* HOTFIX - AUTOINSTALL for EGS
......
......@@ -2,6 +2,11 @@
-----------------------------------------
История изменений:
###Scripts version 2083###
* добавлено отображение иконки запускаемого файла в графическом интерфейсе PortProton
* исправлено создание множества файлов .png в каталоге с .exe во время создания ярлыка
* в интерфейсе PortProton кнопка "CREATE_SHORTCUT" раскрывается на "DELETE_SHORTCUT" при включении ярылыка в меню -> игры
###Scripts version 2082###
* HOTFIX - AUTOINSTALL для EGS
......
......@@ -346,6 +346,14 @@ init_wine_ver () {
return 0
}
check_vk_icd_file () {
if [[ -f "/usr/share/vulkan/icd.d/nvidia_icd.json" ]] ; then
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json"
elif [[ -f "/etc/vulkan/icd.d/nvidia_icd.json" ]] ; then
export VK_ICD_FILENAMES="/etc/vulkan/icd.d/nvidia_icd.json"
fi
}
regdlloverrides () {
PW_DLL_EXE=`echo $@ | awk -F: '{print $1}'`
PW_DLL_LIB=`echo $@ | awk -F: '{print $2}' | awk -F= '{print $1}'`
......@@ -691,3 +699,30 @@ edit_db_from_gui () {
done
return 0
}
pw_create_gui_png () {
if [ ! -z "${PORTWINE_CREATE_SHORTCUT_NAME}" ] ; then
export PORTPROTON_NAME="${PORTWINE_CREATE_SHORTCUT_NAME}"
else
export PORTPROTON_NAME="$(basename "${portwine_exe}" | sed s/".exe"/""/gi )"
fi
PW_RESIZE_TO=96
if [[ -x "`which wrestool 2>/dev/null`" ]] && [[ ! -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] ; then
try_remove_dir "${PORT_WINE_TMP_PATH}/tmp_img"
create_new_dir "${PORT_WINE_TMP_PATH}/tmp_img"
wrestool -x --output="${PORT_WINE_TMP_PATH}/tmp_img/" -t14 "${portwine_exe}"
cp "$(ls -S -1 "${PORT_WINE_TMP_PATH}/tmp_img/"*".ico" | head -n 1)" "${PORT_WINE_TMP_PATH}/tmp_img/${PORTPROTON_NAME}.ico"
icotool -x --output="${PORT_WINE_TMP_PATH}/tmp_img/" "${PORT_WINE_TMP_PATH}/tmp_img/${PORTPROTON_NAME}.ico"
cp "$(ls -S -1 "${PORT_WINE_TMP_PATH}/tmp_img/"*".png" | head -n 1)" "${PORT_WINE_TMP_PATH}/tmp_img/${PORTPROTON_NAME}.png"
cp -f "${PORT_WINE_TMP_PATH}/tmp_img/${PORTPROTON_NAME}.png" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
if [[ -x "`which "convert" 2>/dev/null`" ]] && [[ -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" ]] && \
[[ -z "`file "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" | grep "${PW_RESIZE_TO} x ${PW_RESIZE_TO}"`" ]] ; then
convert "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" -resize ${PW_RESIZE_TO}x${PW_RESIZE_TO} "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
if [[ ! -z "`file "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" | grep "${PW_RESIZE_TO} x ${PW_RESIZE_TO}"`" ]] ; then
export PW_ICON_FOR_YAD="${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
else
export PW_ICON_FOR_YAD="${PW_GUI_ICON_PATH}/port_proton.png"
fi
}
......@@ -48,7 +48,8 @@ then
export port_debug="Не торопитесь! После окончания работы ${portname}, нажмите STOP."
export loc_creat_shortcut="Создать ярлык для запускаемого файла."
export loc_create_shortcut="Создать ярлык для запускаемого файла."
export loc_delete_shortcut="Удалить ярлык для запускаемого файла."
export loc_debug="Запуск c созданием .log файла в корне ${portname}"
export loc_launch="Запустить файл..."
export loc_winecfg="Запустить winecfg для редактирования настроек префикса ${portname}"
......@@ -153,7 +154,8 @@ then
export PW_WAYLAND_INFO="Attention! You are running $portname in a Wayland session, some features may not be available!\nRestarting your session in X11 is recommended!"
#Helped in translation: ConTI1NuEsZZZ
export loc_creat_shortcut="Create shortcut for select file..."
export loc_create_shortcut="Create shortcut for select file..."
export loc_delete_shortcut="Delete shortcut for select file..."
export loc_debug="Launch with the creation of a .log file at the root ${portname}"
export loc_launch="Run file ..."
export loc_winecfg="Run winecfg to edit prefix settings ${portname}"
......
......@@ -194,6 +194,7 @@ start_portwine () {
fi
if [[ ! -z "${PW_PRIME_RENDER_OFFLOAD}" && "${PW_PRIME_RENDER_OFFLOAD}" != 0 ]] ; then
export __NV_PRIME_RENDER_OFFLOAD=1
check_vk_icd_file
fi
if [[ ! -z "${PW_HEAP_DELAY_FREE}" && "${PW_HEAP_DELAY_FREE}" != 0 ]]
then export WINE_HEAP_DELAY_FREE="1"
......@@ -216,13 +217,6 @@ start_portwine () {
if [ -x "`which optimus-manager 2>/dev/null`" ]; then
export check_optimus_manager=`optimus-manager --status | grep Current | cut -f 2 -d':' | sed -e 's/^[[:space:]]*//'`
fi
check_vk_icd_file () {
if [[ -f "/usr/share/vulkan/icd.d/nvidia_icd.json" ]] ; then
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json"
elif [[ -f "/etc/vulkan/icd.d/nvidia_icd.json" ]] ; then
export VK_ICD_FILENAMES="/etc/vulkan/icd.d/nvidia_icd.json"
fi
}
if [[ ! -z "${PW_NVIDIA}" && "${check_optimus_manager}" != "intel" ]] ; then
if [ "${check_optimus_manager}" = "nvidia" ]; then
check_vk_icd_file
......@@ -544,9 +538,9 @@ if [[ ! -z "${PW_SILENT_RESTART}" && "${PW_SILENT_RESTART}" = 1 ]] ; then
else
unset PW_GUI_DISABLED_CS
fi
unset MANGOHUD MANGOHUD_DLSYM PW_NO_ESYNC PW_NO_FSYNC PW_VULKAN_USE WINEDLLOVERRIDES PW_NO_WRITE_WATCH PW_YAD_SET
unset MANGOHUD MANGOHUD_DLSYM PW_NO_ESYNC PW_NO_FSYNC PW_VULKAN_USE WINEDLLOVERRIDES PW_NO_WRITE_WATCH PW_YAD_SET PW_ICON_FOR_YAD
unset PW_CHECK_AUTOINSTAL PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS PORTWINE_DB PORTWINE_DB_FILE PW_DISABLED_CREATE_DB
unset CHK_SYMLINK_FILE MESA_GL_VERSION_OVERRIDE PATH_TO_GAME PW_START_DEBUG
unset CHK_SYMLINK_FILE MESA_GL_VERSION_OVERRIDE PATH_TO_GAME PW_START_DEBUG PORTPROTON_NAME PORTWINE_CREATE_SHORTCUT_NAME
export portname=PortProton
cd "$(dirname "`readlink -f "$0"`")" && export PORT_SCRIPTS_PATH="$(pwd)"
......
......@@ -34,33 +34,14 @@ portwine_launch () {
}
portwine_create_shortcut () {
if [ ! -z "${portwine_exe}" ]; then
PORTPROTON_EXE="${portwine_exe}"
else
PORTPROTON_EXE=$(zenity --file-selection --file-filter=""*.exe" "*.bat"" \
--title="${sc_path}" --filename="${PORT_WINE_PATH}/data/pfx/drive_c/")
if [ $? -eq 1 ];then exit 1; fi
fi
if [ ! -z "${PORTWINE_CREATE_SHORTCUT_NAME}" ] ; then
export PORTPROTON_NAME="${PORTWINE_CREATE_SHORTCUT_NAME}"
else
PORTPROTON_NAME="$(basename "${PORTPROTON_EXE}" | sed s/".exe"/""/gi )"
fi
PORTPROTON_PATH="$( cd "$( dirname "${PORTPROTON_EXE}" )" >/dev/null 2>&1 && pwd )"
if [ -x "`which wrestool 2>/dev/null`" ]; then
wrestool -x --output="${PORTPROTON_PATH}/" -t14 "${PORTPROTON_EXE}"
cp "$(ls -S -1 "${PORTPROTON_EXE}"*".ico" | head -n 1)" "${PORTPROTON_EXE}.ico"
icotool -x --output="${PORTPROTON_PATH}/" "${PORTPROTON_EXE}.ico"
cp "$(ls -S -1 "${PORTPROTON_EXE}"*".png" | head -n 1)" "${PORTPROTON_EXE}.png"
cp -f "${PORTPROTON_EXE}.png" "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png"
fi
pw_create_gui_png
name_desktop="${PORTPROTON_NAME}"
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop"
echo "Name=${PORTPROTON_NAME}" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
if [ -z "${PW_CHECK_AUTOINSTAL}" ]
then echo "Exec=env "\"${PORT_SCRIPTS_PATH}/start.sh\" \"${PORTPROTON_EXE}\" "" \
then echo "Exec=env "\"${PORT_SCRIPTS_PATH}/start.sh\" \"${portwine_exe}\" "" \
>> "${PORT_WINE_PATH}/${name_desktop}.desktop"
else echo "Exec=env "\"${PORT_SCRIPTS_PATH}/start.sh\" \"${PORTPROTON_EXE}\" "" \
else echo "Exec=env "\"${PORT_SCRIPTS_PATH}/start.sh\" \"${portwine_exe}\" "" \
>> "${PORT_WINE_PATH}/${name_desktop}.desktop"
fi
echo "Type=Application" >> "${PORT_WINE_PATH}/${name_desktop}.desktop"
......@@ -76,6 +57,12 @@ portwine_create_shortcut () {
xdg-open "${PORT_WINE_PATH}" 2>1 >/dev/null &
}
portwine_delete_shortcut () {
rm -f "`grep -il "${portwine_exe}" "${HOME}/.local/share/applications"/*.desktop`"
rm -f "`grep -il "${portwine_exe}" "${PORT_WINE_PATH}"/*.desktop`"
}
portwine_start_debug () {
kill_portwine
export PW_LOG=1
......@@ -206,7 +193,7 @@ portwine_start_debug () {
sed -i '/Uploading is disabled/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=10 --no-buttons --text-align=center \
"$pw_yad" --title="${portname}.log" --borders=7 --no-buttons --text-align=center \
--text-info --show-uri --wrap --center --width=1200 --height=550 --uri-color=red \
--filename="${PORT_WINE_PATH}/${portname}.log"
stop_portwine
......@@ -342,16 +329,23 @@ else
unset PW_GUI_DISABLED_CS
fi
if [ ! -z "${portwine_exe}" ]; then
if [[ -z "${PW_GUI_DISABLED_CS}" || "${PW_GUI_DISABLED_CS}" == 0 ]] ; then
OUTPUT_START=$("${pw_yad}" --text-align=center --text "$PW_COMMENT_DB" --wrap-width=150 --borders=15 --form --center \
--title "${portname}-${install_ver} (${scripts_install_ver})" --image "$PW_GUI_ICON_PATH/port_proton.png" --separator=";" \
if [[ -z "${PW_GUI_DISABLED_CS}" || "${PW_GUI_DISABLED_CS}" == 0 ]] ; then
pw_create_gui_png
grep -il "${portwine_exe}" "${HOME}/.local/share/applications"/*
if [[ "$?" == 1 ]] ; then
PW_SHORTCUT="CREATE SHORTCUT!!${loc_create_shortcut}:100"
else
PW_SHORTCUT="DELETE SHORTCUT!!${loc_delete_shortcut}:98"
fi
OUTPUT_START=$("${pw_yad}" --text-align=center --text "$PW_COMMENT_DB" --wrap-width=150 --borders=7 --form --center \
--title "${portname}-${install_ver} (${scripts_install_ver})" --image "${PW_ICON_FOR_YAD}" --separator=";" \
--window-icon="$PW_GUI_ICON_PATH/port_proton.png" \
--field="Run with :CB" "${PW_DEFAULT_VULKAN_USE}" \
--field="Run with :CB" "${PW_DEFAULT_WINE_USE}" \
--field="3D API : :CB" "${PW_DEFAULT_VULKAN_USE}" \
--field=" WINE : :CB" "${PW_DEFAULT_WINE_USE}" \
--field=":LBL" "" \
--button='VKBASALT'!!"${ENABLE_VKBASALT_INFO}":120 \
--button='EDIT DB'!!"${loc_edit_db} ${PORTWINE_DB}":118 \
--button='CREATE SHORTCUT'!!"${loc_creat_shortcut}":100 \
--button="${PW_SHORTCUT}" \
--button='DEBUG'!!"${loc_debug}":102 \
--button='LAUNCH'!!"${loc_launch}":106 )
export PW_YAD_SET="$?"
......@@ -466,7 +460,7 @@ else
--field='WINEREG'!!"${loc_winereg}":"BTN" '@bash -c "button_click WINEREG"' \
--field='WINETRICKS'!!"${loc_winetricks}":"BTN" '@bash -c "button_click WINETRICKS"' &> "${PORT_WINE_TMP_PATH}/tmp_yad_form_vulkan" &
"${pw_yad}" --key=$KEY --notebook --borders=10 --width=1000 --height=168 --no-buttons --text-align=center \
"${pw_yad}" --key=$KEY --notebook --borders=3 --width=1000 --height=168 --no-buttons --text-align=center \
--window-icon="$PW_GUI_ICON_PATH/port_proton.png" --title "${portname}-${install_ver} (${scripts_install_ver})" --separator=";" \
--tab-pos=right --tab="PORT_PROTON" --tab="AUTOINSTALL" --tab=" EMULATORS" --tab=" SETTINGS" --center
YAD_STATUS="$?"
......@@ -511,6 +505,7 @@ fi
echo "PW_YAD_SET=$PW_YAD_SET"
case "$PW_YAD_SET" in
1|252) exit 0 ;;
98) portwine_delete_shortcut ;;
100) portwine_create_shortcut ;;
DEBUG|102) portwine_start_debug ;;
106) portwine_launch ;;
......
#!/bin/env bash
#Author: Castro-Fidel (PortWINE-Linux.ru)
#SCRIPTS_NEXT_VERSION=2082
#SCRIPTS_NEXT_VERSION=2083
#PORT_NEXT_VERSION=97
########################################################################
export PW_MANGOHUD=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment