Commit 02ebbc74 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'restore-resolution' of https://github.com/Boria138/PortWINE into…

Merge branch 'restore-resolution' of https://github.com/Boria138/PortWINE into Boria138-restore-resolution
parents 30d13c9d fc80455e
...@@ -631,9 +631,14 @@ stop_portwine () { ...@@ -631,9 +631,14 @@ stop_portwine () {
if [[ "$int_xneur" == "1" ]] ; then if [[ "$int_xneur" == "1" ]] ; then
xneur & xneur &
fi 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 setxkbmap
fi 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 pw_stop_progress_bar
try_remove_file "${PORT_SCRIPTS_PATH}/0" try_remove_file "${PORT_SCRIPTS_PATH}/0"
try_remove_file "${PORT_SCRIPTS_PATH}/1" try_remove_file "${PORT_SCRIPTS_PATH}/1"
......
...@@ -147,7 +147,8 @@ if [[ "${update_loc}" == "RUS" ]] ; then ...@@ -147,7 +147,8 @@ if [[ "${update_loc}" == "RUS" ]] ; then
export PW_USE_FAKE_DLSS_INFO='Включить транслятор DLSS в FSR 2 в играх DirectX 12 (проект CyberFSR2)' export PW_USE_FAKE_DLSS_INFO='Включить транслятор DLSS в FSR 2 в играх DirectX 12 (проект CyberFSR2)'
export PW_USE_EAC_AND_BE_INFO='Включить Easy Anti-Cheat and BattlEye Anti-Cheat (требуется если игра использует какой-то из этих античитов)' export PW_USE_EAC_AND_BE_INFO='Включить Easy Anti-Cheat and BattlEye Anti-Cheat (требуется если игра использует какой-то из этих античитов)'
export PW_REDUCE_PULSE_LATENCY_INFO='Уменьшить задержку pulseaudio для исправления прерывистого звука' export PW_REDUCE_PULSE_LATENCY_INFO='Уменьшить задержку pulseaudio для исправления прерывистого звука'
export PW_USE_US_LAYOUT_INFO='Работает только под x11. Принудительное использование английской раскладки (полезно для игр в которых управление верно работает исключительно на английской раскладке)' export PW_USE_US_LAYOUT_INFO='Принудительное использование английской раскладки (полезно для игр в которых управление верно работает исключительно на английской раскладке)'
export PW_RESTORE_RESOLUTION_INFO='Запомнить разрешение экрана при запуске игры и вернуть при закрытие (полезно для игр которые при закрытие меняют разрешение экрана)'
export PW_USE_SYSTEM_VK_LAYERS_INFO='Использовать системные mangohud, vkBasalt, obs-vkcapture и прочие приложения использующие vulkan layers' export PW_USE_SYSTEM_VK_LAYERS_INFO='Использовать системные mangohud, vkBasalt, obs-vkcapture и прочие приложения использующие vulkan layers'
export PW_USE_OBS_VKCAPTURE_INFO='Включить возможность записи в OBS Studio с помощью obs-vkcapture (ВНИМАНИЕ: будет включено принудительное использование системных mangohud, vkBasalt, obs-vkcapture и прочих приложений использующих vulkan layers)' export PW_USE_OBS_VKCAPTURE_INFO='Включить возможность записи в OBS Studio с помощью obs-vkcapture (ВНИМАНИЕ: будет включено принудительное использование системных mangohud, vkBasalt, obs-vkcapture и прочих приложений использующих vulkan layers)'
export PW_USE_GALLIUM_ZINK_INFO='Использовать драйвер zink (OpenGL поверх Vulkan), позволяет использовать vkBasalt в играх на OpenGL (ВНИМАНИЕ: необходима поддержка vulkan, используется wined3d (opengl) вместо dxvk, подходит для игр на OpenGL и старых версий DirectX, на более новых версиях DirectX возможны артефакты)' export PW_USE_GALLIUM_ZINK_INFO='Использовать драйвер zink (OpenGL поверх Vulkan), позволяет использовать vkBasalt в играх на OpenGL (ВНИМАНИЕ: необходима поддержка vulkan, используется wined3d (opengl) вместо dxvk, подходит для игр на OpenGL и старых версий DirectX, на более новых версиях DirectX возможны артефакты)'
...@@ -208,8 +209,6 @@ if [[ "${update_loc}" == "RUS" ]] ; then ...@@ -208,8 +209,6 @@ if [[ "${update_loc}" == "RUS" ]] ; then
export PW_StageDepth_INFO='Позволяет добавлять новые элементы в 3d-пространство внутри игры и применять пользовательские текстуры' export PW_StageDepth_INFO='Позволяет добавлять новые элементы в 3d-пространство внутри игры и применять пользовательские текстуры'
export PW_PPFX_Bloom_INFO='Добавляет Bloom эффект' export PW_PPFX_Bloom_INFO='Добавляет Bloom эффект'
export PW_WAYLAND_INFO="Внимание! Вы запускаете ${portname} в сессии Wayland, некоторые функции могут быть недоступны!\nРекомендуется перезапустить сессию в X11!"
export PW_PFX_BACKUP_INFO="Внимание! Не передавайте резевную копию третьим лицам, есть риск потери аккаунтов" export PW_PFX_BACKUP_INFO="Внимание! Не передавайте резевную копию третьим лицам, есть риск потери аккаунтов"
export PW_PFX_BACKUP_SUCCESS="Резервная копия префикса: \"${PW_PREFIX_NAME}\" успешно создана" export PW_PFX_BACKUP_SUCCESS="Резервная копия префикса: \"${PW_PREFIX_NAME}\" успешно создана"
export PW_PFX_BACKUP_ERROR="Во время создания резервной копии префикса: \"${PW_PREFIX_NAME}\" произошла ошибка" export PW_PFX_BACKUP_ERROR="Во время создания резервной копии префикса: \"${PW_PREFIX_NAME}\" произошла ошибка"
...@@ -476,7 +475,8 @@ elif [[ "${update_loc}" == "ENG" ]] ; then ...@@ -476,7 +475,8 @@ elif [[ "${update_loc}" == "ENG" ]] ; then
export PW_USE_FAKE_DLSS_INFO='Enable DLSS translator in FSR 2 in DirectX 12 games (CyberFSR2)' export PW_USE_FAKE_DLSS_INFO='Enable DLSS translator in FSR 2 in DirectX 12 games (CyberFSR2)'
export PW_USE_EAC_AND_BE_INFO='Enable Easy Anti-Cheat and BattlEye Anti-Cheat runtimes (required if game used this anti-cheats)' export PW_USE_EAC_AND_BE_INFO='Enable Easy Anti-Cheat and BattlEye Anti-Cheat runtimes (required if game used this anti-cheats)'
export PW_REDUCE_PULSE_LATENCY_INFO='Reduce pulseaudio latency to fix intermittent sound' export PW_REDUCE_PULSE_LATENCY_INFO='Reduce pulseaudio latency to fix intermittent sound'
export PW_USE_US_LAYOUT_INFO='Works only x11. Forced use of the us layout (useful for games in which the control works correctly only on the us layout)' export PW_USE_US_LAYOUT_INFO='Forced use of the us layout (useful for games in which the control works correctly only on the us layout)'
export PW_RESTORE_RESOLUTION_INFO='Remember the screen resolution when starting the game and return it when closing (useful for games that change the screen resolution when closing)'
export PW_USE_SYSTEM_VK_LAYERS_INFO='Use system mangohud, vkBasalt, obs-vkcapture and other applications using vulkan layers' export PW_USE_SYSTEM_VK_LAYERS_INFO='Use system mangohud, vkBasalt, obs-vkcapture and other applications using vulkan layers'
export PW_USE_OBS_VKCAPTURE_INFO='Enable the ability to write to OBS Studio using obs-vkcapture (ATTENTION: the forced use of system mangohud, vkBasalt, obs-vkcapture and other applications using vulkan layers will be enabled)' export PW_USE_OBS_VKCAPTURE_INFO='Enable the ability to write to OBS Studio using obs-vkcapture (ATTENTION: the forced use of system mangohud, vkBasalt, obs-vkcapture and other applications using vulkan layers will be enabled)'
export PW_USE_GALLIUM_ZINK_INFO='Use the zink driver (OpenGL on top of Vulkan), allows you to use vkBasalt in OpenGL games (ATTENTION: vulkan support is required, wined3d (opengl) is used instead of dxvk, suitable for games on OpenGL and older versions of DirectX, artifacts are possible on newer versions of DirectX)' export PW_USE_GALLIUM_ZINK_INFO='Use the zink driver (OpenGL on top of Vulkan), allows you to use vkBasalt in OpenGL games (ATTENTION: vulkan support is required, wined3d (opengl) is used instead of dxvk, suitable for games on OpenGL and older versions of DirectX, artifacts are possible on newer versions of DirectX)'
...@@ -536,8 +536,6 @@ elif [[ "${update_loc}" == "ENG" ]] ; then ...@@ -536,8 +536,6 @@ elif [[ "${update_loc}" == "ENG" ]] ; then
export PW_StageDepth_INFO='Allows you to add new elements to the 3d space inside the game and apply custom textures' export PW_StageDepth_INFO='Allows you to add new elements to the 3d space inside the game and apply custom textures'
export PW_PPFX_Bloom_INFO='Adds a Bloom effect' export PW_PPFX_Bloom_INFO='Adds a Bloom effect'
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!"
export PW_PFX_BACKUP_INFO="Attention! Do not pass the resev copy to third parties, there is a risk of losing accounts" export PW_PFX_BACKUP_INFO="Attention! Do not pass the resev copy to third parties, there is a risk of losing accounts"
export PW_PFX_BACKUP_SUCCESS="Prefix backup: \"${PW_PREFIX_NAME}\" has been successfully created" export PW_PFX_BACKUP_SUCCESS="Prefix backup: \"${PW_PREFIX_NAME}\" has been successfully created"
export PW_PFX_BACKUP_ERROR="An error occurred while backing up the prefix: \"${PW_PREFIX_NAME}\" error occurred" export PW_PFX_BACKUP_ERROR="An error occurred while backing up the prefix: \"${PW_PREFIX_NAME}\" error occurred"
......
...@@ -389,11 +389,17 @@ start_portwine () { ...@@ -389,11 +389,17 @@ start_portwine () {
if [[ "${PW_REDUCE_PULSE_LATENCY}" == 1 ]] ; then if [[ "${PW_REDUCE_PULSE_LATENCY}" == 1 ]] ; then
export PULSE_LATENCY_MSEC=60 export PULSE_LATENCY_MSEC=60
# export PIPEWIRE_LATENCY=128/48000
else else
unset PULSE_LATENCY_MSEC unset PULSE_LATENCY_MSEC
fi 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 setxkbmap -model pc101 us -print | xkbcomp - $DISPLAY &>/dev/null
else else
export PW_USE_US_LAYOUT="0" export PW_USE_US_LAYOUT="0"
......
...@@ -23,11 +23,6 @@ fi ...@@ -23,11 +23,6 @@ fi
[[ "$MISSING_DESKTOP_FILE" == 1 ]] && portwine_missing_shortcut [[ "$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 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_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}')" export PW_MAIN_SIZE_H="$(cat ${PORT_WINE_TMP_PATH}/tmp_main_gui_size | awk '{print $2}')"
...@@ -472,6 +467,21 @@ pw_edit_db () { ...@@ -472,6 +467,21 @@ pw_edit_db () {
PW_GUI_DISABLED_CS PW_USE_GAMEMODE PW_USE_D3D_EXTRAS PW_FIX_VIDEO_IN_GAME \ 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_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_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 [[ "${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_DX12_DISABLE PW_USE_D3D_EXTRAS PW_FIX_VIDEO_IN_GAME \
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
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_DX12_DISABLE 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 if [ "$?" == 0 ] ; then
print_info "Restarting PP after update ppdb file..." print_info "Restarting PP after update ppdb file..."
/usr/bin/env bash -c ${pw_full_command_line[*]} & /usr/bin/env bash -c ${pw_full_command_line[*]} &
......
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