I wonder if it’s possible to add Discord Rich Presence via the old discord-rpc API to a snap? No matter if I run Discord itself from within a snap or the traditional .deb package from their website, I can’t get the discord integration working in a snap.
I assume just building and adding discord-rpc itself to the app is not enough due to the confined nature of a snap package?
Looks like that indeed it must be ‘something else’ regarding the discord-ipc-X socket file - Discord doesn’t open a local port, so I think the whole network- interfaces are not necessary here (I’m connecting them anyways due to different reasons).
I’ll see if I can do some symlinking magic, maybe the snaps are looking at a different location for the websocket due to the modified $XDG_RUNTIME_DIR.
For now, RPC is in a private beta. We are not currently accepting any new developers into the program at this time.
So I guess the TCP/websockets based access is not generally available right now, but will be in future.
As far as workarounds go, a symlink probably won’t help since the access will be blocked by AppArmor. You might have luck bind mounting the socket: create an empty file with the right name in the snap’s private XDG_RUNTIME_DIR, then use mount --bind src target to mount the real socket file over the top of the empty file.
Unfortunately, this is not going to happen - this Discord RPC API is deprecated and got replaced with their (proprietary) Discord SDK, which is not GPL-complient and thus can’t be used in the application I’m snapping.
Thanks, I’ll give this a try and check if I can wrap the bind-mount in a launcher script.