import time from functools import cache from pathlib import Path import requests from psutil import process_iter @cache def appids(): return { app["appid"]: app["name"] for app in requests.get( "https://api.steampowered.com/ISteamApps/GetAppList/v2/" ).json()["applist"]["apps"] } def appids_shadercache(): for process in process_iter(): if process.name() != "fossilize_replay": continue cmd = Path(process.cmdline()[1]) idx = cmd.parts.index("shadercache") yield int(cmd.parts[idx + 1]) def names_shadercache(): return [appids().get(appid, "Unknown") for appid in appids_shadercache()] if __name__ == "__main__": while True: print("\033c", end="") print("\n".join(sorted(set(names_shadercache())) or ["Idle"])) time.sleep(5)