r2modmanPlus
r2modmanPlus copied to clipboard
[FEATURE REQUEST] - Support Steam in a Flatpak
What problem does the feature request solve? Sometimes Linux gamers don't install Steam natively but instead opt for the Flatpak version of Steam.
Example mock-up (optional)
The path for Flatpak'd Steam would look something like ~/.var/app/com.valvesoftware.Steam/.steam/steam/steamapps/common/Valheim
. It could be implemented as another selectable option, i.e. Xbox, Steam, Steam (Flatpak)
Additional information (optional) A workaround before this is implemented could be simply linking the Steam native directory to the Steam Flatpak directory. But that doesn't work for me because I have both a native and a Flatpak version of Steam installed.
Another workaround might be trying to run r2modman within the Steam Flatpak. I believe AppImages are not supported within a Flatpak so it must first be extracted then ran. You can enter the Flatpak environment shell by using the command flatpak run --command=/bin/bash com.valvesoftware.Steam
and r2modman needs to be ran with the option --no-sandbox
. Once you have your mods installed a normal launch won't work, launch Flatpak Steam with options like:
com.valvesoftware.Steam -applaunch 892970 --doorstop-enable true --doorstop-target ~/.var/app/com.valvesoftware.Steam/.config/r2modmanPlus-local/Valheim/profiles/Default/BepInEx/core/BepInEx.Preloader.dll --r2profile Default --doorstop-dll-search-override ~/.var/app/com.valvesoftware.Steam/.config/r2modmanPlus-local/Valheim/profiles/Default/unstripped_corlib
Note, this is not a duplicate of #729 because this issue is relating to using r2modman as an AppImage with Flatpak'd Steam, whereas #729 is relating to distributing r2modman as a Flatpak, potentially useful on the Steam Deck.
This is required for compatibility with immutable OSes such as Fedora Silverblue/Kinoite
I'm running Flatpak Steam and installed r2modman via AUR and r2modman detected my Steam directory as ~/.var/app/com.valvesoftware.Steam/.local/share/Steam
and the game dir was also detected properly. However, upon launching the game, I get the error You are missing the following 32-bit libraries, and Steam may not run: libc.so.6
, so it is probably not running Steam correctly?
I managed to cobble together something that works from answers in a few places:
- Use flatseal to grant Steam access to
xdg-config/r2modmanPlus-local
under "Other files". - Use the AppImage for r2modman normally to install and manage mods and profiles.
- Use the help tab inside r2modman while on a profile and copy the launch parameters at the bottom of the page under "Launching the game from outside the mod manager" to get Steam to launch the mod profile.
The "Start modded" and "Start vanilla" buttons in r2modman don't appear to be working as they seem to be trying to run steam outside the flatpak sandbox, but this appears to be the only concession till there's proper support implemented. All the game and data folders all got autodetected correctly for me even though I have my games installed inside the flatpak data folder (ie, in ~/.var/app/com.valvesoftware.Steam
)
I managed to cobble together something that works from answers in a few places:
1. Use flatseal to grant Steam access to `xdg-config/r2modmanPlus-local` under "Other files". 2. Use the AppImage for r2modman normally to install and manage mods and profiles. 3. Use the help tab inside r2modman while on a profile and copy the launch parameters at the bottom of the page under "Launching the game from outside the mod manager" to get Steam to launch the mod profile.
The "Start modded" and "Start vanilla" buttons in r2modman don't appear to be working as they seem to be trying to run steam outside the flatpak sandbox, but this appears to be the only concession till there's proper support implemented. All the game and data folders all got autodetected correctly for me even though I have my games installed inside the flatpak data folder (ie, in
~/.var/app/com.valvesoftware.Steam
)
I don't know what happened, r2modman worked just fine with Flatpak Steam just a few weeks ago, but now it has the issues finding libc.so.6
. Thank you so much for dropping the solution, I tried everything else to get it working, even deleting my steam library. I'm literally in shambles right now for not remembering to give permissions with flatseal
Perhaps they should add your solution to the documentation or something until a proper solution has been implemented?
Just ran into this today. Would be great if the workaround listed here was added onto this page: https://r2modman.com/troubleshooting/ under game doesn't start at all. Something like: R2ModMan does not support Flatpak Steam and can not start games. See these instructions to launch modded games from the launch options And maybe even a warning in the UI if steam is found under .var.
Installing mods worked great though! And thanks for the workaround too!
That website is not associated with this manager at all
This is because r2modman uses ${steamDir}/steam.sh
regardless of the steam directory it finds:
https://github.com/ebkr/r2modmanPlus/blob/b4825f00c8e2720d74cc5a9c0596633567ffd689/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts#L72
I managed to get this working with the following patch:
diff --git a/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts b/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts
index ddee0e9..ce396c8 100644
--- a/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts
+++ b/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts
@@ -69,7 +69,7 @@ export default class SteamGameRunner_Linux extends GameRunnerProvider {
LoggerProvider.instance.Log(LogSeverity.INFO, `Steam directory is: ${steamDir}`);
try {
- const cmd = `"${steamDir}/steam.sh" -applaunch ${game.activePlatform.storeIdentifier} ${args} ${settings.getContext().gameSpecific.launchParameters}`;
+ const cmd = `flatpak run com.valvesoftware.Steam -applaunch ${game.activePlatform.storeIdentifier} ${args} ${settings.getContext().gameSpecific.launchParameters}`;
LoggerProvider.instance.Log(LogSeverity.INFO, `Running command: ${cmd}`);
await exec(cmd);
} catch(err) {
Similarly to how nixos adds a patch: https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/games/r2modman/steam-launch-fix.patch
This is obviously not a proper fix. Ideally one would change the way the command is called depending on the steam directory found, and maybe allow overriding this with an option.