Skip to content

Custom Command

Eamonn Rea edited this page Jul 26, 2024 · 8 revisions

(in Game Menu and Game Config)

Overview

Launch custom programs before, after or instead of the game itself. You can run Windows or Linux executables (including AppImages and scripts), even when running as a Compatibility Tool you can still launch native Linux executables which can allow you to use native game launchers for games on Steam that might only have a Windows build.

When enabled you can start custom programs easily with the following per-game config options:

  • USECUSTOMCMD: set to 1 to start the custom command CUSTOMCMD
  • CUSTOMCMD: start this custom command
  • CUSTOMCMD_ARGS: start CUSTOMCMD command with those args
  • ONLY_CUSTOMCMD: set to 1 to only start CUSTOMCMD and not the game command itself
  • FORK_CUSTOMCMD: set to 1 to fork the custom CUSTOMCMD into the background and continue with starting %command%. You can optionally configure how long SteamTinkerLaunch should wait (in seconds) until it starts the main game process, after launching the custom program with the WAITFORCUSTOMCMD optio (Sequence is Custom Command -> Optional Wait Time -> Game Start). This allows you to start a custom command and then have STL wait a certain length of time before it starts the game, in case there are cases where the custom command needs to be started first.
    • NOTE: It has been reported several times that this no longer works on SteamOS. Configuring the WAITFORCUSTOMCMD may help in some cases, but this is inconsistent. This feature continues to work fine on the Linux Desktop as of 12/01/2024.
  • EXTPROGS_CUSTOMCMD: Use tools like GameScope, MangoHud, GameMode, etc with the custom command. This is useful if you are using the custom command option to launch a game combined with "Only custom command", such as using an alternative game launcher, and you want configuration options like MangoHud to apply to that process.
  • CUSTOMCMD_USESLR: set to 1 (default) the Steam Linux Runtime with Custom Commands. This is a container that all games using Proton run in by default to ensure compatibility. On some systems, executables (Custom Commands and otherwise) will not run unless they are run inside of the Steam Linux Runtime. However this may prevent communication across applications, such as Custom Commands that want to talk to a game (could not reproduce in testing but it is known to happen). For Native Linux Custom Commands, the Steam Linux Runtime 1.0 will be used. Although Steam does not use the Steam Linux Runtime for native applications by default on the Linux Desktop, SteamTinkerLaunch will do this if it is available. Only disable this if you run into compatibility issues!
    • NOTE: Just like when using the Steam Linux Runtime anywhere else in SteamTinkerLaunch, it requires the prerequisite Steam Linux Runtime to be installed for that Proton version from Steam already. Make sure you have installed the Steam Linux Runtime for the selected Proton version. This can be done from the Main Menu button, or by downloading Steam Linux Runtime 1.0, 2.0, and 3.0 from the Steam Client.
  • CUSTOMCMDFORCEWIN: set to 1 to force the program to run with Wine/Proton and ignore SteamTinkerLaunch's platform detection INJECT_CUSTOMCMD overrides both ONLY_CUSTOMCMD and FORK_CUSTOMCMD.
  • INJECT_CUSTOMCMD: set to 1 start the custom CUSTOMCMD after the game exe has started (optionally starting another INJECTWAIT seconds)
    • NOTE: It has been reported several times that this no longer works on SteamOS. Configuring the INJECTWAIT may help in some cases, but this is inconsistent. This feature continues to work fine on the Linux Desktop as of 12/01/2024.
    • For injecting dlls into a game exe the IGCSInjector function can be used instead of INJECT_CUSTOMCMD

Custom Command Options

If only USECUSTOMCMD is enabled, but CUSTOMCMD is empty, a requester will open where a executable file can be selected. The selected file will then be automatically written into the Game Config.

If string CUSTOMCMD can't be found as file in either PATH, in game dir or as absolute filepath the requester will open as well

Note: See also the One Time Run option for quickly starting a custom executable inside the games Wineprefix once, or Custom User Start/Stop scripts to start custom scripts when game starts/ends.

Disclaimer

Although SteamTinkerLaunch lets you execute custom commands it does not guarantee compatibility. It simply launches the selected executable alongside or instead of the one Steam would normally use, and does not do any extra configuration to guarantee it will run correctly. If any manual configuration is needed to get a game to work outside of SteamTinkerLaunch, it will also be needed to ensure the program works with SteamTinkerLaunch.

And of course, if your program does not work with Linux normally, it will more than likely not work with SteamTinkerLaunch as well. Please do not open issues asking for support with third-party programs unless they only do not work when launched from SteamTinkerLaunch - That is, they work outside of SteamTinkerLaunch with the same Wine/Proton version, the same tweaks if necessary, and the same Wineprefix.

On SteamOS, custom commands may be fickle or break. It appears Valve are doing some strict process management with what processes get launched in game prefixes on SteamOS, which is not present on the Linux Desktop. Several people already have reported that trying to use a custom command and a game together does not work with some games or at all (#1010). SteamTinkerLaunch cannot do much about this as it appears to be isolated to SteamOS.

Clone this wiki locally