Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main Menu: Add button to install Steam Linux Runtime #870

Merged
merged 6 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lang/chinese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1197,3 +1197,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/dutch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1197,3 +1197,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/englishUK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/french.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/german.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1198,3 +1198,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/italian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/polish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
7 changes: 7 additions & 0 deletions lang/russian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,10 @@ GUI_YADFORCEXWAYLAND="Force XWayland (requires restart)"
DESC_YADFORCEXWAYLAND="run Yad with XWayland with GDK_BACKEND=x11, will do nothing outside of a Wayland session - will take effect after restarting SteamTinkerLaunch"
GUI_RESHADEDLLNAME="ReShade DLL name"
DESC_RESHADEDLLNAME="name to give ReShade DLL (default=dxgi) - d3d9=Direct3D 9, d3d11.dll for DX11, dxgi=DX10/11/12, opengl32/64=OpenGL, or custom name. You can comma-separate DLL names for multiple ReShade DLLs. Existing DLLs with this name will get backed up in the game directory"
FBUT_GUISET_GETSLR="Install Steam Linux Runtime"
TT_GETSLR="attempt to tell Steam to install the Steam Linux Runtime required by the current game's selected Proton version, if available"
NOTY_INSTALLSLR_DONE="Continue installing Steam Linux Runtime from Steam"
NOTY_INSTALLSLR_ALREADYEXISTS="Steam Linux Runtime for current Proton version already exists on system"
NOTY_INSTALLSLR_NOREQUIRETOOLAPPID="No require_tool_appid specified in tool_manifest for given Proton version, check logs for more information"
NOTY_INSTALLSLR_NOTOOLMANIFEST="No tool_manifest.vdf found for given Proton version, check logs for more information"
NOTY_INSTALLSLR_INVALIDGAME="Could not find Proton version for selected game, unable to install Steam Linux Runtime"
45 changes: 42 additions & 3 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20230827-1"
PROGVERS="v14.0.20230827-2"
PROGCMD="${0##*/}"
SHOSTL="stl"
GHURL="https://github.com"
Expand Down Expand Up @@ -5912,7 +5912,7 @@ function MainMenu {
--field="$FBUT_GUISET_GASCO!$TT_GASCO":FBTN "$(realpath "$0") gs \"$AID\" \"$GN\"" \
--field="$FBUT_GUISET_VORTEX!$TT_VORTEX":FBTN "$(realpath "$0") vortex gui" \
--field="$FBUT_GUISET_MO!$TT_MO":FBTN "$(realpath "$0") mo2 start" \
--field="$FBUT_GUISET_WIKI":FBTN "$(realpath "$0") wiki" \
--field="$FBUT_GUISET_GETSLR!$TT_GETSLR":FBTN "$(realpath "$0") getslrbtn \"$AID\"" \
--field="$GUI_GAFI!$TT_GAFI":FBTN "$(realpath "$0") gf \"$AID\"" \
--button="$BUT_EXIT":0 \
--button="$BUT_GUISET_CATMENUSHORT":4 \
Expand Down Expand Up @@ -19869,21 +19869,33 @@ function setSLRReap {
fi
}

function fetchGameSLRGui {
if [ "$ISGAME" -eq 3 ]; then
commandlineFetchGameSLR "$1" "1" "1" # Native Linux SLR
else
commandlineFetchGameSLR "$1" "0" "1" # Proton SLR
fi
}

## Fetch the AppID required by a game's selected Proton version, and prompt Steam to install it with steam://install/<appid>
##
## Could be extended to a GUI in future, similar to commandlineOneTimeRun and OneTimeRunGui
## Ideally we would use a Main Menu button for it (maybe replace wiki button?)
function commandlineFetchGameSLR {
FUSEID "$1"
USENATIVE="$2" # We could pass this from the UI if we know we have a native game (ISGAME -eq 3)
SLRDISPLAYNOTIFIER="${3:-0}"

if [ "$USENATIVE" -eq 1 ]; then # Get native Linux SLR
# Check if SLR is already installed
EXISTINGSLRPATH="$( getGameDir "$SLRAID" "only" )"
echo "$EXISTINGSLRPATH"
if [ -d "$EXISTINGSLRPATH" ]; then
writelog "INFO" "${FUNCNAME[0]} - Required Steam Linux Runtime ('$SLRAID') is already installed at '$EXISTINGSLRPATH' -- Nothing to do."
echo "Required Steam Linux Runtime ('$SLRAID') is already installed at '$EXISTINGSLRPATH' -- Nothing to do."
if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_ALREADYEXISTS"
fi

return
fi

Expand All @@ -19893,6 +19905,10 @@ function commandlineFetchGameSLR {

eval "$SLRINSTALLCMD"
echo "Continue installation of tool from Steam install dialog."

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_DONE"
fi
elif [ -f "$STLGAMECFG" ] && [ -n "$USEPROTON" ]; then # If this is a game launched before with STL, get the Steam Linux Runtime for it
PROTPATH="$( dirname "$( getProtPathFromCSV "$USEPROTON" )" )"

Expand All @@ -19906,6 +19922,11 @@ function commandlineFetchGameSLR {
if [ -d "$EXISTINGSLRPATH" ]; then
writelog "INFO" "${FUNCNAME[0]} - Required Steam Linux Runtime ('$SLRID') is already installed at '$EXISTINGSLRPATH' -- Nothing to do."
echo "Required Steam Linux Runtime ('$SLRID') is already installed at '$EXISTINGSLRPATH' -- Nothing to do."

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_ALREADYEXISTS"
fi

return
fi

Expand All @@ -19915,17 +19936,33 @@ function commandlineFetchGameSLR {

eval "$SLRINSTALLCMD"
echo "Continue installation of tool from Steam install dialog."

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_DONE"
fi
else # No require_tool_appid set in toolmanifest.vdf
writelog "ERROR" "${FUNCNAME[0]} - require_tool_appid was not defined ('$SLRID') -- Maybe no Steam Linux Runtime is required for this Proton version?"
echo "require_tool_appid was not defined ('$SLRID') -- Maybe no Steam Linux Runtime is required for this Proton version?"

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_NOREQUIRETOOLAPPID"
fi
fi
else # No toolmanifest.vdf set at all
writelog "ERROR" "${FUNCNAME[0]} - Could not find $TOMA for Proton version '$USEPROTON' at path '$PROTPATH'"
echo "Could not find $TOMA for Proton version '$USEPROTON' at path '$PROTPATH'"

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_NOTOOLMANIFEST"
fi
fi
else # Not a valid game used with STL before
writelog "ERROR" "${FUNCNAME[0]} - Could not find STLGAMECFG ('$STLGAMECFG') or USEPROTON ('$USEPROTON') for AppID '$AID'"
echo "Could not find STLGAMECFG ('$STLGAMECFG') or USEPROTON ('$USEPROTON') for AppID '$AID'"

if [ "$SLRDISPLAYNOTIFIER" -eq 1 ]; then
notiShow "$NOTY_INSTALLSLR_INVALIDGAME"
fi
fi
}

Expand Down Expand Up @@ -20973,6 +21010,8 @@ function commandline {
FETCHNATIVESLR=0
fi
commandlineFetchGameSLR "$2" "$FETCHNATIVESLR"
elif [ "$1" == "getslrbtn" ]; then # Internal use only for the Main Menu button
fetchGameSLRGui "$2"
elif [ "$1" == "mo2" ]; then
if [ -n "$2" ]; then
if [ "$2" == "download" ] || [ "$2" == "d" ]; then
Expand Down