Fix another issue with the resolution setting
This commit is contained in:
@@ -65,7 +65,7 @@ if ([ "X${SUNSHINE_CLIENT_WIDTH:-}" != "X" ] && [ "X${SUNSHINE_CLIENT_HEIGHT:-}"
|
||||
echo " - Setting display resolution to ${SUNSHINE_CLIENT_WIDTH:?}x${SUNSHINE_CLIENT_HEIGHT:?} ${SUNSHINE_CLIENT_FPS:?}Hz"
|
||||
|
||||
# Read current display mode and extract resolution and refresh rate from the mode string
|
||||
__xrandr_out="$(xrandr)"
|
||||
__xrandr_out="$(xrandr -q)"
|
||||
__current_current_mode=$(echo "${__xrandr_out:?}" | awk '/\*/ {print $0}')
|
||||
__current_resolution=$(echo ${__current_current_mode:?} | awk '{print $1}')
|
||||
__current_refresh_rate=$(echo ${__current_current_mode:?} | awk '{sub(/\*/, "", $2); print $2}')
|
||||
@@ -92,6 +92,7 @@ if ([ "X${SUNSHINE_CLIENT_WIDTH:-}" != "X" ] && [ "X${SUNSHINE_CLIENT_HEIGHT:-}"
|
||||
echo " - Custom mode '${__client_mode:?}' already exists."
|
||||
fi
|
||||
# Check if custom mode exists
|
||||
__xrandr_out="$(xrandr -q)"
|
||||
if echo "${__xrandr_out:?}" | grep -q "${__client_mode:?}"; then
|
||||
# Check if this mode is already added to the primary display
|
||||
if ! echo "${__xrandr_out:?}" | sed -n "/${__primary_output:?}/,/^[^[:space:]]/ {/^[[:space:]]/p}" | grep -q "${__client_mode:?}"; then
|
||||
|
||||
Reference in New Issue
Block a user