Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-desktop-ui
T
Kurt Himebauch eabcfc7b74 chore: consistent code branding (#2800)
* chore: consistent code branding

* fix: carry legacy overrides, queues and live sync rows across the rename

* fix: keep queued legacy overrides on a failed rename and separate merged queue entries
2026-11-17 23:31:26 -05:00

32 lines
1.0 KiB
Python
Executable File

#!/usr/bin/python3
import os
from pathlib import Path
import runpy
import time
def select_desktop(evaluate, timeout=90):
deadline = time.monotonic() + timeout
while time.monotonic() < deadline:
try:
result = evaluate("typeof SteamClient !== 'undefined' && "
"typeof SteamClient.UI.ExitBigPictureMode === 'function' && "
"(SteamClient.UI.ExitBigPictureMode(), true)")
if result.get('value') is True:
return True
except Exception:
pass
time.sleep(1)
return False
if __name__ == '__main__':
base = os.environ.get('DD_LAUNCH_DIR')
if not base:
raise SystemExit('DD_LAUNCH_DIR is not set')
agent = runpy.run_path('/usr/local/bin/droiddeck-agent')
selected = select_desktop(lambda expression: agent['cdp_eval'](
Path(base) / 'agent', expression, timeout=2))
print('== steam: desktop UI selected' if selected else
'== steam: desktop UI was not ready within 90 seconds', flush=True)