Commit 52958992 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'Boria138-mangohud-basic-gui'

parents 31575b17 d6f35c00
......@@ -30,12 +30,40 @@
## Установка с помощью пакетов
* **Alt Linux**
`apt-get` :
```sh
su -
apt-get update && apt-get dist-upgrade -y
apt-get install portproton i586-{libvulkan1,libd3d,libGL,libgio,libnm,libnsl1,libnss,glibc-nss,glibc-pthread,libunwind,xorg-dri-swrast}
exit
```
`Вариант установки с помощью eepm`:
```sh
su -
epm full-upgrade
epm play portproton
exit
```
* **Ubuntu 20.04** (Kubuntu, Xubuntu, Lubuntu, и т.д.), **Linux Mint 20.x** :
[portproton_1.0-2_amd64.deb](https://github.com/Castro-Fidel/PortProton_dpkg/releases/download/portproton_1.0-2_amd64/portproton_1.0-2_amd64.deb)
* **Arch Linux** и производные (Manjaro, Garuda, и т.д.) :
[AUR](https://aur.archlinux.org/packages/portproton)
* **OpenSuse**:
[OBS](https://software.opensuse.org/download/package?package=portproton&project=home%3ABoria138%3APortProton)
* **ROSA Linux** устанавливается с помощью этой команды:
```sh
......@@ -50,20 +78,6 @@ sudo dnf copr enable boria138/portproton
sudo dnf install portproton
```
* **Alt Linux** устанавливается с помощью этой команды:
```sh
su -
epm ei
epm full-upgrade
epm play portproton
exit
```
## Универсальный (ручной) метод установки
**ВНИМАНИЕ** : при универсальном способе установки PortProton зависимости должны быть установлены вручную!
......
......@@ -30,33 +30,23 @@ Includes a set of scripts combined with wine-proton itself, a Steam Runtime Snip
## Installation using packages
* **Ubuntu 20.04** (Kubuntu, Xubuntu, Lubuntu, etc.), **Linux Mint 20.x** :
[portproton_1.0-2_amd64.deb](https://github.com/Castro-Fidel/PortProton_dpkg/releases/download/portproton_1.0-2_amd64/portproton_1.0-2_amd64.deb)
* **Arch Linux** and derivatives (Manjaro, Garuda, etc.) :
[AUR](https://aur.archlinux.org/packages/portproton)
* **OpenSuse**:
[OBS](https://software.opensuse.org/download/package?package=portproton&project=home%3ABoria138%3APortProton)
* **ROSA Linux** (package in the official repository) is installed with the command:
* **Alt Linux** (package in the official repository) is installed with the command:
`apt-get`:
```sh
sudo urpmi portproton
```
su -
* **Fedora 37+** and **Nobara**:
apt-get update && apt-get dist-upgrade -y
```sh
sudo dnf copr enable boria138/portproton
apt-get install portproton i586-{libvulkan1,libd3d,libGL,libgio,libnm,libnsl1,libnss,glibc-nss,glibc-pthread,libunwind,xorg-dri-swrast}
sudo dnf install portproton
exit
```
* **Alt Linux** (package in the official repository) is installed with the command:
`epm`:
```sh
su -
epm ei
epm full-upgrade
epm play portproton
......@@ -64,6 +54,30 @@ epm play portproton
exit
```
* **ROSA Linux** (package in the official repository) is installed with the command:
```sh
sudo urpmi portproton
```
* **Ubuntu 20.04** (Kubuntu, Xubuntu, Lubuntu, etc.), **Linux Mint 20.x** :
[portproton_1.0-2_amd64.deb](https://github.com/Castro-Fidel/PortProton_dpkg/releases/download/portproton_1.0-2_amd64/portproton_1.0-2_amd64.deb)
* **Arch Linux** and derivatives (Manjaro, Garuda, etc.) :
[AUR](https://aur.archlinux.org/packages/portproton)
* **OpenSuse**:
[OBS](https://software.opensuse.org/download/package?package=portproton&project=home%3ABoria138%3APortProton)
* **Fedora 37+** and **Nobara**:
```sh
sudo dnf copr enable boria138/portproton
sudo dnf install portproton
```
## Universal (manual) installation
**ATTENTION** : with the universal method of installing PortProton, dependencies must be installed manually!
......@@ -163,11 +177,13 @@ sudo dnf install curl gamemode gamemode.i686 icoutils wget zenity bubblewrap zst
* **Alt Linux**
```sh
sudo apt-get update
su -
sudo apt-get dist-upgrade -y
apt-get update && apt-get dist-upgrade -y
sudo apt-get install bubblewrap cabextract curl gamemode icoutils i586-libvulkan1 libvulkan1 steam vulkan-tools wget zenity zstd
apt-get install bubblewrap cabextract wget zstd gawk tar xz pciutils bc coreutils file curl icoutils wmctrl zenity xdg-utils desktop-file-utils libvulkan1 vulkan-tools libd3d libGL gamemode fontconfig xrdb libcurl libgio libnm libnsl1 libnss glibc-nss glibc-pthread i586-{libvulkan1,libd3d,libGL,libgio,libnm,libnsl1,libnss,glibc-nss,glibc-pthread,libunwind,xorg-dri-swrast}
exit
```
* **ROSA DESKTOP FRESH R12**
......
......@@ -2,6 +2,16 @@ You can help us in the development of the project on the website: https://linux-
----------------------------------------
Changelog:
###Scripts version 2241### Date: 28.12.2023 / Download update size: 8 megabytes
* HOTFIX - VKD3D
###Scripts version 2240### Date: 28.12.2023 / Download update size: 8 megabytes
* the variable "DX12_DISABLE" has been removed from EDIT_DB (deprecated function)
* Vulkan driver verification has been transferred to the log creation mode
* updated the version check of the World Of Sea Battle game before installation
* The Wayland warning has been removed
* added the variable "PW_RESTORE_RESOLUTION" to EDIT_BD (thanks to Boria138)
###Scripts version 2239### Date: 17.12.2023 / Download update size: 8 megabytes
* fixed the launch of League of Legends (to fix it, run the auto-installation)
* added correct verification of the vulkan driver, without installing vulkan-tools into the system
......
......@@ -2,8 +2,15 @@
-----------------------------------------
История изменений:
###Scripts version 2241### Дата: 28.12.2023 / Размер скачиваемого обновления: 8 мегабайт
* HOTFIX - VKD3D (определение DX12 в некоторых играх)
###Scripts version 2240### Дата: 28.12.2023 / Размер скачиваемого обновления: 8 мегабайт
* удалена переменная "DX12_DISABLE" из EDIT_DB (устаревшая функция)
* произведен перенос проверки драйвера Vulkan в режим зоздания лога
* произведен перенос проверки драйвера Vulkan в режим создания лога
* обновлена проверка версии игры World Of Sea Battle перед установкой
* удалено предупреждение о Wayland
* добавлена переменная "PW_RESTORE_RESOLUTION" в EDIT_BD (спасибо Boria138)
###Scripts version 2239### Дата: 17.12.2023 / Размер скачиваемого обновления: 8 мегабайт
* исправлен запуск League of Legends (для исправления запустите автоустановку)
......
......@@ -631,9 +631,14 @@ stop_portwine () {
if [[ "$int_xneur" == "1" ]] ; then
xneur &
fi
if [[ "$PW_USE_US_LAYOUT" == "1" ]] ; then
if [[ "$PW_USE_US_LAYOUT" == "1" ]] && [[ "${XDG_SESSION_TYPE}" != "wayland" ]] && command -v setxkbmap &>/dev/null ; then
setxkbmap
fi
if [[ "${PW_RESTORE_RESOLUTION}" == "1" ]] && [[ "${XDG_SESSION_TYPE}" != "wayland" ]] && command -v xrandr &>/dev/null ; then
RESOLUTION=$(sed -n '1p' "${PORT_WINE_TMP_PATH}/tmp_screen_configuration")
OUTPUT_SCREEN=$(sed -n '2p' "${PORT_WINE_TMP_PATH}/tmp_screen_configuration")
xrandr --output "$OUTPUT_SCREEN" --mode "$RESOLUTION"
fi
pw_stop_progress_bar
try_remove_file "${PORT_SCRIPTS_PATH}/0"
try_remove_file "${PORT_SCRIPTS_PATH}/1"
......
......@@ -7,7 +7,7 @@ export LAUNCH_PARAMETERS=("/S")
export PW_DLL_INSTALL="faudio dotnet48"
export PW_VULKAN_USE=1
WOSB_VERSION="$(curl -s --list-only --connect-timeout 3 https://www.worldofseabattle.com/download2 2>/dev/null | grep '/web_installer.exe' | awk -F'xsolla-launcher-update/' '{print $2}' | awk -F'/' '{print $1}')"
WOSB_VERSION="$(curl -s --list-only --connect-timeout 3 https://www.worldofseabattle.com/download2 2>/dev/null | grep 'installer.exe' | awk -F'xsolla-launcher-update/' '{print $2}' | awk -F'/' '{print $1}')"
[[ ! -z "$WOSB_VERSION" ]] && print_info "Found version: $WOSB_VERSION" || zenity_error "Error while get version of WOSB INSTALLER."
start_portwine
......
......@@ -389,11 +389,17 @@ start_portwine () {
if [[ "${PW_REDUCE_PULSE_LATENCY}" == 1 ]] ; then
export PULSE_LATENCY_MSEC=60
# export PIPEWIRE_LATENCY=128/48000
else
unset PULSE_LATENCY_MSEC
fi
if [[ "${PW_USE_US_LAYOUT}" == "1" ]] && ! grep 1 "${PORT_WINE_TMP_PATH}/check_wayland" &>/dev/null ; then
if [[ "${PW_RESTORE_RESOLUTION}" == "1" ]] && [[ "${XDG_SESSION_TYPE}" != "wayland" ]] && command -v xrandr &>/dev/null ; then
xrandr | grep -oP 'current\s+\K[0-9]+ x [0-9]+' | tr -d ' ' > "${PORT_WINE_TMP_PATH}/tmp_screen_configuration"
xrandr | grep " connected" | awk '{print $1}' >> "${PORT_WINE_TMP_PATH}/tmp_screen_configuration"
fi
if [[ "$PW_USE_US_LAYOUT" == "1" ]] && [[ "${XDG_SESSION_TYPE}" != "wayland" ]] && command -v setxkbmap &>/dev/null ; then
setxkbmap -model pc101 us -print | xkbcomp - $DISPLAY &>/dev/null
else
export PW_USE_US_LAYOUT="0"
......@@ -424,25 +430,14 @@ start_portwine () {
fi
done
fi
print_info "Try link wine DXGI by default..."
if ! try_force_link_file "${WINEDIR}"/lib/wine/fakedlls/dxgi.dll "${WINEPREFIX}/drive_c/windows/syswow64/dxgi.dll"
then try_force_link_file "${WINEDIR}"/lib/wine/i386-windows/dxgi.dll "${WINEPREFIX}/drive_c/windows/syswow64/dxgi.dll"
fi
if ! try_force_link_file "${WINEDIR}"/lib64/wine/fakedlls/dxgi.dll "${WINEPREFIX}/drive_c/windows/system32/dxgi.dll"
then try_force_link_file "${WINEDIR}"/lib64/wine/x86_64-windows/dxgi.dll "${WINEPREFIX}/drive_c/windows/system32/dxgi.dll"
fi
print_info "Try link wine d3d filese by default..."
for rm_vulkan_dll in libvkd3d-1 libvkd3d-shader-1 dxvk_config nvapi nvapi64 ; do
try_remove_file "${WINEPREFIX}/drive_c/windows/system32/${wine_build_dll}.dll"
try_remove_file "${WINEPREFIX}/drive_c/windows/syswow64/${wine_build_dll}.dll"
print_info "Try link wine d3d files by default..."
for rm_vulkan_dll in libvkd3d-1 libvkd3d-shader-1 dxvk_config nvapi nvapi64 d3d12core d3d12 d3d11 d3d10 d3d10core d3d10_1 d3d9 d3d8 dxgi wined3d ; do
try_remove_file "${WINEPREFIX}/drive_c/windows/system32/${rm_vulkan_dll}.dll"
try_remove_file "${WINEPREFIX}/drive_c/windows/syswow64/${rm_vulkan_dll}.dll"
done
for wine_build_dll in d3d12core d3d12 d3d11 d3d10 d3d10core d3d10_1 d3d9 d3d8 dxgi wined3d ; do
if ! try_force_link_file "${WINEDIR}/lib/wine/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_build_dll}.dll"
then try_force_link_file "${WINEDIR}/lib/wine/i386-windows/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_build_dll}.dll"
fi
if ! try_force_link_file "${WINEDIR}/lib64/wine/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_build_dll}.dll"
then try_force_link_file "${WINEDIR}/lib64/wine/x86_64-windows/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_build_dll}.dll"
fi
try_force_link_file "${WINEDIR}/lib/wine/i386-windows/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_build_dll}.dll"
try_force_link_file "${WINEDIR}/lib64/wine/x86_64-windows/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_build_dll}.dll"
done
create_new_dir "${PW_VULKAN_DIR}/opengl"
......@@ -521,9 +516,11 @@ start_portwine () {
print_info "Try link native DXVK files..."
for wine_dxvk_dll in ${CP_DXVK_FILES} ; do
if [[ -f "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" ]] ; then
try_force_link_file "${PATH_TO_DXVK_FILES}/x32/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_dxvk_dll}.dll"
try_force_link_file "${PATH_TO_DXVK_FILES}/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_dxvk_dll}.dll"
[[ "$?" == 0 ]] && var_winedlloverride_update "${wine_dxvk_dll}=n"
var_winedlloverride_update "${wine_dxvk_dll}=n"
fi
done
try_force_link_file "${PATH_TO_DXVK_FILES}/x32/nvapi.dll" "${WINEPREFIX}/drive_c/windows/syswow64/" || \
......@@ -539,6 +536,7 @@ start_portwine () {
if [[ -f "${PATH_TO_VKD3D_FILES}/x64/${wine_vkd3d_dll}.dll" ]] ; then
try_force_link_file "${PATH_TO_VKD3D_FILES}/x86/${wine_vkd3d_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/${wine_vkd3d_dll}.dll"
try_force_link_file "${PATH_TO_VKD3D_FILES}/x64/${wine_vkd3d_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/${wine_vkd3d_dll}.dll"
var_winedlloverride_update "${wine_vkd3d_dll}=n"
fi
done
......
......@@ -23,11 +23,6 @@ fi
[[ "$MISSING_DESKTOP_FILE" == 1 ]] && portwine_missing_shortcut
if [[ "${XDG_SESSION_TYPE}" = "wayland" ]] && [[ ! -f "${PORT_WINE_TMP_PATH}/check_wayland" ]]; then
zenity_info "$PW_WAYLAND_INFO"
echo "1" > "${PORT_WINE_TMP_PATH}/check_wayland"
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}')"
......@@ -466,13 +461,22 @@ pw_create_prefix_backup () {
}
pw_edit_db () {
if [[ "${XDG_SESSION_TYPE}" == "wayland" ]] ; then
pw_gui_for_edit_db \
PW_MANGOHUD PW_MANGOHUD_USER_CONF ENABLE_VKBASALT PW_NO_ESYNC PW_NO_FSYNC PW_USE_RAY_TRACING \
PW_USE_NVAPI_AND_DLSS PW_USE_FAKE_DLSS 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_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
if [ "$?" == 0 ] ; then
else
pw_gui_for_edit_db \
PW_MANGOHUD PW_MANGOHUD_USER_CONF ENABLE_VKBASALT PW_NO_ESYNC PW_NO_FSYNC PW_USE_RAY_TRACING \
PW_USE_NVAPI_AND_DLSS PW_USE_FAKE_DLSS 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_RESTORE_RESOLUTION 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
fi
if [[ "$?" == 0 ]] ; then
print_info "Restarting PP after update ppdb file..."
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
......@@ -624,6 +628,7 @@ if [[ -f "${portwine_exe}" ]] ; then
--field="PREFIX : :CBE" "${PW_ADD_PREFIXES_TO_GUI}" \
--field=":LBL" "" \
--button="${loc_gui_vkbasalt_start}"!"$PW_GUI_ICON_PATH/separator.png"!"${ENABLE_VKBASALT_INFO}":120 \
--button="${loc_gui_mh_start}"!"$PW_GUI_ICON_PATH/separator.png"!"${ENABLE_MANGOHUD_INFO}":119 \
--button="${loc_gui_edit_db_start}"!"$PW_GUI_ICON_PATH/separator.png"!"${loc_edit_db} ${PORTWINE_DB}":118 \
--button="${PW_SHORTCUT}" \
--button="${loc_gui_debug}"!"$PW_GUI_ICON_PATH/separator.png"!"${loc_debug}":102 \
......@@ -930,6 +935,7 @@ fi
open_changelog) open_changelog ;;
change_loc) change_loc ;;
120) gui_vkBasalt ;;
119) gui_MangoHud ;;
pw_create_prefix_backup) pw_create_prefix_backup ;;
gui_credits) gui_credits ;;
pw_start_cont_xterm) pw_start_cont_xterm ;;
......
#!/usr/bin/env bash
#Author: Castro-Fidel (linux-gaming.ru)
#SCRIPTS_NEXT_VERSION=2239
#SCRIPTS_NEXT_VERSION=2241
########################################################################
export PW_MANGOHUD=0
export MANGOHUD_CONFIG=cpu_stats,cpu_temp,cpu_mhz,cpu_color=2e97cb,cpu_text=CPU,gpu_stats,gpu_temp,gpu_core_clock,gpu_mem_clock,vulkan_driver,gpu_name,gpu_color=2e9762,gpu_text=GPU,vram,vram_color=ad64c1,ram,ram_color=c26693,io_color=a491d3,frame_timing=1,frametime_color=00ff00,time,arch,wine,wine_color=eb5b5b,engine_color=eb5b5b,background_alpha=0.2,font_size=24,background_color=020202,text_color=ffffff,toggle_hud=Shift_R+F12,resolution,vkbasalt
export DEFAULT_MANGOHUD_CONFIG=cpu_stats,cpu_temp,cpu_mhz,cpu_color=2e97cb,cpu_text=CPU,gpu_stats,gpu_temp,gpu_core_clock,gpu_mem_clock,vulkan_driver,gpu_name,gpu_color=2e9762,gpu_text=GPU,vram,vram_color=ad64c1,ram,ram_color=c26693,io_color=a491d3,frame_timing=1,frametime_color=00ff00,time,arch,wine,wine_color=eb5b5b,engine_color=eb5b5b,background_alpha=0.2,font_size=24,background_color=020202,text_color=ffffff,toggle_hud=Shift_R+F12,resolution,vkbasalt,gamemode
#export PW_XKBD_RU_HACK=1
export PW_RT_MOUNT_RO=("")
export PW_RT_MOUNT_RW=("/media" "/mnt" "/run/media/${USER}" "${PORT_WINE_PATH}")
......
......@@ -148,11 +148,6 @@ pw_tray_icon () {
pw_gui_for_edit_db () {
KEY_EDIT_DB_GUI=$RANDOM
if [[ "${MANGOHUD_CONFIG}" == *fps_limit=[0-9]* ]] ; then
FPS_LIMIT_VAR="$(echo ${MANGOHUD_CONFIG} | sed 's/.*fps_limit=//' | awk -F, '{print $1}')"
else
FPS_LIMIT_VAR="disabled"
fi
if [[ "${PW_WINE_CPU_TOPOLOGY}" == *[0-9]:* ]] && [[ "${PW_WINE_CPU_TOPOLOGY}" != "disabled" ]] ; then
CPU_LIMIT_VAR="`echo ${PW_WINE_CPU_TOPOLOGY%%:*}`"
else
......@@ -172,7 +167,6 @@ pw_gui_for_edit_db () {
GET_GPU_NAMES=$("$PW_VULKANINFO_PORTABLE" 2>/dev/null | awk -F '=' '/deviceName/{print $2}' | sed '/llvm/d'| sort -u | sed 's/^ //' | paste -sd '!')
GET_REFRASH_RATE="30!45!60!75!120!144!165!240"
logical_cores=$(grep -c "^processor" /proc/cpuinfo)
if [[ "${logical_cores}" -le "4" ]] ; then
......@@ -217,7 +211,6 @@ pw_gui_for_edit_db () {
--field=":LBL" "" \
--field="${loc_gui_cpu_limit}!${loc_gui_cpu_limit_help} :CB" "${CPU_LIMIT_VAR}!disabled!${GET_LOGICAL_CORE}" \
--field="${loc_gui_gpu_select}!${loc_gui_gpu_select_help} :CB" "${GPU_VAR}!disabled!${GET_GPU_NAMES}" \
--field="${loc_gui_mango_fps}!${loc_gui_mango_fps_help} :CB" "${FPS_LIMIT_VAR}!disabled!${GET_REFRASH_RATE}" \
--field="${loc_gui_arg_gamescope}!${loc_gui_arg_gamescope_help} :CBE" "\\${GAMESCOPE_ARGS}!-r 60 -F fsr!" 2>/dev/null 1> "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" 2>/dev/null &
"${pw_yad_v12_3}" --paned --key="$KEY_EDIT_DB_GUI" --title "EDIT_DB" --text-align=center --height="800" \
......@@ -254,26 +247,16 @@ pw_gui_for_edit_db () {
LAUNCH_PARAMETERS=`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $5}'`
CPU_LIMIT="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $7}'`"
PW_GPU_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $8}'`"
FPS_LIMIT="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}'`"
GAMESCOPE_ARGS="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}'`"
GAMESCOPE_ARGS="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}'`"
# PW_AMD_VULKAN_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}'`"
if [[ "${FPS_LIMIT}" != "disabled" ]] && [[ "${FPS_LIMIT_VAR}" != "disabled" ]] ; then
export MANGOHUD_CONFIG="$(echo ${MANGOHUD_CONFIG} | sed "s/fps_limit=${FPS_LIMIT_VAR}/fps_limit=${FPS_LIMIT}/")"
export PW_MANGOHUD=1
elif [[ "${FPS_LIMIT}" != "disabled" ]] && [[ "${FPS_LIMIT_VAR}" == "disabled" ]] ; then
export MANGOHUD_CONFIG=${MANGOHUD_CONFIG},fps_limit=${FPS_LIMIT}
export PW_MANGOHUD=1
elif [[ "${FPS_LIMIT}" == "disabled" ]] ; then
export MANGOHUD_CONFIG="$(echo ${MANGOHUD_CONFIG} | sed "s/,fps_limit=${FPS_LIMIT_VAR}//" | sed "s/,fps_limit=//")"
fi
if [[ "${CPU_LIMIT}" != "disabled" ]] ; then
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
else
export PW_WINE_CPU_TOPOLOGY="disabled"
fi
echo "pw_gui_for_edit_db PORTWINE_DB_FILE=$PORTWINE_DB_FILE"
edit_db_from_gui $@ MANGOHUD_CONFIG LAUNCH_PARAMETERS PW_WINDOWS_VER PW_DLL_INSTALL WINEDLLOVERRIDES PW_WINE_CPU_TOPOLOGY GAMESCOPE_ARGS
edit_db_from_gui $@ LAUNCH_PARAMETERS PW_WINDOWS_VER PW_DLL_INSTALL WINEDLLOVERRIDES PW_WINE_CPU_TOPOLOGY GAMESCOPE_ARGS
edit_user_conf_from_gui PW_GPU_USE
# PW_AMD_VULKAN_USE
return 0
......@@ -510,6 +493,114 @@ gui_vkBasalt () {
exit 0
}
gui_MangoHud() {
KEY_MH_GUI=$RANDOM
LIST_MH=(
arch battery battery_icon battery_time battery_watt core_bars core_load
cpu_mhz cpu_power cpu_temp device_battery_icon engine_short_names
engine_version exec_name fcat fps_metrics fps_only frame_count full
gamemode gpu_core_clock gpu_fan gpu_junction_temp gpu_mem_clock
gpu_mem_temp gpu_name gpu_power gpu_temp gpu_voltage histogram horizontal
horizontal_stretch hud_compact hud_no_margin io_read io_write no_display
no_small_font procmem procmem_shared procmem_virt ram resolution
show_fps_limit swap temp_fahrenheit throttling_status throttling_status_graph
time version vkbasalt vram vulkan_driver wine
)
unset ADD_GUI_MH GUI_MH_RESULT
GET_REFRASH_RATE="30!45!60!75!120!144!165!240"
if [[ -z "$FPS_LIMIT" ]]; then
FPS_LIMIT_VAR="disabled"
else
FPS_LIMIT_VAR="${FPS_LIMIT}"
fi
if [ -n "$MANGOHUD_CONFIG" ]; then
PW_MANGOHUD_CONFIG=($(echo "$MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
else
PW_MANGOHUD_CONFIG=($(echo "$DEFAULT_MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
fi
for add_list_mh in "${LIST_MH[@]}"; do
PW_MH_GUI_HELP="PW_MH_${add_list_mh}_INFO"
if [[ -n "$(grep -wo "$add_list_mh" <<<"${PW_MANGOHUD_CONFIG[@]}")" ]]; then
ADD_GUI_MH+="--field=$add_list_mh!${!PW_MH_GUI_HELP}:CHK%TRUE%"
else
ADD_GUI_MH+="--field=$add_list_mh!${!PW_MH_GUI_HELP}:CHK%FALSE%"
fi
done
export old_IFS=$IFS
export IFS="%"
"${pw_yad_v12_3}" --plug=$KEY_MH_GUI --tabnum="1" --form --columns=5 --separator=" " \
--text-align=center --text="$loc_gui_mh_top" \
${ADD_GUI_MH} 1> "${PORT_WINE_TMP_PATH}/tmp_yad_mh_set" 2>/dev/null &
export IFS="${old_IFS}"
"${pw_yad_v12_3}" --plug=$KEY_MH_GUI --tabnum="2" --separator=" " --form \
--field="${loc_gui_mango_fps}!${loc_gui_mango_fps_help} :CB" "${FPS_LIMIT_VAR}!disabled!${GET_REFRASH_RATE}" \
1> "${PORT_WINE_TMP_PATH}/tmp_yad_mh_fps_limit" 2>/dev/null &
"${pw_yad_v12_3}" --paned --key="$KEY_MH_GUI" --height="650" --title="MangoHud" --center --borders=3 \
--separator=" " --window-icon="$PW_GUI_ICON_PATH/port_proton.png" \
--button="$loc_gui_cancel"!!"$loc_gui_cancel_help":1 \
--button="$loc_gui_disabled_mh"!!"$loc_gui_disabled_mh_help":183 \
--button="$loc_gui_save_changes"!!"$loc_gui_save_changes_help":184 2>/dev/null
YAD_MANGOHUD_STATUS="$?"
case "${YAD_MANGOHUD_STATUS}" in
1 | 252)
/usr/bin/env bash -c "${pw_full_command_line[*]}" &
exit 0
;;
183)
export PW_MANGOHUD=0
;;
184)
export PW_MANGOHUD=1
;;
esac
YAD_MH_SET=$(<"${PORT_WINE_TMP_PATH}/tmp_yad_mh_set")
FPS_LIMIT=$(<"${PORT_WINE_TMP_PATH}/tmp_yad_mh_fps_limit")
if command -v xrand 2>/dev/null; then
MONITOR_HEIGHT=$(xrandr | grep -oP 'current\s+\K[0-9]+ x [0-9]+' | awk '{print $3}')
MH_FONT_SIZE="font_size=$(expr $MONITOR_HEIGHT / 45)"
fi
INT_COUNT_FX=0
for read_list_mh in ${YAD_MH_SET}; do
if [[ "$read_list_mh" == "TRUE" ]]; then
export GUI_MH_RESULT+="${LIST_MH[$INT_COUNT_FX]},"
fi
export INT_COUNT_FX=$((INT_COUNT_FX + 1))
done
if [ -n "$MH_FONT_SIZE" ]; then
GUI_MH_RESULT="${GUI_MH_RESULT}${MH_FONT_SIZE}"
else
GUI_MH_RESULT="${GUI_MH_RESULT%,}"
fi
if [[ "${FPS_LIMIT}" != "disabled" ]] ; then
export GUI_MH_RESULT=${GUI_MH_RESULT},fps_limit=${FPS_LIMIT}
export PW_MANGOHUD=1
elif [[ "${FPS_LIMIT}" == "disabled" ]] ; then
export GUI_MH_RESULT="$(echo ${GUI_MH_RESULT} | sed "s/,fps_limit=${FPS_LIMIT_VAR}//" | sed "s/,fps_limit=//")"
fi
export MANGOHUD_CONFIG="${GUI_MH_RESULT}"
edit_db_from_gui MANGOHUD_CONFIG PW_MANGOHUD FPS_LIMIT
/usr/bin/env bash -c "${pw_full_command_line[*]}" &
exit 0
}
portwine_create_shortcut () {
pw_create_gui_png
pw_stop_progress_bar
......
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