DeaD_EyE icon

Steam: show state of fossilize_replay (tested on Linux)

DeaD_EyE | PRO | 05/04/24 12:35:47 PM UTC | 0 ⭐ | 1321 👁️ | Never ⏰ | []
Python |

880 B

|

None

|

0 👍

/

0 👎

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)
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎