WIP: feat(builder): Add to Steam on Linux, for the Steam Deck and other PCs with Steam #2547

Draft
hckrman101 wants to merge 1 commit from hckrman101/feat/add-to-steam into main
hckrman101 commented 2026-11-11 22:53:06 +00:00 (Migrated from github.com)

Branch: feat/add-to-steam, head 4fa4f080c8 on main 940eb9ef


Steam Deck players and others who start games from Steam had no simple way to put Hookshot in Steam's library: they had to add it by hand as a non-Steam game, with the right launcher and start folder. This adds an Add to Steam button to the Linux builder, and a command for the same thing.

What changes

  • builder/linux/steam_shortcut.py adds the game folder to every Steam account's shortcuts.vdf as a non-Steam game (its launcher, its icon, Steam's quoting).
    • It refuses while Steam runs: Steam writes its own list over any change when it exits.
    • It keeps the file as it was as shortcuts.vdf.bak.
    • A second add updates its own entry in place (same app id: crc32(Exe + AppName) with the top bit set, so grid art stays attached).
  • An Add to Steam button in the Linux launcher and on the "Your game is ready" page, shown only when a Steam folder is found. From a terminal: python3 -I builder/linux/steam_shortcut.py <game folder> (--steam <folder>, --dry-run).
  • A readme paragraph in the Linux section, and a credit line.

Overlap with #2373: #2373 rewrites builder/linux/hookshot_builder.py into one launcher window. Only the two button hookups here touch that file. Whichever PR lands second moves them (for #2373, into its Menu panel). The module, its command line and its test don't depend on the window.

Credit

The binary KeyValues reader and writer are lethevimlet's tools/bc250/add_steam_shortcut.py from lethevimlet/oot-bc250 (GPL-3.0, commit 98cceccfec), made a module with Steam folder discovery, every account, and the running-Steam check.

Verified

  • tests/test_steam_shortcut.py checks:

    • a new file, and existing entries kept byte for byte;
    • an update in place;
    • the double 0x08 terminator;
    • the app id;
    • the backup;
    • every account;
    • the refusal while Steam runs;
    • a dry run.

    tests/run_all.py on Linux on this branch: 408 passed, 12 skipped. test_appimage_package_retry.py failed once in the full run and passed twice alone; it times an AppImage packaging retry and doesn't touch this change.

  • Against a temporary Steam folder (never the real one) with a built game folder: the entry is added (Exe "<folder>/hookshot", StartDir "<folder>/"), the file ends in 08 08 08, and a second run updates it in place.

Not tested

  • A real Steam client, and a Steam Deck.
  • The buttons themselves, clicked in the builder window. The window was not opened here; the module behind them is tested.
Branch: feat/add-to-steam, head 4fa4f080c876a5d70500e3fbb3d52ac4f3ef9ad4 on main 940eb9ef --- Steam Deck players and others who start games from Steam had no simple way to put Hookshot in Steam's library: they had to add it by hand as a non-Steam game, with the right launcher and start folder. This adds an Add to Steam button to the Linux builder, and a command for the same thing. ### What changes - `builder/linux/steam_shortcut.py` adds the game folder to every Steam account's `shortcuts.vdf` as a non-Steam game (its launcher, its icon, Steam's quoting). - It refuses while Steam runs: Steam writes its own list over any change when it exits. - It keeps the file as it was as `shortcuts.vdf.bak`. - A second add updates its own entry in place (same app id: crc32(Exe + AppName) with the top bit set, so grid art stays attached). - An **Add to Steam** button in the Linux launcher and on the "Your game is ready" page, shown only when a Steam folder is found. From a terminal: `python3 -I builder/linux/steam_shortcut.py <game folder>` (`--steam <folder>`, `--dry-run`). - A readme paragraph in the Linux section, and a credit line. **Overlap with #2373:** #2373 rewrites `builder/linux/hookshot_builder.py` into one launcher window. Only the two button hookups here touch that file. Whichever PR lands second moves them (for #2373, into its Menu panel). The module, its command line and its test don't depend on the window. ### Credit The binary KeyValues reader and writer are lethevimlet's `tools/bc250/add_steam_shortcut.py` from [lethevimlet/oot-bc250](https://github.com/lethevimlet/oot-bc250) (GPL-3.0, commit 98cceccfec), made a module with Steam folder discovery, every account, and the running-Steam check. ### Verified - `tests/test_steam_shortcut.py` checks: - a new file, and existing entries kept byte for byte; - an update in place; - the double 0x08 terminator; - the app id; - the backup; - every account; - the refusal while Steam runs; - a dry run. `tests/run_all.py` on Linux on this branch: 408 passed, 12 skipped. `test_appimage_package_retry.py` failed once in the full run and passed twice alone; it times an AppImage packaging retry and doesn't touch this change. - Against a temporary Steam folder (never the real one) with a built game folder: the entry is added (`Exe "<folder>/hookshot"`, `StartDir "<folder>/"`), the file ends in 08 08 08, and a second run updates it in place. ### Not tested - A real Steam client, and a Steam Deck. - The buttons themselves, clicked in the builder window. The window was not opened here; the module behind them is tested.
Commenting is not possible because the repository is archived.
No description provided.