Skip to content

FIX: Launch Steam with xdg-open for Flatpak release#2077

Merged
ebkr merged 4 commits intoebkr:developfrom
TB516:develop
Feb 20, 2026
Merged

FIX: Launch Steam with xdg-open for Flatpak release#2077
ebkr merged 4 commits intoebkr:developfrom
TB516:develop

Conversation

@TB516
Copy link
Copy Markdown
Contributor

@TB516 TB516 commented Feb 17, 2026

Changes the Steam executable script to call xdg-open instead of flatpak-spawn, and the SteamGameRunner start method to pass the Steam protocol with the current app id. Would close #2076.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 17, 2026

CLA assistant check
All committers have signed the CLA.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

With these changes, the Flatpak version of R2 can launch both normal and Flatpak Steam, but I could also make changes so the AppImage does the same thing, just lmk and I'll get on it.

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 18, 2026

I've just ran this on Steam Deck in Game Mode, and I get:

Failed to call portal:GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface ?org.freedesktop.portal.OpenURI? on object at path /org/freedesktop/portal/desktop

It does however work in regular mode 🤔

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

Hm weird. I don't have a Steam deck but I'll do some research to see if there is anything to fix that.

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 18, 2026

Happy to run things on mine, but my turnaround will be relatively slow. It's quite tedious to do dev builds on it 💀

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

It seems like xdg-open is just not available in game mode? I'll see if there are any workarounds or anything we can do to work around it. There might be an environment variable to let us decide which way we should launch, with xdg-open being the default.

@arrowmaster
Copy link
Copy Markdown
Contributor

It seems like xdg-open is just not available in game mode? I'll see if there are any workarounds or anything we can do to work around it. There might be an environment variable to let us decide which way we should launch, with xdg-open being the default.

Sounds like because its not a full desktop either something with XDG environment variables or DBus isnt fully setup. I'd be curious what xdg-mime query default x-scheme-handler/steam returns from game mode and if that would be a good test.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

Ya from some more searching, it seems like the portal doesn't work in game mode. Im going to try to see if doing flatpak-spawn --host xdg-open url would work.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

@ebkr Here's the releases from the most recent build: https://github.com/TB516/r2modmanPlus/releases. When you get a sec, if you could test it, that would be awesome.

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 18, 2026

@ebkr Here's the releases from the most recent build: https://github.com/TB516/r2modmanPlus/releases. When you get a sec, if you could test it, that would be awesome.

image

💀

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 18, 2026

Apparently I needed to publish it, try now @ebkr

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 18, 2026

UncaughtException:
Error: Command Failed: ...
/usr/bin/xdg-open: line 1045: www-browser: command not found

(produces the same for the following)

  • links2
  • elinks
  • links
  • lynx
  • w3m

xdg-open: no method available for opening steam://run/632360

I can't directly copy/paste the content on the Deck annoyingly, so it's all manual typing

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 19, 2026

Ok, I just made some changes, so if it detects env variables that should be used for the Steam Deck game mode, it will try to run the script/flatpak-spawn run the Steam binary on the host; otherwise, use the xdg-open method. Should hopefully work. Link from the workflow to test here: https://github.com/TB516/r2modmanPlus/releases.

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 19, 2026

@TB516 I've pushed a change to the branch. Pull and give it a go to see if it still works. I've ran it on my end on both the Steam Deck and my CachyOS install (non-flatpak Steam, flatpak r2) and it works as expected.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 19, 2026

I'll give it a test tomorrow morning, but from looking it over it should be fine. I do want to make a note though: the wrapper script taking all arguments and passing it to flatpak-spawn might be an issue for publishing on flathub. If the steam binary wasn't found at all on deck mode, then maybe we make the script just take the path to steam.sh and the protocol? Otherwise, I could dig into the issues you were having with node's child processes to see if I can resolve it/move the flatpak-spawn command to a more controlled environment.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 19, 2026

Also something I've been thinking about, if you want (and it works, though, I don't see why it wouldn't), I could make changes so no matter if it's an appimage or a flatpak, if we aren't on the steam deck in game mode, it uses xdg-open. Even though I'd imagine most people using flatpak steam would want to use r2 as a flatpak, it should give the appimage the ability to launch all versions of steam.

@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 19, 2026

the wrapper script taking all arguments and passing it to flatpak-spawn might be an issue for publishing on flathub

I think it'll be an issue when we get to it, but I'd imagine they can understand the purpose of it given the nature of a mod manager.

In addition to that, I'm pretty sure the execution script is safe from injection due to the order that we pass values through.

Also something I've been thinking about, if you want (and it works, though, I don't see why it wouldn't), I could make changes so no matter if it's an appimage or a flatpak, if we aren't on the steam deck in game mode, it uses xdg-open. Even though I'd imagine most people using flatpak steam would want to use r2 as a flatpak, it should give the appimage the ability to launch all versions of steam.

The plan is to eventually switch everyone over to the web wrapper, but it's not a move I want to make just yet because I'd want it to be in-sync across all platforms and I don't have the time to spend on that yet.

In theory, all platforms can support the steam://run protocol, even Windows. But I'd also like to avoid having to have people manually add launch arguments if possible. Especially on Windows.

It's quite a big time investment and probably not that worthwhile atm

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 19, 2026

Fair enough, and that makes sense for moving everything over all at once. Back to the changes you made earlier, the actual logic for launching the flatpak version didn't change at all, and I've been running the custom build for the past few days with no issues, so from my perspective, it should be good to merge.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 20, 2026

Sorry for the delay but I got a chance to run it, and ya it still works perfectly!

@ebkr ebkr merged commit 1e3d703 into ebkr:develop Feb 20, 2026
1 check passed
@ebkr
Copy link
Copy Markdown
Owner

ebkr commented Feb 20, 2026

Merged, thank you 🔥

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Feb 21, 2026

Glad to help!

ebkr added a commit that referenced this pull request Mar 26, 2026
* rename test ci (#2065)

* feat: allow shimloader rules to be schema set

* fix: remove shimloader override capability

Replaces the shimloader install rule override functionality with...
nothing, those rules should be provided by the ecosystem schema instead.

This commit breaks all shimloader games until the cooresponding schema
PR is merged.

* Add four new games and updated shimloader fields
- Astroneer
- Deadly Delivery
- Granny: Chapter Two
- Soulcalibur VI

* Restored Profiles.vue actions alignment (#2067)

* FIX: Launch Steam with xdg-open for Flatpak release (#2077)

* Change R2 flatpak launching method from running steam.sh to invoking xdg-open with steam protocol

* Change steam_executable_launch to use flatpak-spawn --host xdg-open

* Steam deck game mode special launch condition

* Corrected environment variable check and restored expected launch wrapper behaviour

---------

Co-authored-by: Cade Ayres <ca469@kent.ac.uk>

* Add four new games
- A Gentleman's Dispute
- Super Battle Golf
- Cursed Words
- Ducks Can Drive

* Update Thunderstore ecosystem data

Use the demo version of Cursed Words as the full version has not been
released yet.

* Update Thunderstore ecosystem data

Fix steam folder for Cursed Words Demo

* Add game launch event emitter

Add a game launch event emitter which downstream code can hook to

* Expose thunderstoreIdentifier in Game class

Expose the Thunderstore-defined game identifier in the Game class

* Add tests for TypedEventEmitter

Add unit tests for the newly introduced TypedEventEmitter class

* Add NoOpInstaller for PackageLoader.NONE

This provides a type-safe way to simplify package loader installation
code since we don't need special checks for games that don't use
package loaders but depend on profiles.

* Rename InstallRuleInstaller to InstallRulePluginInstaller

This is to avoid confusion by unifying the naming with the other
PackageInstaller implementations. The convention is to name the mod
loader installers as FooInstaller and the mod installers as
FooPluginInstaller.

* Clean up internal implementation of InstallRulePluginInstaller

- Make internal helper method private
- Rename it to resolveFileTreeInstall as it's not exclusive for BepInEx
- Remove R2Error from helper's return type as no code path returns
  anything but undefined
- Remove unnecessary Promise.resolve as the helper is marked async

* Move mod enable/disable related code from GenericProfileInstaller

This is a step on the path to make InstallRulePluginInstaller support
all four methods of PackageInstaller class.

* Rename file

InstallRuleInstaller class was recently renamed to
InstallRulePluginInstaller to match the conventions in the codebase.
Rename file to match the exported class.

* Update Thunderstore ecosystem data

- Make Baby Steps visible now that the mod loader problem is resolved
- Replace obsolote Beetleball playtest version with demo version

* Remove recommended mod loader version from Beetleball

Melonloader v0.7.2. was released recently and according to reports
works fine with the demo version of the game. There's no longer need to
shepherd the users to use older version.

* Fix mod update on RecursiveMelonLoaderInstaller

Missing await when untinstalling the old version caused installing the
new version to fail due to files being in use.

* Add assets for four new games
- Gorilla Tag
- Jump Scare Mansion
- Pit of Goblin
- Very Very Valet

* Add missing Cryo asset

* Update schema

* Add Crawlspace, Big Ambitions

- Crawlspace
- Big Ambitions

* Design/activity bar (#2096)

* WIP: Added activity bar

* WIP: Moved navigation to Activity Bar

* WIP: Added design improvements, share and import buttons

* WIP: Improved visual of activity bar

* WIP: Added dropdown/popover to export profile action and removed ProfileManagementModal

* Re-enabled export functionality

* Removed import mod from activity bar

* Refactored to separate component and added to Help/Config screens

* Wrapped router-view in separate div to fix styling issue

* Design/navbar (#2097)

* Modernized navbar

* Changed navbar highlight colours

* Improved start button readability

* Fixed several display issues

* Fixed Splash and Linux setup screens

* Fixed some Quasar build quirks

* Regenerated yarn.lock with valid Yarn version

* Reduced z-index of popover to keep in background of ordinary modals (#2098)

* Release 3.2.15 (#2099)

---------

Co-authored-by: patty <49377371+patttterson@users.noreply.github.com>
Co-authored-by: Ethan Green <ethangreen.dev@gmail.com>
Co-authored-by: Antti Mäki <anttimaki@users.noreply.github.com>
Co-authored-by: Thomas <77514919+TB516@users.noreply.github.com>
Co-authored-by: Antti Mäki <antti@anttimaki.com>
Co-authored-by: Mythic <mythic@thunderstore.io>
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.

[BUG] - Flatpak Release Cannot Launch Flatpak Steam

4 participants