flathub / com.discordapp.Discord

https://flathub.org/apps/details/com.discordapp.Discord
119 stars 43 forks source link

Feasibility of using upstream electron similar to AUR package #151

Open anthr76 opened 3 years ago

anthr76 commented 3 years ago

Hello

ArchLinux AUR has seemed to workaround some discord's shortcomings with electron/screen sharing with pipewire etc.

They're using the system's electron. Is it possible we can do something like that with the flatpak?

They unpack the asar

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=discord_arch_electron#n36

  install -d "$pkgdir"/usr/lib/$_pkgname

  # HACKS FOR SYSTEM ELECTRON
  asar e Discord/resources/app.asar Discord/resources/app
  rm Discord/resources/app.asar
  sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/app_bootstrap/buildInfo.js
  sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js
  asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**'
  rm -rf Discord/resources/app

I have not tested myself but I have read/ and heard doing something like this allows you to use Pipewire and screen share properly

carlocastoldi commented 3 years ago

As far as I tested discord_arch_electron doesn't make it possible to screenshare using pipewire. If you hope to enable screensharing with this proposal, I highly doubt it will.

P.S. tested with:

❯ cat /usr/bin/discord
#!/bin/sh
exec electron --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --enable-gpu --ozone-platform=wayland /usr/lib/discord/app.asar $@
lionirdeadman commented 3 years ago

I believe I've said this before but not sure where. Doing this might count as a client modification and I don't want to cross that line.

SystemlessDev commented 3 years ago

I'm necroposting a bit but doing this would absolutely be considered a client mod. Any modifications to discord, or any of its components, is against their tos.

anthr76 commented 3 years ago

I mean the options Discord gives it's paying Linux customers are abysmal but if upstream has no desire I'm going to go ahead and close the issue.

lionirdeadman commented 3 years ago

I still believe that it would be a violation but I'd like to keep this open because I've sent an email about it to Discord to see if this breaks their policies or not.

anthr76 commented 3 years ago

Thanks! I'll keep an eye and would be happy to help if we get a response back.. FWIW I wonder what thier views are on flatpak itself considering it's not officially distrusted by them.

lionirdeadman commented 3 years ago

We already contacted them previously to allow the distribution of the binary. I recently emailed them about how they handled updates but they said their team and the infra was too small to do the things I wanted (either email me or check flatpak for updates instead of their current prompt)

thegarlynch commented 2 years ago

Just say fuck it and break TOS ? it is only support for it. it wouldn't be capital cost for them. or just contact the dev rather than email for support