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

New instructions for connecting Flatpak Wine/Proton games to native Discord RPC clients #8

Open
Arcitec opened this issue Nov 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Arcitec
Copy link

Arcitec commented Nov 15, 2024

Hey, absolutely awesome project! I love how you've created a service that runs in the background and bridges the Windows pipe to the UNIX pipe. :)

On that note, the entire section about Flatpak apps is using a deeply broken, unfixable method of linking to the host socket.

Here are the resources that describe the best way of linking between native Discord clients and your Flatpak games:

Installing that bridge is all you have to do. The Flatpak apps (such as Heroic, Steam, Lutris) must of course also be correctly configured to use the RPC sockets, as described here, but that's a job for the Flatpak app maintainers.

@Arcitec Arcitec added the bug Something isn't working label Nov 15, 2024
@EnderIce2
Copy link
Owner

Hey, absolutely awesome project! I love how you've created a service that runs in the background and bridges the Windows pipe to the UNIX pipe. :)

Thank you!

On that note, the entire section about Flatpak apps is using a deeply broken, unfixable method of linking to the host socket.
Installing that bridge is all you have to do. The Flatpak apps (such as Heroic, Steam, Lutris) must of course also be correctly configured to use the RPC sockets, as described here, but that's a job for the Flatpak app maintainers.

Hmm, looks like a good idea. I will have to test myself when I got more free time and maybe automate it?

@Arcitec
Copy link
Author

Arcitec commented Nov 16, 2024

@EnderIce2 Feel free to use the project for anything you want, or even just tell people to install it if you detect that the Flatpak RPC socket is missing. It requires sudo to install the service, and must be installed via the host (not inside the Flatpak environment), so that's a problem for automating installation. I don't think you'll be able to automate it from the Wine side.

But you could write a host-script that clones the repo and runs ./install.sh. The user must be able to provide sudo permission at the command prompt when the systemd service gets installed though. And it's a two-tier script: It uses sudo escalation for the system-wide steps, and local permissions for the current-user steps. In other words, it's an interactive shell script where the user has to be actively responding to the sudo escalation step.

discord-flatpak-rpc-bridge is however 100% complete and won't need any changes, so what you see there is the finished project.

Systemd sets up a listening socket at the Flatpak RPC path, then as soon as a Flatpak tries to use the Discord RPC socket, systemd launches the proxy service and gives ownership of the listening socket to the proxy process, bridging the Flatpak socket to the real native Discord RPC socket.

I wrote it in a way that people just ./install.sh a single time per computer, and it will be immediately installed system-wide for all users, with no need to think about it anymore. It'll just exist in the background as a socket trigger, and as soon as some Flatpak uses Discord RPC, the lightweight bridge/proxy starts up and makes sure Flatpaks are talking to the native Discord client. Things just work automatically after that.

Flatpaks will not need any changes to their manifest/permissions. They just have to be configured by the Flatpak author to use the standardized xdg-run/app/com.discordapp.Discord:create permission that they all use already. So it's a plug-and-play solution. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants