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

Edit lauch command #297

Closed
MagicRB opened this issue Aug 20, 2019 · 8 comments
Closed

Edit lauch command #297

MagicRB opened this issue Aug 20, 2019 · 8 comments

Comments

@MagicRB
Copy link

MagicRB commented Aug 20, 2019

I'd like to be able to edit the command GameHub uses to launch my game. So instead of "WINEPREFIX=/whatever wine whatever.exe" i'd like to wrap that whole thing in another command, for example "gamemoderun 'WINEPREFIX=/whatever wine whatever.exe'". If this is already possible, I'm sorry for opening this issue. Thx

@tkashkin
Copy link
Owner

You can use "Custom script" compatibility layer instead of Wine to achieve this.

GameHub will run this script instead of running game.
Builtin Wine integration will not be used in this case and you can do anything you want in script.

GameHub will pass some arguments to this script. Default script template uses these arguments:

#!/bin/bash
GH_EXECUTABLE="$1"
GH_INSTALL_DIR="$2"
GH_GAME_ID="$3"
GH_GAME_ID_FULL="$4"
GH_GAME_NAME="$5"
GH_GAME_NAME_ESCAPED="$6"

If you want to use it for multiple games, you can create a "Custom emulator" that will use script itself.

@MagicRB
Copy link
Author

MagicRB commented Aug 20, 2019

Thx! Tho i have another issue related, the window won't open, i click "Edit Script" and nothing happens. I'm using KDE if that makes a difference. And I'm on Arch

@tkashkin
Copy link
Owner

It should be opened in default text editor, but it's possible that it tries to run script instead of editing it.
You can manually edit _gamehub/customscript.sh in game's install directory.

@MagicRB
Copy link
Author

MagicRB commented Aug 20, 2019

That works, but it kind of beats the point of a game launcher. It would be much better if you GameHub provided me with a way to edit the launch command like steam does

@tkashkin
Copy link
Owner

Yes, it can be improved. I'll think how can it be implemented.

@MagicRB
Copy link
Author

MagicRB commented Aug 20, 2019

Thx. I'll close this now

@MagicRB MagicRB closed this as completed Aug 20, 2019
tkashkin added a commit that referenced this issue Aug 21, 2019
Improved GOG API error handling
Small UI tweaks
@tkashkin tkashkin reopened this Aug 21, 2019
@tkashkin
Copy link
Owner

@MagicRB since 075168a you can edit game's arguments and override launch command like possible in Steam.

By default game args will be appended at the end of default launch command.
If args contain ${command} or $command variable, it will be replaced with default command.

It should work for most compatibility layers if I haven't missed something. Let me know if something is wrong.

hagabaka pushed a commit to hagabaka/GameHub that referenced this issue Aug 23, 2019
Improved GOG API error handling
Small UI tweaks
Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Improved GOG API error handling
Small UI tweaks


Former-commit-id: 075168a
Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Improved GOG API error handling
Small UI tweaks


Former-commit-id: 6d7e801
@RilicTheFox
Copy link

RilicTheFox commented Mar 20, 2022

How can run you separate commands after using $command? I've tried $command; separate-command-here but it isn't working.
@tkashkin

EDIT: I'm basically trying to run a command that copies my save files after the game closes. Is there a way of easily doing that within GameHub?

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

No branches or pull requests

3 participants