Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass External Programs to Custom Command #732

Merged
merged 14 commits into from Feb 2, 2023

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Feb 2, 2023

Fixes #639.

When using a custom command with SteamTinkerLaunch, external programs/tools such as GameScope, MangoHud and GameMode are not passed. This PR implements the ability to pass these arguments to custom programs. For example it will now allow you to use Feral GameMode or GameScope with a custom game launcher (e.g. RuneLite for OldSchool RuneScape).

There are currently a handful of outstanding tasks:

  • Implement some more notifiers, mainly for native games
  • Pass external programs to custom programs running with regular Wine as well as Proton
  • Implement checkbox to enable/disable this feature
  • Look into refactoring parts of launchSteamGame to use a shared function to generate the launch command, if possible (some of the code in buildCustomCmdLaunch is duplicated)
  • Update langfiles

Still won't properly pass commands as it does not append the values in FINALOUTCMD yet.
Also probably won't work for native custom commands.
…MCMD

When we enable ONLY_CUSTOMCMD, now GameScope, GameMode and MangoHUD will be enabled.
Still need to verify that we do not incorrectly do this on Steam Deck, just to be safe.
Also still does not apply to native games.
Finally, GameScope does not seem to pass its arguments yet, just the path to GameScope e.g. /usr/bin/gamescope
Still does not apply to native games, but good initial progress for now.
Other langfiles need updated.
Still does not apply to native game launches.
Probably not all external programs are passed but maybe all that we need to are passed (e.g., is boxtron really required/relevant?)
Finally, custom external program args like GameScope are not passed to Wine launches as extWineRun will need refactored for this.
For now it seems like only GameMode is being parsed and passed correctly to native games, but it's a start.
The code for buildCustomCmdLaunch was taken from the first several lines of launchSteamGame, with the launch command array being the only real change.
It should be possible to re-use this function instead of having duplicated code.
@sonic2kk
Copy link
Owner Author

sonic2kk commented Feb 2, 2023

launchSteamGame ignores things like GameScope etc if Wine is used, so we will also skip it for custom commands. Probably this is a very niche use-case and we can look into it further if someone reports it as an issue.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Feb 2, 2023

Seems like we are able to re-use the buildCustomCmdLaunch function in launchSteamGame. I tested with GameScope, MangoHud and GameMode and it seemed to work!

This PR seems about ready. I will do some more testing and merge soon hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executable Arguments Are Not Passed to Custom Commands
1 participant