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

Environment Variables? #121

Closed
Saroufim opened this issue Nov 4, 2018 · 14 comments
Closed

Environment Variables? #121

Saroufim opened this issue Nov 4, 2018 · 14 comments

Comments

@Saroufim
Copy link

Saroufim commented Nov 4, 2018

I suggest adding a section in the configs for some predefined environment variables. These can be useful for both native and wine-based games. Check a few of them here: https://github.com/lutris/lutris/wiki/Performance-Tweaks

@tkashkin
Copy link
Owner

tkashkin commented Nov 4, 2018

Added as Wine/Proton option for next release.

image

tkashkin added a commit that referenced this issue Nov 5, 2018
Use saved sort parameters on start
Fix some Windows installers failing to install games to drive root by 
installing in subdirectory
Environment variables run option for Wine/Proton (#121)
Focus window on gamepad Home button (#122)
@tkashkin tkashkin closed this as completed Nov 5, 2018
@Saroufim
Copy link
Author

Saroufim commented Nov 9, 2018

Has this been added to the dev branch or the master branch? I'm using 0.12 and I can't find the feature.

@tkashkin
Copy link
Owner

tkashkin commented Nov 9, 2018

@Saroufim yes, it should be available in 0.12. I assume you can't find it due to #132.

@Saroufim
Copy link
Author

Saroufim commented Nov 9, 2018

The fields don't show up with Proton either

@tkashkin
Copy link
Owner

tkashkin commented Nov 9, 2018

Weird. It should appear for both Proton and Wine.

image

image

@Saroufim
Copy link
Author

Saroufim commented Nov 9, 2018

captura de pantalla de 2018-11-09 16-41-10

@tkashkin
Copy link
Owner

tkashkin commented Nov 9, 2018

Options are shown only in run dialog. Open it from context menu.

@HuxyUK
Copy link

HuxyUK commented Oct 2, 2019

Hi,

I use Nvidia PRIME render offloading on a game by game basis. In steam I just need to add the prefix to %command%. In GameHub I can't seem to find a easy way of adding environment variables to the game. I looked at enabling the compatibility options, but it doesn't seem intuitive.

I'd like to apply the environment variable on native games as well as compatibility layer games.

For reference I use the following for OpenGL Games:
__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia

A good solution might be to add an Environment box to the UI, similar to the parameters one?
Properties

Thoughts?

@tkashkin
Copy link
Owner

tkashkin commented Oct 2, 2019

@HuxyUK #297 (comment). Something like this should probably work:

env __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia ${command}

@HuxyUK
Copy link

HuxyUK commented Oct 2, 2019

Thanks the for the quick reply!

Where would I use that command? Can I add it using the UI or do I need to write a compatibility script? Adding it solely to the Executable or Arguments doesn't work, so I guess I'm missing something.. 😕

@tkashkin
Copy link
Owner

tkashkin commented Oct 2, 2019

@HuxyUK you should just add it to the Arguments field.

It hasn't been merged in master branch yet, so you need to be on dev branch for it to work. Check your version in Settings or with com.github.tkashkin.gamehub -v in terminal.

@HuxyUK
Copy link

HuxyUK commented Oct 2, 2019

Ahh right!
I'm on the master branch packaged in Solus at the moment. Explains why I can't get it to work.

Branch:  master
Commit:   ()
Distro:  Solus
DE:      GNOME

@tkashkin
Copy link
Owner

tkashkin commented Oct 2, 2019

@HuxyUK as a workaround for older versions you can try this:

Executable:

/usr/bin/env

Arguments:

__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia /path/to/game/executable

@HuxyUK
Copy link

HuxyUK commented Oct 2, 2019

I tried what you suggested but every time I set /usr/bin/env in the executable field it ends up resetting it back to the game's startup executable. It's very odd behaviour.

Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Use saved sort parameters on start
Fix some Windows installers failing to install games to drive root by 
installing in subdirectory
Environment variables run option for Wine/Proton (tkashkin#121)
Focus window on gamepad Home button (tkashkin#122)


Former-commit-id: 2071a8e
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

No branches or pull requests

3 participants