hmlendea / gfn-electron

Linux Desktop client for Nvidia's GeForce NOW game streaming service
GNU General Public License v3.0
500 stars 62 forks source link

Added Discord Rich Presence support #62

Closed raluvy95 closed 2 years ago

raluvy95 commented 3 years ago

I made pull request to fix an issue #21 Here's what it looks like when I open geforcenow-electron app: image

For people who compiled from source code I used my application ID in config.json as default, but you can use difference application ID if you know how to use (or understands) Discord RPC.

hmlendea commented 3 years ago

Oh wow, that is great!

I wanted for a while to do this but I just couldn't find the time to prioritise it. Thanks a lot for the contribution!

When you say it is ready I shall review it as soon as I can (not today tho).

raluvy95 commented 3 years ago

Rich persence is working right now. Keep in mind that if the app or Discord are installed via flatpak (or snap), rich persence won't work because it couldn't detect discord or the app. See the similar issue in other projects https://github.com/iCrawl/discord-vscode/issues/77

hmlendea commented 3 years ago

I was unavailable for a while and didn't have time to fully test this, but here I am now.

Discord doesn't seem to be picking up any activity relating to GFN, am I missing something?

ExperiBass commented 2 years ago

Weird issue, runs fine with pnpm start, but after building with pnpm electron-builder --linux zip and running from the linux_unpacked folder, i get this error:

A JavaScript error occurred in the main process
Uncaught Exception:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/gingka/Builds/geforcenow-electron/dist/linux-unpacked/resources/app.asar/node_modules/node-fetch/src/index.js
require() of ES modules is not supported.
require() of /home/gingka/Builds/geforcenow-electron/dist/linux-unpacked/resources/app.asar/node_modules/node-fetch/src/index.js from /home/gingka/Builds/geforcenow-electron/dist/linux-unpacked/resources/app.asar/node_modules/discord-rpc/src/transports/ipc.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/gingka/Builds/geforcenow-electron/dist/linux-unpacked/resources/app.asar/node_modules/node-fetch/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:13)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/gingka/Builds/geforcenow-electron/dist/linux-unpacked/resources/app.asar/node_modules/discord-rpc/src/transports/ipc.js:5:15)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)

it completely fails to build with npm.

raluvy95 commented 2 years ago

Looks like my fork branch contains very old code. I'm closing this PR because I have no motivation to do so.

ExperiBass commented 2 years ago

Looks like my fork branch contains very old code. I'm closing this PR because I have no motivation to do so.

Do you mind if I continue it?

raluvy95 commented 2 years ago

Yes, you have rights to do with my old fork branch :)

ExperiBass commented 2 years ago

Yes, you have rights to do with my old fork branch :)

Thanks :D