-
-
Notifications
You must be signed in to change notification settings - Fork 480
[Feature] Configure scripts to run before and after a game is launched #3565
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CommandMC
reviewed
Feb 14, 2024
CommandMC
requested changes
Feb 22, 2024
Co-authored-by: Mathis Dröge <[email protected]>
CommandMC
approved these changes
Feb 23, 2024
…uncher into before-after-scripts
@flavioislima just pushed a change re-ordering them |
…uncher into before-after-scripts
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #2507. This can be used to change keyboard layout, screen resolution, or trigger any script the user wants to.
This PR adds 2 configuration options for games to set a script that would run before the game is launched, and one that would run after the game closes:
The code will wait for the script to exit before continuing with the launching of the game, so if something should run in the background in parallel to the game it must be handled by the script itself. For example, in bash:
With a file like this, Heroic will process the first and last line and proceed to launch the game. It will also process the second line but it won't wait for it to finish, so make sure the synchronous code exits and doesn't leave Heroic waiting forever.
Note that scripts are run in the context of the install directory of the game (working directory is set to the install_path of the game).
I only tested this on linux, so any feedback is welcomed, specially on windows.
I imagine the must will have to be accessible in the Flatpak's permissions if using Heroic flatpak.
Use the following Checklist if you have changed something on the Backend or Frontend: