2.6.3
Scripts that run before and after your games, Epic games that Steam tracks until you quit, and fixes for local artwork, Non-SRM Shortcuts icons and title variables.
Script wrapper
Parsers have a new section, Script Wrapper Configuration. Turn on Wrap shortcut in a shell script and you can choose up to three scripts to run with each game:
- Pre-launch: runs before the game starts.
- Post-launch: runs once the game has started.
- Post-exit: runs after you quit the game.
Each script can have a delay in seconds (0 by default). On Windows the scripts are PowerShell scripts; on Linux and macOS they are shell scripts. They can use the environment variables SRM_GAME_TITLE, SRM_STAGE and SRM_RUN_DIR, a folder where a game's scripts can leave files for each other.
Things to know:
- Steam shows the game as running until you quit it, even if the game was started through a launcher.
- A script can't stop your game from launching. If a script is missing or fails, SRM writes that, with the script's output, to
launch-wrappers/launch.login SRM's data folder, and the game starts anyway. - A post-launch script should finish quickly. SRM only starts watching for the game to exit once it has finished, so start long-running tools in the background.
- Turning the wrapper on or off replaces the parser's shortcuts the next time you save to Steam, because the shortcuts' app IDs change.
- On Linux, games from parsers that force a compatibility tool (such as Proton) are not wrapped, because the tool can't run a shell script.
See the new Script Wrapper docs in the parser editor for details.
Epic: wait for the game to exit
The Epic parser has a new Wait for the game to exit option (Windows, when launching through Epic). Steam then shows the game as running until you quit it. SRM also restarts Epic before the game starts, and after you quit it waits for Epic to finish syncing your cloud saves, then closes Epic. Thanks to @hbogaeus for the idea and the original script (#904).
Battle.net
Battle.net games now use the same script wrapper. SRM restarts Battle.net, waits until it is ready, then launches the game, as before. Now Steam also shows the game as running until you quit it, and SRM no longer downloads a script for this from GitHub.
Your Battle.net shortcuts will be replaced the next time you save, because their app IDs change. SRM sets their artwork again, but Steam may not carry over things it keeps for each shortcut, such as play time.
Fixes
- The file picker opens in the last folder you used again, for example when adding local artwork. This stopped working in 2.6.0.
- Non-SRM Shortcuts icons show up in Steam. The icon was saved, but Steam didn't use it. Also, removing artwork from a Non-SRM Shortcut no longer deletes the shortcut itself, which could happen with shortcuts you made in Steam.
- Title variables follow the title as it changes.
${fuzzyTitle}used to skip the title from your custom variables when fuzzy matching failed or was off. And a variable for a step that hadn't happened (for example, no custom variable matched) was empty. Each variable now holds the title as it was after its step. If a step changed nothing, it holds the title from the step before.
Docs
- A new diagram shows how a game's title is made, step by step. It appears in the Title Modifier, Title from Custom Variable and Fuzzy Matching docs.
- Corrected the note about
${fuzzyTitle}. - You can now select and copy text in the docs.