Added "PW_RESTORE_RESOLUTION" option, delete Wayland warn

This commit is contained in:
Boria138
2023-12-19 13:57:13 +06:00
parent 0f1da48cd7
commit b81cfb2eb0
4 changed files with 30 additions and 18 deletions

View File

@@ -393,7 +393,12 @@ start_portwine () {
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" ]] && command -v xrandr &>/dev/null && [[ "${XDG_SESSION_TYPE}" != "wayland" ]] ; 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" ]] ; then
setxkbmap -model pc101 us -print | xkbcomp - $DISPLAY &>/dev/null
else
export PW_USE_US_LAYOUT="0"