Skip to content

[Linux/MacOS] Split Enviroment Variable and Wrapper Option #1533

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
merged 27 commits into from
Jul 14, 2022

Conversation

Nocccer
Copy link
Collaborator

@Nocccer Nocccer commented Jun 27, 2022

For better adding of enviroment variables a new component "TwoColTableInput" (Better name requested) was written.

  • This component creates a two column table with key and value

  • Via Textfields a key and value can be added.

  • Via delete button entry can be removed

  • Enviroment Variables and Wrapper are now two seperated options.

@arielj Would be very grateful if you could help me with the component. (Design/Improvments)

image

Launch Command:
Launch Command: MYENV="Hello World" WINEPREFIX=/home/niklas/Games/Heroic/Prefixes/WheelsofAurelia myexe launch --disable-ui /tmp/.mount_HeroicJjlL37/resources/app.asar.unpacked/build/bin/linux/legendary launch Escolar --language de --wine /home/niklas/.config/heroic/tools/wine/Wine-GE-Proton7-16/bin/wine --wine-prefix /home/niklas/Games/Heroic/Prefixes/WheelsofAurelia


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@Nocccer Nocccer requested a review from arielj June 27, 2022 13:51
- wrapper args splitted by semicolon
@Nocccer Nocccer marked this pull request as ready for review June 30, 2022 15:05
@Nocccer Nocccer requested review from arielj and CommandMC July 6, 2022 16:21
@Nocccer Nocccer linked an issue Jul 9, 2022 that may be closed by this pull request
@imLinguin
Copy link
Member

imLinguin commented Jul 10, 2022

I assume Lutris does something like this

import shlex

arguments_array = shlex.split(arguments_string)

It's literally splitting arguments by spaces omitting those inside of quotes.

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 10, 2022

Ok i will use npm shlex then aswell and i will add a warning.
https://www.npmjs.com/package/shlex

@CommandMC
Copy link
Collaborator

CommandMC commented Jul 10, 2022

It does. Wrote a little thing that prints out argv and added that to Lutris:
image
sys.argv=['/home/commandmc/src/ArgList/dist/arglist', '--some-arg', '--path', '/path/with/spac es/', '--another-arg']

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 10, 2022

It does. Wrote a little thing that prints out argv and added that to Lutris: image sys.argv=['/home/commandmc/src/ArgList/dist/arglist', '--some-arg', '--path', '/path/with/spac es/', '--another-arg']

Ok thanks. I will use shlex because it also removes the quotes. This is pretty good library imo.
There is also shlex.quote(). Maybe we can use this instead quoteIfNecessary()

@CommandMC
Copy link
Collaborator

Yup sounds good. Had no idea this library existed to be honest, but it sounds like it's perfect for this

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 10, 2022

@CommandMC ok i rewrote everything like lutris is doing it. Also fixed shlex crashing on undefined strings. Hopefully will be in a future release.
I also fixed launch arguments via shlex.split.
Shlex PR: rgov/node-shlex#22

image

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks good. Haven't tested yet though but should work fine.
Thanks for refactoring that ⚔️

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 11, 2022

Codewise looks good. Haven't tested yet though but should work fine. Thanks for refactoring that crossed_swords

I added a small fix and a button to edit entries. Can you have another look?

@Nocccer Nocccer requested review from flavioislima and arielj July 11, 2022 15:15
@CommandMC
Copy link
Collaborator

With the "Old School Heroic" theme, the table edges are rather hard to make out:
image

Also, the "Variable Name"/"Value"/"Wrapper" text feels a little out of place IMO. Does it really have to be a different font size than all other text on the site? Why not use <h3> like the settings sub-heading does?

@Nocccer
Copy link
Collaborator Author

Nocccer commented Jul 11, 2022

With the "Old School Heroic" theme, the table edges are rather hard to make out: image

Also, the "Variable Name"/"Value"/"Wrapper" text feels a little out of place IMO. Does it really have to be a different font size than all other text on the site? Why not use <h3> like the settings sub-heading does?

Before i mess something up in CSS, maybe @arielj can fix this?

@arielj
Copy link
Collaborator

arielj commented Jul 11, 2022

With the "Old School Heroic" theme, the table edges are rather hard to make out: image
Also, the "Variable Name"/"Value"/"Wrapper" text feels a little out of place IMO. Does it really have to be a different font size than all other text on the site? Why not use <h3> like the settings sub-heading does?

Before i mess something up in CSS, maybe @arielj can fix this?

I'll check!

@arielj
Copy link
Collaborator

arielj commented Jul 12, 2022

I added the fix in this PR since it was pretty simple, but the theme in general had a problem with the inputs having the same background as the background, I changed that so now it has better contrast and it looks better and more like the other themes
image

@Nocccer Nocccer requested a review from CommandMC July 12, 2022 15:32
@Nocccer Nocccer merged commit 15ed4ba into beta Jul 14, 2022
@Nocccer Nocccer deleted the improve-extra-env branch July 14, 2022 12:51
@GenocideStomper
Copy link

How does this wrapper functionality work? Comparing to Lutris, is it supposed to work like the "Pre-launch script" functionality, or "Command prefix"? Or perhaps something completely different?

Basically I want to run kde-inhibit --colorCorrect as long as the game is running, sort of like mangohud or gamemoderun would be if manually executed.
However when I set kde-inhibit --colorCorrect as a wrapper, it executes briefly and exits before the game starts.

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.

Quotation Marks in the Advanced Optons
6 participants