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

Adds compatibility with steam flatpak. #1064

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

PedroVH
Copy link

@PedroVH PedroVH commented Aug 19, 2023

No description provided.

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2023

CLA assistant check
All committers have signed the CLA.

@@ -68,8 +69,10 @@ export default class SteamGameRunner_Linux extends GameRunnerProvider {

LoggerProvider.instance.Log(LogSeverity.INFO, `Steam directory is: ${steamDir}`);

const steamCmd = steamDir.indexOf(path.join(homedir(), '.var', 'app', 'com.valvesoftware.Steam')) == 0 ? `flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding --filesystem=home/.config/r2modmanPlus-local com.valvesoftware.Steam` : `"${steamDir}/steam.sh"`;
Copy link
Owner

Choose a reason for hiding this comment

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

A few questions which could be good to cover as a comment block above the line:

  1. Why is --branch=stable needed?
  2. What is this doing? --command=/app/bin/steam-wrapper
  3. What does --filesystem=home/.config/r2modmanPlus-local com.valvesoftware.Steam do?
  4. File forwarding?

Is there a way we can determine if it's installed using flatpak beforehand rather than essentially doing: if exe else flatpak?

Copy link
Author

@PedroVH PedroVH Aug 19, 2023

Choose a reason for hiding this comment

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

Yeah, these arguments were necessary when running r2modman as a flatpak, and i forgot to reevaluate them for just steam flatpak compatibility. I will update my PR, only flatpak run com.valvesoftware.Steam is necessary.

As for determinating beforehand if steam is flatpak, I'll have to have a better look at the code. Do you have any suggestions of where I could make this check? I'm thinking of putting this check in the Game class, but I want to hear your opinion

Copy link
Author

Choose a reason for hiding this comment

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

Oh, I found this LinuxGameDirectoryResolver, there is already checks like isProtonGame in that class. I think I'll put a "isFlatpakSteam" there

README.md Outdated
Copy link
Author

@PedroVH PedroVH Aug 20, 2023

Choose a reason for hiding this comment

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

for this to work, the user needs to give Steam flatpak access to ~/.config/r2modmanPlus-local, so I added a note in the README. This is necessary, or else steam won't be able to start BepInEx.

@lbrunkho
Copy link

Was just looking into making these changes myself! Glad I checked the list of PR. I am running Fedora with Steam installed as a flatpak and r2modman as an PRM package. I think this should solve the issues I am seeing by correctly calling the flatpak steam executable. Let me know if you would like me to build and test this, else I will wait for it to be merged.

@bb010g
Copy link

bb010g commented Oct 18, 2023

This looks to be a duplicate of #798.

@lbrunkho
Copy link

If this gets merged in, I can make a request on flathub forms.

In the event the maintainers don't want to ship a flatpak themselves.

@PedroVH
Copy link
Author

PedroVH commented Dec 5, 2023

The goal of this PR is to make r2modman compatible with steam flatpak.
This other PR does the same thing AND also makes necessary changes to pack r2modman as a flatpak.

Since that fork was not being maintained, I made my fork based on my needs. I'm keeping it in sync with the official releases, and I'm packaging to pacman, so if anyone wants to use that just go to the releases page in my fork. Also if anyone wants it packaged in another way just ping me

@Mervius
Copy link

Mervius commented Dec 11, 2023

If it were an rpm that would be a bit more convenient for me personally, but I can still run the program as it is now.

@PedroVH
Copy link
Author

PedroVH commented Dec 11, 2023

If it were an rpm that would be a bit more convenient for me personally, but I can still run the program as it is now.

@Mervius Check the latest release in my fork, just added other packagings. I haven't tested besides pacman tho

@Mervius
Copy link

Mervius commented Dec 11, 2023

the rpm seems to work fine from what I can tell.

@fanuch
Copy link

fanuch commented Dec 22, 2023

I've been trying to get r2modman to work with Flatpak and couldn't as it wouldn't accept the steam binary in the relevant flatpak dirs for steam. Running @PedroVH fork immediately worked for me.

Would be great to see this merged in some capacity.

(Tested appimage from fork releases)

@JustinLex
Copy link

JustinLex commented Jan 3, 2024

This fix is really important to me. I didn't realize when I switched to Flatpak Steam, that it would break r2modman. I would love to see this PR reviewed and merged soon.

@craigcabrey
Copy link

#!/bin/sh

sed -i '/#!\/usr\/bin\/env bash/aif [ -z $FLATPAK_ID ]; then\n  exec flatpak run com.valvesoftware.Steam $@\nfi' $HOME/.var/app/com.valvesoftware.Steam/data/Steam/steam.sh

r2modman.AppImage

Here is my janky script to make it work without any changes to r2modman. Put this & the r2modman AppImage in your PATH (e.g ~/.local/bin). This just inserts a preample in steam.sh to re-exec in the flatpak context.

It needs to be re-inserted everytime since Steam detects the change and overwrites it (which also means a slow Steam startup).

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.

None yet

10 participants