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

Option to add environment variables to every game #262

Open
Mammad900 opened this issue May 16, 2024 · 5 comments
Open

Option to add environment variables to every game #262

Mammad900 opened this issue May 16, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Mammad900
Copy link

Mammad900 commented May 16, 2024

Is your feature request related to a problem? Please describe.
I need to add some environment variables to be able to launch my games using my dGPU:

env DRI_PRIME=1 __NV_SHOW_GRAPHICS_OSD=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <executable>

Right now I have to add these variables in every game's command, which is cumbersome. The long text also makes the executable field harder to use.

Describe the solution you'd like
An option to set some environment variables in one place that applies to every game would be appreciated.

Describe alternatives you've considered
This can be extended to adding any string to the start of the executables but I'm not sure if there's any use case for that.

Additional context
Add any other context or screenshots about the feature request here.

@Mammad900 Mammad900 added the enhancement New feature or request label May 16, 2024
@Mammad900
Copy link
Author

I have found a better alternative for GPU environment variables:
Adding these lines to the .desktop file will make the user's DE launch cartridges (and by extension any games launched from it) on the discrete graphics, no need to set environment variables in the command.

PrefersNonDefaultGPU=true
X-KDE-RunOnDiscreteGpu=true 

Copied from Steam's .desktop file

@kra-mo
Copy link
Owner

kra-mo commented Dec 5, 2024

Would adding the environment variable to Cartridges itself using something like Flatseal not be enough? I'd rather not overcomplicate the UI.

@kra-mo
Copy link
Owner

kra-mo commented Dec 5, 2024

And I suppose could add the desktop entry key, but I'm not sure if there could be any adverse side effects? If not, I'm all for it.

@Mammad900
Copy link
Author

Mammad900 commented Dec 6, 2024

Would adding the environment variable to Cartridges itself using something like Flatseal not be enough? I'd rather not overcomplicate the UI.

Didn't know/think about this. It's probably a suitable option.

As a side note (should probably be a separate issue) word wrap in the executable field of games would be a godsend. Right now I sometimes have to edit the command in a text editor or terminal and paste it in Cartridges.

And I suppose could add the desktop entry key, but I'm not sure if there could be any adverse side effects? If not, I'm all for it.

I haven't noticed any side effects myself, and I predict it's going to be fine for others too since steam does fine. But other users' mileage may vary.
Maybe you could add it in a beta/experimental release and see if it has any side effects?

@kra-mo
Copy link
Owner

kra-mo commented Dec 6, 2024

As a side note (should probably be a separate issue) word wrap in the executable field of games would be a godsend. Right now I sometimes have to edit the command in a text editor or terminal and paste it in Cartridges.

That's true yeah, I should probably make it more modular or just add the ability to open it in your preferred text editor directly.

 Maybe you could add it in a beta/experimental release and see if it has any side effects?

I don't do those, but it would be nice to collect feedback somewhere.

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

No branches or pull requests

2 participants