#!/usr/bin/env python3 # Steamify CachyOS: Steam's non-Steam games list (userdata//config/ # shortcuts.vdf, binary VDF), for "Add as non-Steam game". Steam reads it only # at startup and writes it back on exit, so it's edited while Steam is closed. # steam-shortcuts.py find -> appid of an entry for exe # steam-shortcuts.py add # -> "added " / "updated " # steam-shortcuts.py remove # An entry counts as ours when its Exe is , or a Steamify start script # (run-app, also under the pre-2.5.0 path): that one is updated, not doubled. import os import struct import sys import zlib MAP, STR, INT, END = 0, 1, 2, 8 def parse(data): pos = 0 def cstr(): nonlocal pos end = data.index(b"\0", pos) s = data[pos:end].decode("utf-8", "surrogateescape") pos = end + 1 return s def block(): nonlocal pos items = [] while True: t = data[pos] pos += 1 if t == END: return items key = cstr() if t == MAP: items.append((key, block())) elif t == STR: items.append((key, cstr())) elif t == INT: items.append((key, struct.unpack_from("