flathub / com.googleplaymusicdesktopplayer.GPMDP

https://flathub.org/apps/details/com.googleplaymusicdesktopplayer.GPMDP
4 stars 5 forks source link

Rich presence #7

Closed Leeo97one closed 5 years ago

Leeo97one commented 6 years ago

How can we let this flatpak notify a Discord client about rich presence?

TingPing commented 6 years ago

Probably not possible but I'm not familiar with it, do you have a link to any more information?

TingPing commented 6 years ago

I guess this is better handled here anyway: https://github.com/flathub/com.discordapp.Discord/issues/29

Amosar commented 5 years ago

The flatpak version of discord now support RPC https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) Can you support this on this flatpak please? You can found a WIP for steam her https://github.com/flathub/com.valvesoftware.Steam/pull/273

TingPing commented 5 years ago

Maybe @gasinvein can make a PR.

gasinvein commented 5 years ago

Done. I don't have a Play Music account, so please test this https://github.com/flathub/com.googleplaymusicdesktopplayer.GPMDP/pull/12#issuecomment-445480767 build.

Amosar commented 5 years ago

Thanks for you work on this support @gasinvein :) But your patch doesn't work :/ The script seems to not create the simlink into the flatpak container :

amosar@amosar-Fix:/run/user/1000$ flatpak run --command=/bin/bash com.googleplaymusicdesktopplayer.GPMDP/x86_64/stable
bash-4.4$ ls -l $XDG_RUNTIME_DIR/
total 4
drwxr-xr-x 3 amosar amosar 60 10 déc.  00:02 app
srwxrwxr-x 1 amosar amosar  0 10 déc.  00:02 at-spi-bus
srwxrwxr-x 1 amosar amosar  0 10 déc.  00:02 bus
drwxr-xr-x 2 amosar amosar 60  9 déc.  18:36 discord
dr-x------ 2 amosar amosar  0  1 janv.  1970 doc
lrwxrwxrwx 1 amosar amosar 22 10 déc.  00:02 flatpak-info -> ../../../.flatpak-info
drwxr-xr-x 2 amosar amosar 80 10 déc.  00:02 pulse
-rw------- 0 amosar amosar 56 10 déc.  00:02 Xauthority
bash-4.4$ ls -l $XDG_RUNTIME_DIR/discord/
total 0
srwxrwxr-x 1 amosar amosar 0  9 déc.  18:36 ipc-0

If I run your loop manually and then I run gpmdp into the container then the integration work

gasinvein commented 5 years ago

@Amosar

flatpak run --command=/bin/bash com.googleplaymusicdesktopplayer.GPMDP/x86_64/stable

This way the code in the wrapper script wouldn't work, because the wrapper isn't executed at all. Run the warpper google-play-music-desktop-player directly from sandbox shell, or use desktop launcher.

Amosar commented 5 years ago

I have tried but that doesn't work, this is why I have tried to run the loop manually

gasinvein commented 5 years ago

That's strange. Can you please run bash -x google-play-music-desktop-player (from inside sandbox) and post output here?

Amosar commented 5 years ago

I have found something new when I have launch your commande, but thats weird If I run your command directly the process number is small than 10 and discord refused to use it But if I kill it with CTRL+C then I run your command again this work. this one not work discord

And this one work discord2

gasinvein commented 5 years ago

Well, does the wrapper create symlinks for you?

Amosar commented 5 years ago

Yes it create it because it can communicate with the discord container and bash -x google-play-music-desktop-player execute the loop as expected.

nanonyme commented 5 years ago

I suggest hunting down where that min PID assumption comes from. It's invalid for Flatpak