Allow using fuse-overlayfs instead of mount

This commit is contained in:
2023-12-03 19:30:57 +01:00
parent 64065ed12e
commit 76d9feb07a
4 changed files with 78 additions and 21 deletions

View File

@@ -115,11 +115,21 @@ class ProtonGame(Game, abc.ABC):
with open(proc_path, "r") as f:
cmdline = f.read()
# Workaround for Baldur's Gate 3, which launches "../bin/bg3_dx11.exe", when launched from
# the Larion Launcher.
if cmdline.startswith(".."):
cmdline = os.path.join(
os.readlink(proc / dir / "cwd"), cmdline
).replace("\\", "/")
# Workaround for games like Baldur's Gate 3 that have a relative path in the cmdline.
# Note that the cmdline contains null bytes that we have to remove.
abs_cmdline = os.path.abspath(cmdline).replace("\x00", "")
if cmdline.startswith(wine_exe_path) or abs_cmdline == str(
self.game_executable
if (
cmdline.startswith(wine_exe_path)
or abs_cmdline == str(self.game_executable)
or abs_cmdline.startswith(str(self.game_executable))
):
self._pid = dir
break