From 33061138f4edfdbf2cfc70292f5fc52e71f7dd6b Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sat, 26 Oct 2024 18:24:33 +0500 Subject: [PATCH] Added screensaver inhibit on Game Running --- data_from_portwine/scripts/functions_helper | 11 ++++++++++- data_from_portwine/scripts/var | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index a6f52a77..f847592b 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -2925,7 +2925,7 @@ start_portwine () { elif [[ "$PW_USE_GAMEMODE" = "1" ]] \ && [[ -n "$DBUS_SESSION_BUS_ADDRESS" ]] then - if command -v systemctl \ + if command -v systemctl &>/dev/null \ && (systemctl is-active --quiet ananicy.service \ || systemctl is-active --quiet ananicy-cpp.service) then @@ -2973,6 +2973,11 @@ start_portwine () { export GAMEMODERUN=0 export PW_GAMEMODERUN_SLR="" fi + + if command -v systemd-inhibit &>/dev/null && [[ "$GAMEMODERUN" != "1" ]] ; then + PW_INHIBIT_SLR='systemd-inhibit --mode=block --who="PortProton" --why="Running"' + print_info "Screensaver will be inhibit" + fi pw_other_fixes # enabled BattleEye_Runtime and EasyAntiCheat_Runtime @@ -3793,6 +3798,7 @@ pw_run () { print_info "Log from RUNTIME and WINE:" ${PW_RUN_GAMESCOPE} \ ${PW_POWERPROFILECTL_SLR} \ + ${PW_INHIBIT_SLR} \ ${pw_runtime} \ LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \ LD_PRELOAD="${PW_LD_PRELOAD}" \ @@ -3811,6 +3817,7 @@ pw_run () { echo "Log WINE:" > "${PW_LOG_TO_FILE}" ${PW_RUN_GAMESCOPE} \ ${PW_POWERPROFILECTL_SLR} \ + ${PW_INHIBIT_SLR} \ ${pw_runtime} \ LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \ LD_PRELOAD="${PW_LD_PRELOAD}" \ @@ -3846,6 +3853,7 @@ pw_run () { ${PW_POWERPROFILECTL_SLR} \ ${PW_MANGOHUD_SLR} \ ${PW_DISPLAY} \ + ${PW_INHIBIT_SLR} \ "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[@]} &>>"${PW_LOG_TO_FILE}" wait_wineserver else @@ -3864,6 +3872,7 @@ pw_run () { ${PW_POWERPROFILECTL_SLR} \ ${PW_MANGOHUD_SLR} \ ${PW_DISPLAY} \ + ${PW_INHIBIT_SLR} \ "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[@]} wait_wineserver fi diff --git a/data_from_portwine/scripts/var b/data_from_portwine/scripts/var index bab93bd7..c1b48c75 100755 --- a/data_from_portwine/scripts/var +++ b/data_from_portwine/scripts/var @@ -15,7 +15,7 @@ export PW_RT_MOUNT_RO=("") export PW_RT_MOUNT_RW=("/media" "/mnt" "/run/media/${USER}" "${PORT_WINE_PATH}") #export PW_SANDBOX_HOME_PATH="${PORT_WINE_PATH}" export PW_NO_ESYNC="0" -export PW_USE_GAMEMODE="1" +export PW_USE_GAMEMODE="0" export PW_FORCE_USE_VSYNC="2" export PW_USE_TERMINAL="0" export PW_WINDOWS_VER="10"