mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 06:32:53 +01:00
fix: detect running Flatpak Steam correctly
Request only application IDs from flatpak ps so running Steam instances match correctly. Fix client selection validation and cover detection with regression tests. Refs aclist/dztui#478.
This commit is contained in:
1 parent
01be1247b4
commit
f748b09ba7
2 files changed
+61
-2
No files matched your search
+4
-2
@@ -20,7 +20,7 @@ def is_steam_running(cmd: str) -> bool:
|
||||
if has_cmd(STEAM_CMD) is False:
|
||||
return False
|
||||
return is_running(STEAM_CMD)
|
||||
elif cmd == FLATPAK_RUN_CMD or FLATPAK_SANDBOX:
|
||||
elif cmd in (FLATPAK_RUN_CMD, FLATPAK_SANDBOX):
|
||||
return is_flatpak_steam_running()
|
||||
else:
|
||||
raise TypeError("Not a valid Steam client selection")
|
||||
@@ -31,7 +31,9 @@ def is_steam_running(cmd: str) -> bool:
|
||||
def is_flatpak_steam_running() -> bool:
|
||||
if has_cmd(FLATPAK_CMD) is False:
|
||||
return False
|
||||
proc = subprocess.check_output([FLATPAK_CMD, "ps"], text=True)
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
if FLATPAK_APPID in lines:
|
||||
return True
|
||||
|
||||
Reference in new issue
Block a user