Merge pull request #25 from loathingKernel/insteam

Add files required for compatibility with Steam
This commit is contained in:
Thomas Crider 2024-02-20 10:43:30 -07:00 committed by GitHub
commit 65a9d88d9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 38 additions and 20 deletions

View File

@ -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"
}
}
}

View File

@ -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"
}

1
ULWGL-Runner/ulwgl-run Symbolic link
View File

@ -0,0 +1 @@
../../../ULWGL/ulwgl-run

View File

@ -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"
}

View File

@ -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: