flathub / sh.ppy.osu

https://flathub.org/apps/details/sh.ppy.osu
MIT License
25 stars 12 forks source link

Discord RPC #132

Open Quiel245 opened 8 months ago

Quiel245 commented 8 months ago

Seems like RPC doesn't work normally between games in flatpak and a normal (non flatpak) discord install (at least it isn't working for me), i saw this here tho: https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) (idk if i really got what's written there but yeah...) and was thinking if something could possibly be done about it, it's fine if not tho, just wanted to know

hideki2k02 commented 5 months ago

Seems like RPC doesn't work normally between games in flatpak and a normal discord install (at least it isn't working for me), i saw this here tho: https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) (idk if i really got what's written there but yeah...) and was thinking if something could possibly be done about it, it's fine if not tho, just wanted to know

This was recently implemented using a wrapper. However its not working properly and IMO should be removed as after the second launch the app wont launch if a symlink already exists with the following error: bwrap: Can't make symlink at /run/user/1000/discord-ipc-0: File exists

This approach is much better (You can customize it to work with your third-party client like Vesktop)

mkdir -p ~/.config/user-tmpfiles.d
echo 'L %t/discord-ipc-0 - - - - app/com.discordapp.Discord/discord-ipc-0' > ~/.config/user-tmpfiles.d/discord-rpc.conf
systemctl --user enable --now systemd-tmpfiles-setup.service
hideki2k02 commented 5 months ago

After some troubleshooting i've found out that the wrapper is creating the files in /run/user/1000/.flatpak/sh.ppy.osu/xdg-run not /run/user/1000/ (as probably intended). Deleting them makes the game work once again until the next reboot.

hideki2k02 commented 5 months ago

May or may not be related to https://github.com/flatpak/flatpak/issues/1971 i need someone else to test my hypothesis.

Wincohax commented 5 months ago

May or may not be related to flatpak/flatpak#1971 i need someone else to test my hypothesis.

The wrapper works flawlessly with the official Discord Flatpak.

However, I was able to replicate the app not launching with Vesktop (Flatpak) and adding xdg-run/discord-ipc-0 inside osu! flatpak filesystem permissions.

Nevertheless, this can be fixed using $i instead of 0.

ludverse commented 4 months ago

same issue here is there a quick fix for this?

EDIT: thanks Wincohax

adding xdg-run/discord-ipc-0 inside osu! flatpak filesystem permissions.