diff --git a/ULWGL-Runner/compatibilitytool.vdf b/ULWGL-Runner/compatibilitytool.vdf new file mode 100644 index 0000000..99d8b8e --- /dev/null +++ b/ULWGL-Runner/compatibilitytool.vdf @@ -0,0 +1,13 @@ +"compatibilitytools" +{ + "compat_tools" + { + "ULWGL-Runner" // Internal name of this tool + { + "install_path" "." + "display_name" "ULWGL-Runner" + "from_oslist" "windows" + "to_oslist" "linux" + } + } +} diff --git a/ULWGL-Runner/toolmanifest.vdf b/ULWGL-Runner/toolmanifest.vdf new file mode 100644 index 0000000..088acbf --- /dev/null +++ b/ULWGL-Runner/toolmanifest.vdf @@ -0,0 +1,8 @@ +// Generated file, do not edit +"manifest" +{ + "commandline" "/ulwgl-run %verb%" + "version" "2" + "use_tool_subprocess_reaper" "1" + "compatmanager_layer_name" "ulwgl-runner" +} diff --git a/ULWGL-Runner/ulwgl-run b/ULWGL-Runner/ulwgl-run new file mode 120000 index 0000000..3a2cd7e --- /dev/null +++ b/ULWGL-Runner/ulwgl-run @@ -0,0 +1 @@ +../../../ULWGL/ulwgl-run \ No newline at end of file diff --git a/toolmanifest.vdf b/toolmanifest.vdf deleted file mode 100755 index 6008e29..0000000 --- a/toolmanifest.vdf +++ /dev/null @@ -1,9 +0,0 @@ -// Generated file, do not edit -"manifest" -{ - "commandline" "/ULWGL --verb=%verb% --" - "version" "2" - "use_tool_subprocess_reaper" "1" - "unlisted" "1" - "compatmanager_layer_name" "container-runtime" -} diff --git a/ulwgl_run.py b/ulwgl_run.py index 8610a8f..28d98b9 100755 --- a/ulwgl_run.py +++ b/ulwgl_run.py @@ -13,6 +13,15 @@ from re import match import subprocess from ulwgl_dl_util import get_ulwgl_proton +verbs: Set[str] = { + "waitforexitandrun", + "run", + "runinprefix", + "destroyprefix", + "getcompatpath", + "getnativepath", +} + def parse_args() -> Union[Namespace, Tuple[str, List[str]]]: # noqa: D103 opt_args: Set[str] = {"--help", "-h", "--config"} @@ -43,6 +52,11 @@ example usage: if sys.argv[1:][0] in opt_args: return parser.parse_args(sys.argv[1:]) + if sys.argv[1] in verbs: + if "PROTON_VERB" not in os.environ: + os.environ["PROTON_VERB"] = sys.argv[1] + sys.argv.pop(1) + return sys.argv[1], sys.argv[2:] @@ -135,7 +149,7 @@ def check_env( env["PROTONPATH"] = ( Path("~/.local/share/Steam/compatibilitytools.d/") .expanduser() - .joinpath(os.environ["PROTONPATH"]) + .joinpath(os.environ["PROTONPATH"]).as_posix() ) elif not Path(os.environ["PROTONPATH"]).expanduser().is_dir(): os.environ["PROTONPATH"] = "" @@ -143,7 +157,7 @@ def check_env( else: env["PROTONPATH"] = os.environ["PROTONPATH"] - print(env["PROTONPATH"]) + print(env["PROTONPATH"], file=sys.stderr) # If download fails/doesn't exist in the system, raise an error if not os.environ["PROTONPATH"]: @@ -160,15 +174,6 @@ def set_env( Filesystem paths will be formatted and expanded as POSIX """ - verbs: Set[str] = { - "waitforexitandrun", - "run", - "runinprefix", - "destroyprefix", - "getcompatpath", - "getnativepath", - } - # PROTON_VERB # For invalid Proton verbs, just assign the waitforexitandrun if "PROTON_VERB" in os.environ and os.environ["PROTON_VERB"] in verbs: