diff --git a/src/protontricks/cli.py b/src/protontricks/cli.py index fec0563..d158b96 100755 --- a/src/protontricks/cli.py +++ b/src/protontricks/cli.py @@ -14,7 +14,7 @@ import os import logging from . import __version__ -from .steam import (find_proton_app, find_steam_path, find_steam_runtime_path, +from .steam import (find_proton_app, find_steam_path, get_steam_apps, get_steam_lib_paths) from .winetricks import get_winetricks_path from .gui import select_steam_app_with_gui @@ -75,8 +75,7 @@ def main(args=None): "WINE: path to a custom 'wine' executable\n" "WINESERVER: path to a custom 'wineserver' executable\n" "STEAM_RUNTIME: 1 = enable Steam Runtime, 0 = disable Steam " - "Runtime, valid path = custom Steam Runtime path, " - "empty = enable automatically (default)" + "Runtime, empty = enable automatically (default)" ), formatter_class=argparse.RawTextHelpFormatter ) @@ -133,14 +132,10 @@ def main(args=None): sys.exit(-1) # 2. Find Steam Runtime if enabled - steam_runtime_path = None + steam_runtime = False if os.environ.get("STEAM_RUNTIME", "") != "0" and not args.no_runtime: - steam_runtime_path = find_steam_runtime_path(steam_root=steam_root) - - if not steam_runtime_path: - print("Steam Runtime was enabled but couldn't be found!") - sys.exit(-1) + steam_runtime = True else: logger.info("Steam Runtime disabled.") @@ -201,7 +196,7 @@ def main(args=None): winetricks_path=winetricks_path, proton_app=proton_app, steam_app=steam_app, - steam_runtime_path=steam_runtime_path, + steam_runtime=steam_runtime, command=[winetricks_path, "--gui"] ) @@ -269,7 +264,7 @@ def main(args=None): winetricks_path=winetricks_path, proton_app=proton_app, steam_app=steam_app, - steam_runtime_path=steam_runtime_path, + steam_runtime=steam_runtime, command=[winetricks_path] + args.winetricks_command) elif args.command: run_command( @@ -277,7 +272,7 @@ def main(args=None): proton_app=proton_app, steam_app=steam_app, command=args.command, - steam_runtime_path=steam_runtime_path, + steam_runtime=steam_runtime, # Pass the command directly into the shell *without* # escaping it cwd=steam_app.install_path, diff --git a/src/protontricks/steam.py b/src/protontricks/steam.py index fa5772d..4f30cd3 100644 --- a/src/protontricks/steam.py +++ b/src/protontricks/steam.py @@ -11,7 +11,7 @@ from .util import lower_dict __all__ = ( "COMMON_STEAM_DIRS", "SteamApp", "find_steam_path", - "find_steam_proton_app", "find_proton_app", "find_steam_runtime_path", + "find_steam_proton_app", "find_proton_app", "find_appid_proton_prefix", "get_steam_lib_paths", "get_steam_apps", "get_custom_proton_installations" ) @@ -254,37 +254,6 @@ def find_steam_path(): return None, None -def find_steam_runtime_path(steam_root): - """ - Find the Steam Runtime either using the STEAM_RUNTIME env or - steam_root - """ - env_steam_runtime = os.environ.get("STEAM_RUNTIME", "") - - if env_steam_runtime == "0": - # User has disabled Steam Runtime - logger.info("STEAM_RUNTIME is 0. Disabling Steam Runtime.") - return None - elif env_steam_runtime and Path(env_steam_runtime).is_dir(): - # User has a custom Steam Runtime - logger.info( - "Using custom Steam Runtime at %s", env_steam_runtime) - return Path(env_steam_runtime) - elif env_steam_runtime in ["1", ""]: - # User has enabled Steam Runtime or doesn't have STEAM_RUNTIME set; - # default to enabled Steam Runtime in either case - steam_runtime_path = steam_root / "ubuntu12_32" / "steam-runtime" - - logger.info( - "Using default Steam Runtime at %s", str(steam_runtime_path)) - return steam_runtime_path - - logger.error( - "Path in STEAM_RUNTIME doesn't point to a valid Steam Runtime!") - - return None - - APPINFO_STRUCT_HEADER = "<4sL" APPINFO_STRUCT_SECTION = "