Commit d15da2ac authored by Mikhail Tergoev's avatar Mikhail Tergoev

added gamescope settings

parent 917961ca
......@@ -2908,15 +2908,6 @@ pw_gui_for_edit_db () {
PW_USE_SYSTEM_VK_LAYERS_INFO=$(eval_gettext 'Use system mangohud, vkBasalt, obs-vkcapture and other applications using vulkan layers')
PW_USE_OBS_VKCAPTURE_INFO=$(eval_gettext '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)')
PW_DISABLE_COMPOSITING_INFO=$(eval_gettext 'Disable desktop compositing (effects). It often improves performance.')
PW_USE_GAMESCOPE_INFO=$(eval_gettext '<b>Super + F :</b> Toggle fullscreen
<b>Super + N :</b> Toggle nearest neighbour filtering
<b>Super + U :</b> Toggle FSR upscaling
<b>Super + Y :</b> Toggle NIS upscaling
<b>Super + I :</b> Increase FSR sharpness by 1
<b>Super + O :</b> Decrease FSR sharpness by 1
<b>Super + S :</b> Take screenshot (currently goes to /tmp/gamescope_DATE.png)
<b>Super + G :</b> Toggle keyboard grab
<b>Super + C :</b> Update clipboard')
edit_db_field_add $@
old_IFS=$IFS
......@@ -2949,17 +2940,6 @@ A brief instruction:
--field=":LBL" "" \
--field="$(eval_gettext "Limit the use of processor cores")!$(eval_gettext "Limiting the number of CPU cores is useful for Unity games (It is recommended to set the value equal to 8)") :CB" "${CPU_LIMIT_VAR}!disabled!${GET_LOGICAL_CORE}" \
--field="$(eval_gettext "Choose a graphics card to run the game (in user.conf)")!$(eval_gettext "Select which video card will be used to run the game (used for all running games and programs in PortProton)") :CB" "${GPU_VAR}!disabled!${GET_GPU_NAMES}" \
--field="$(eval_gettext "Add arguments for GAMESCOPE:")!$(eval_gettext "
<b>-W, -H:</b> set the resolution used by gamescope. Resizing the gamescope window will update these settings. Ignored in embedded mode. If -H is specified but -W isn't, a 16:9 aspect ratio is assumed. Defaults to 1280×720.
<b>-w, -h:</b> set the resolution used by the game. If -h is specified but -w isn't, a 16:9 aspect ratio is assumed. Defaults to the values specified in -W and -H.
<b>-r:</b> set a frame-rate limit for the game. Specified in frames per second. Defaults to unlimited.
<b>-o:</b> set a frame-rate limit for the game when unfocused. Specified in frames per second. Defaults to unlimited.
<b>-F fsr:</b> use AMD FidelityFX™ Super Resolution 1.0 for upscaling.
<b>-F nis:</b> use NVIDIA Image Scaling v1.0.3 for upscaling.
<b>-S integer:</b> use integer scaling.
<b>-S stretch:</b> use stretch scaling, the game will fill the window. (e.g. 4:3 to 16:9).
<b>-b:</b> create a border-less window.
<b>-f:</b> create a full-screen window.") :CBE" "\\${GAMESCOPE_ARGS}!-r 60 -F fsr!" \
--field="$(eval_gettext "Forcibly select the OpenGL version for the game")!$(eval_gettext "You can select the required OpenGL version, some games require a forced Compatibility Profile (COMPAT). (Examples are in the drop-down list)") :CB" "${PW_MESA_GL_VERSION_OVERRIDE}!disabled!4.6COMPAT!4.6!4.5COMPAT!4.5!3.3COMPAT!3.3" \
--field="$(eval_gettext "Forcibly select the VKD3D feature level")!$(eval_gettext "You can set a forced feature level VKD3D for games on DirectX12") :CB" "${PW_VKD3D_FEATURE_LEVEL}!disabled!12_2!12_1!12_0!11_1!11_0" \
--field="$(eval_gettext "Force certain locale for an app:")!$(eval_gettext "Fixes encoding issues in legacy software") :CB" "${PW_LOCALE_SELECT}!disabled!$LOCALE_LIST" \
......@@ -2967,7 +2947,7 @@ A brief instruction:
"${pw_yad}" --notebook --key="$KEY_EDIT_DB_GUI" --title "$(eval_gettext "EDIT DB")" --text-align=center --height="600" \
--text "$(eval_gettext "Change settings in database file for") <b>${PORTWINE_DB}</b>\n $(eval_gettext "<b>NOTE:</b> To display help for each item, simply hover your mouse over the text")" \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --separator=" " --expand --center \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --separator=" " --expand \
--tab="$(eval_gettext "MAIN")"!"$PW_GUI_ICON_PATH/$TAB_SIZE.png"!"" \
--tab="$(eval_gettext "ADVANCED")"!"$PW_GUI_ICON_PATH/$TAB_SIZE.png"!"" \
--button="$(eval_gettext "CANCEL THE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Cancel the current changes and return to the previous menu")":1 \
......@@ -2997,11 +2977,9 @@ A brief instruction:
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}')"
GAMESCOPE_ARGS="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}')"
PW_MESA_GL_VERSION_OVERRIDE="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}')"
PW_VKD3D_FEATURE_LEVEL="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $11}')"
PW_LOCALE_SELECT="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $12}')"
# PW_AMD_VULKAN_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}'`"
PW_MESA_GL_VERSION_OVERRIDE="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}')"
PW_VKD3D_FEATURE_LEVEL="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}')"
PW_LOCALE_SELECT="$(cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $11}')"
if [[ "${CPU_LIMIT}" != "disabled" ]] ; then
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
......@@ -3038,6 +3016,74 @@ A brief instruction:
esac
}
# GUI GAMESCOPE
gui_gamescope () {
unset ADD_CHK_BOX_GAMESCOPE
PW_USE_GAMESCOPE_INFO=$(eval_gettext '<b>Super + F :</b> Toggle fullscreen
<b>Super + N :</b> Toggle nearest neighbour filtering
<b>Super + U :</b> Toggle FSR upscaling
<b>Super + Y :</b> Toggle NIS upscaling
<b>Super + I :</b> Increase FSR sharpness by 1
<b>Super + O :</b> Decrease FSR sharpness by 1
<b>Super + S :</b> Take screenshot (currently goes to /tmp/gamescope_DATE.png)
<b>Super + G :</b> Toggle keyboard grab
<b>Super + C :</b> Update clipboard')
old_IFS=$IFS
IFS="%"
"${pw_yad}" --plug=$KEY_GAMESCOP_GUI --form --separator=" " --columns=3 ${ADD_CHK_BOX_GAMESCOPE} \
1> "${PORT_WINE_TMP_PATH}/tmp_output_yad_edit_db" 2>/dev/null &
IFS=$old_IFS
output_yad_gamescope="$("${pw_yad}" --title "GAMESCOPE" --text-align=center --height="300" \
--text "$(eval_gettext "Change settings gamescope for") <b>${PORTWINE_DB}</b>\n $(eval_gettext "<b>NOTE:</b> To display help for each item, simply hover your mouse over the text")" \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --separator=" " --expand --form \
--field="$(eval_gettext "Add arguments for GAMESCOPE:")!$(eval_gettext "
<b>-W, -H:</b> set the resolution used by gamescope. Resizing the gamescope window will update these settings. Ignored in embedded mode. If -H is specified but -W isn't, a 16:9 aspect ratio is assumed. Defaults to 1280×720.
<b>-w, -h:</b> set the resolution used by the game. If -h is specified but -w isn't, a 16:9 aspect ratio is assumed. Defaults to the values specified in -W and -H.
<b>-r:</b> set a frame-rate limit for the game. Specified in frames per second. Defaults to unlimited.
<b>-o:</b> set a frame-rate limit for the game when unfocused. Specified in frames per second. Defaults to unlimited.
<b>-F fsr:</b> use AMD FidelityFX™ Super Resolution 1.0 for upscaling.
<b>-F nis:</b> use NVIDIA Image Scaling v1.0.3 for upscaling.
<b>-S integer:</b> use integer scaling.
<b>-S stretch:</b> use stretch scaling, the game will fill the window. (e.g. 4:3 to 16:9).
<b>-b:</b> create a border-less window.
<b>-f:</b> create a full-screen window.") :CBE" "\\${GAMESCOPE_ARGS}!-r 60 -F fsr!" \
--button="$(eval_gettext "CANCEL THE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Cancel the current changes and return to the previous menu")":1 \
--button="$(eval_gettext "DISABLE") GAMESCOPE"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable GameScope and go to the previous menu")":162 \
--button="$(eval_gettext "SAVE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Save the current changes, and go to the previous menu")":166 2>/dev/null)"
YAD_STATUS="$?"
export SKIP_CHECK_UPDATES=1
GAMESCOPE_ARGS="$(echo "$output_yad_gamescope" | awk -F"%" '{print $1}')"
edit_db_from_gui
case "${YAD_STATUS}" in
1|252)
export SKIP_CHECK_UPDATES=1
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
;;
162)
export PW_USE_GAMESCOPE=0
edit_db_from_gui PW_USE_GAMESCOPE
export SKIP_CHECK_UPDATES=1
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
;;
166)
export PW_USE_GAMESCOPE=1
;;
esac
edit_db_from_gui PW_USE_GAMESCOPE GAMESCOPE_ARGS
export SKIP_CHECK_UPDATES=1
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
}
# GUI GET OTHER WINE
gui_proton_downloader () {
unset VERSION_WINE_GIT VERSION_INSTALLED_WINE URL_VERSION_PROTON_GIT GIVE_WINE_URL
......@@ -3342,10 +3388,10 @@ gui_vkBasalt () {
--field="AMD FidelityFX - Contrast Adaptive Sharpening"!"$(eval_gettext "AMD FidelityFX - CAS is designed to dramatically improve texture sharpness without additional modification settings for games, with minimal loss of performance. (For older games it is recommended to set value = 100)")":SCL "${VKBASALT_FFX_CAS_GUI}" \
1> "${PORT_WINE_TMP_PATH}/tmp_yad_cas_set" 2>/dev/null &
"${pw_yad}" --paned --key="$KEY_FX_GUI" --height="600" --title="vkBasalt" --center \
"${pw_yad}" --paned --key="$KEY_FX_GUI" --height="600" --title="vkBasalt" \
--separator=" " --window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
--button="$(eval_gettext "CANCEL THE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Cancel the current changes and return to the previous menu")":1 \
--button="$(eval_gettext "DISABLE VKBASALT")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable vkBasalt and go to the previous menu")":180 \
--button="$(eval_gettext "DISABLE") VKBASALT"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable vkBasalt and go to the previous menu")":180 \
--button="$(eval_gettext "SAVE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Save the current changes, and go to the previous menu")":182 2>/dev/null
YAD_VKBASALT_STATUS="$?"
case "${YAD_VKBASALT_STATUS}" in
......@@ -3500,10 +3546,10 @@ gui_MangoHud () {
${ADD_GUI_MH_FPS} 1> "${PORT_WINE_TMP_PATH}/tmp_yad_mh_fps_limit" 2>/dev/null &
IFS=$old_IFS
"${pw_yad}" --paned --key="$KEY_MH_GUI" --height="650" --title="MangoHud" --center \
"${pw_yad}" --paned --key="$KEY_MH_GUI" --height="650" --title="MangoHud" \
--separator=" " --window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
--button="$(eval_gettext "CANCEL THE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Cancel the current changes and return to the previous menu")":1 \
--button="$(eval_gettext "DISABLE MANGOHUD")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable MangoHud and go to the previous menu")":182 \
--button="$(eval_gettext "DISABLE") MANGOHUD"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable MangoHud and go to the previous menu")":182 \
--button="$(eval_gettext "PREVIEW CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Start vkcube for preview changes")":184 \
--button="$(eval_gettext "SAVE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Save the current changes, and go to the previous menu")":186 2>/dev/null
YAD_MANGOHUD_STATUS="$?"
......@@ -3637,10 +3683,10 @@ gui_dgVoodoo2 () {
--field="${CHKBOX_SPACE}FILTERING!$(eval_gettext "Forced anisotropic filtering in Direct3D games") :CB" "${PW_DGV2_FILTERING}!disabled!2!4!8!16" \
--field="${CHKBOX_SPACE}ANTIALIASING!$(eval_gettext "Forced antialiasing in Direct3D and Glide games") :CB" "${PW_DGV2_ANTIALIASING}!disabled!2!4!8" \
1> "${PORT_WINE_TMP_PATH}/tmp_yad_dgv2_set_cb" 2>/dev/null &
"${pw_yad}" --paned --key=$KEY_DGV2_GUI --height="350" --title="dgVoodoo2" --center \
"${pw_yad}" --paned --key=$KEY_DGV2_GUI --height="350" --title="dgVoodoo2" \
--separator=" " --window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
--button="$(eval_gettext "CANCEL THE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Cancel the current changes and return to the previous menu")":1 \
--button="$(eval_gettext "DISABLE DGVOODOO2")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable dgVoodoo2 and go to the previous menu")":162 \
--button="$(eval_gettext "DISABLE") DGVOODOO2"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Disable dgVoodoo2 and go to the previous menu")":162 \
--button="$(eval_gettext "SAVE CHANGES")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Save the current changes, and go to the previous menu")":166 \
2>/dev/null
YAD_DGV2_STATUS="$?"
......
......@@ -358,9 +358,9 @@ for DAIG in ./* ; do
done
popd 1>/dev/null || fatal
[[ "${PW_DGVOODOO2}" == "1" ]] && DGV2_TXT='<b>dgVoodoo2 </b>' || unset DGV2_TXT
[[ "${PW_VKBASALT}" == "1" ]] && VKBASALT_TXT='<b>vkBasalt </b>' || unset VKBASALT_TXT
[[ "${PW_MANGOHUD}" == "1" ]] && MANGOHUD_TXT='<b>MangoHud </b>' || unset MANGOHUD_TXT
# [[ "${PW_DGVOODOO2}" == "1" ]] && DGV2_TXT='<b>dgVoodoo2 </b>' || unset DGV2_TXT
# [[ "${PW_VKBASALT}" == "1" ]] && VKBASALT_TXT='<b>vkBasalt </b>' || unset VKBASALT_TXT
# [[ "${PW_MANGOHUD}" == "1" ]] && MANGOHUD_TXT='<b>MangoHud </b>' || unset MANGOHUD_TXT
SORT_OPENGL="$(eval_gettext 'WineD3D OpenGL (For video cards without Vulkan)')"
SORT_VULKAN="$(eval_gettext 'WineD3D Vulkan (Damavand experimental)')"
......@@ -439,6 +439,7 @@ if [[ -f "${portwine_exe}" ]] ; then
--field=" vkBasalt"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Enable vkBasalt by default to improve graphics in games running on Vulkan. (The HOME hotkey disables vkbasalt)")":"FBTN" '@bash -c "button_click_start 120"' \
--field=" MangoHud"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Enable Mangohud by default (R_SHIFT + F12 keyboard shortcuts disable Mangohud)")":"FBTN" '@bash -c "button_click_start 122"' \
--field=" dgVoodoo2"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Enable dgVoodoo2 by default (This wrapper fixes many compatibility and rendering issues when running old games)")":"FBTN" '@bash -c "button_click_start 124"' \
--field=" GameScope"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Enable GameScope by default (Wayland micro compositor)")":"FBTN" '@bash -c "button_click_start 126"' \
2>/dev/null &
if [[ -f "${PORT_WINE_TMP_PATH}/tmp_yad_form_tab" ]] \
......@@ -450,7 +451,7 @@ if [[ -f "${portwine_exe}" ]] ; then
export TAB_START=1
fi
"${pw_yad}" --key=$KEY_START --notebook --center --active-tab=$TAB_START \
"${pw_yad}" --key=$KEY_START --notebook --active-tab=$TAB_START \
--width="${PW_MAIN_START_SIZE_W}" --tab-pos="${PW_TAB_POSITON}" \
--title "PortProton-${install_ver} (${scripts_install_ver})" --expand --buttons-layout=expand \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
......@@ -483,7 +484,7 @@ if [[ -f "${portwine_exe}" ]] ; then
--field=" dgVoodoo2"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"$(eval_gettext "Enable dgVoodoo2 by default (This wrapper fixes many compatibility and rendering issues when running old games)")":"FBTN" '@bash -c "button_click_start 124"' \
2>/dev/null &
"${pw_yad}" --key=$KEY_START --paned --center \
"${pw_yad}" --key=$KEY_START --paned \
--width="${PW_MAIN_START_SIZE_W}" --height="${PW_MAIN_START_SIZE_H}" --tab-pos="${PW_TAB_POSITON}" \
--title "PortProton-${install_ver} (${scripts_install_ver})" --buttons-layout=expand \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
......@@ -716,6 +717,7 @@ fi
120) gui_vkBasalt ;;
122) gui_MangoHud ;;
124) gui_dgVoodoo2 ;;
126) gui_gamescope ;;
pw_create_prefix_backup) pw_create_prefix_backup ;;
gui_credits) gui_credits ;;
pw_start_cont_xterm) pw_start_cont_xterm ;;
......
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