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

RFC: Add option to use gamescope in behalf of clients #54

Closed
wants to merge 2 commits into from

Conversation

R1kaB3rN
Copy link
Member

@R1kaB3rN R1kaB3rN commented Mar 6, 2024

Summary

The launcher is responsible for subreaping in behalf of clients, however, we're not able to fullfill that responsibility if gamescope is used which will cause their users' games to not run when the game had exited improperly (e.g, closing the game window, control+c, etc.). As a result, clients are required to handle killing the zombie wine processes themselves which will require a proper subreaping system in place to do effectively.

However, by giving clients the option to use gamescope via ULWGL, we can ensure all zombie processes are killed for the client via systemd when the user exits their game improperly.

Usage

To use systemd as the subreaper instead of Reaper, clients must set ULWGL_SYSTEMD=1. Example:

ULWGL_SYSTEMD=1 WINEPREFIX=... PROTONPATH=... GAMEID=... ulwgl-run ...

To use gamescope, set ULWGL_GAMESCOPE=1 and optionally write the gamescope options to ~/.local/share/ULWGL/state/ulwgl-$ULWGL_ID.json for the launcher to read. Example:

 [
  {
    "name": "gamescope",
    "options": ["-F", "fsr"]
  }
]

After optionally defining the gamescope options, run:

WINEPREFIX=... PROTONPATH=... GAMEID=... ULWGL_GAMESCOPE=1 ulwgl-run ...

Complete usage

Systemd is required to ensure all lingering processes are killed when the game exits improperly when using gamescope. Therefore, to take full advantage of this feature, run:
> WINEPREFIX=... PROTONPATH=... GAMEID=... ULWGL_GAMESCOPE=1 ULWGL_SYSTEMD=1 ulwgl-run ...

Or when using a configuration file:

[ulwgl]
prefix = "/home/foo/WINE/foo"
exe = "/home/foo/Games/foo.exe"
proton = "/home/foo/Proton/GE-Proton9-1"
game_id = "0"
gamescope = true
reaper = false

[plugins.gamescope]
options = ["-F", "fsr"] # Valid gamescope arguments

@R1kaB3rN R1kaB3rN added the enhancement New feature or request label Mar 6, 2024
- The launcher is responsible for subreaping in behalf of clients, however, we're not able to fullfill that responsibility if gamescope is used which will require clients to handle killing the zombie wine processes if the game had exited improperly (e.g., closing the game window). Currently, all GUI launchers that do not implement a sophisticated subreaping system will need to do this. However, by executing gamescope via ULWGL, we can ensure all zombies are killed via systemd when the user exits improperly

- This will be an optional feature for GUI clients by requiring to set ULWGL_GAMESCOPE=1. To pass gamescope options to the launcher, clients must write a JSON file in ~/.local/share/ULWGL/state/<ulwgl-id>.json with the gamescope options. For example:

[
 {
   'name': 'gamescope',
   'options': ['-F', 'fsr']
 }
]
@R1kaB3rN R1kaB3rN marked this pull request as draft March 18, 2024 20:33
@R1kaB3rN R1kaB3rN changed the title Add feature to set systemd as subreaper RFC: Add option to use gamescope in behalf of clients Mar 18, 2024
@R1kaB3rN R1kaB3rN closed this Mar 26, 2024
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

Successfully merging this pull request may close these issues.

1 participant