Package Details: discord_arch_electron 0.0.76-1

Git Clone URL: https://aur.archlinux.org/discord_arch_electron.git (read-only, click to copy)
Package Base: discord_arch_electron
Description: Discord using system provided electron for increased security and performance
Upstream URL: https://discord.com
Keywords: chat discord discord-stable discordapp electron video voice
Licenses: custom
Conflicts: discord
Provides: discord
Submitter: johnnyapol
Maintainer: Zoddo (Thaodan, SunRed)
Last Packager: Zoddo
Votes: 195
Popularity: 4.79
First Submitted: 2020-05-19 23:51 (UTC)
Last Updated: 2024-11-25 19:51 (UTC)

Dependencies (9)

Required by (25)

Sources (3)

Pinned Comments

SunRed commented on 2024-06-09 20:34 (UTC)

After a chat with @Zoddo and me just taking too long to come back to this, there should everything now be included that was in my old discord-electron package some migrated from (Krisp patcher, Wayland, autostart fix). Additionally I replaced the scrappy rizin patcher with a Python script someone from the nix community kindly made available.
Instead of checking against a checksum to know whether the Krisp binary was patched the script is run on every start of the client that results in slightly longer start times but has the advantage that we don't have to update the package if Discord ever silently updates the binary between client updates over their modules api.

Cheers

Zoddo commented on 2022-09-15 17:54 (UTC) (edited on 2023-03-31 17:24 (UTC) by Zoddo)

Starting with 0.0.26-1 (2023-03-31):
  • Switched back to the main electron package (electron22)
  • Watching cameras and streams is working again
Starting with 0.0.20-1 (2022-09-15):
  • Bumped electron16 to electron19 (I still have blocking issues with electron20)
  • Added support for $XDG_CONFIG_HOME/discord-flags.conf: this works like electron-flags.conf, you can set in this file the command line flags you want to pass to electron when running Discord (there are some useful flags in the wiki, especially if you are experiencing lag in the Discord UI).
FAQ

Discord requires an update, but this package isn't yet updated
Check the wiki.

The Discord UI is lagging
Try to add the flags recommended in the wiki in $XDG_CONFIG_HOME/discord-flags.conf.

Krisp not working
This is an issue that will likely never be fixed for this package. The Krisp module checks if Discord binaries are signed by Discord, which is not the case with this package.
See this comment and this GitHub issue for more details and possibles workarounds.

Latest Comments

« First ‹ Previous 1 .. 14 15 16 17 18 19 20 21 22 23 24 .. 39 Next › Last »

pendo324 commented on 2022-08-27 18:13 (UTC) (edited on 2022-08-27 18:14 (UTC) by pendo324)

Here's a full patch (based on the last few comments) for electron20 support. I've tested it myself on Arch with all the latest KDE/wayland packages, and the following flags (may not be necessary anymore): --ignore-gpu-blocklist --enable-gpu-rasterization. I'm pretty sure that the sed command that I added could be cleaner, but I'm lazy

diff --git a/PKGBUILD b/PKGBUILD
index 0069bf6..42d6c95 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,14 +5,14 @@
 pkgname=discord_arch_electron
 _pkgname=discord
 pkgver=0.0.19
-pkgrel=1
+pkgrel=2
 pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
 arch=('x86_64')
 provides=('discord')
 conflicts=('discord')
 url='https://discord.com'
 license=('custom')
-depends=('electron16')
+depends=('electron')
 makedepends=('asar')
 optdepends=('libpulse: Pulseaudio support'
             'xdg-utils: Open files')
@@ -39,6 +39,8 @@ package() {
   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
+  sed -i "s|^      nodeIntegration: false|      nodeIntegration: true|" Discord/resources/app/app_bootstrap/splashScreen.js
+  sed -i "s|^module.paths.*|module.paths = [\"/home/\" + process.env.USER + \"/.config/discord/${pkgver}/modules\"];|" Discord/resources/app/app_bootstrap/requireNative.js
   asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**'
   rm -rf Discord/resources/app

@@ -47,7 +49,7 @@ package() {

   # Create starter script for discord
   echo "#!/bin/sh" > "$srcdir"/$_pkgname
-  echo "exec electron16 /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname
+  echo "exec electron20 /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname

   install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}}
   install -Dm 755 $_pkgname "$pkgdir"/usr/bin/$_pkgname

Thaodan commented on 2022-08-27 18:01 (UTC)

I figured that one out too. electron20 enabled sandboxing for the renderer by default. It looks like discord doesn't like that. Adding sandbox: false, into app_bootstrap/splashScreen.js in the 'webPreferences' section fixes it, enabling electron20. Did microphone and co work after?

Thaodan commented on 2022-08-27 17:34 (UTC)

If I read this block from discord https://www.electronjs.org/blog/electron-internals-node-integration/ use nodeIntegration sounds like the right call!

lcronos commented on 2022-08-27 00:53 (UTC) (edited on 2022-08-27 00:54 (UTC) by lcronos)

@anonfunc

I figured that one out too. electron20 enabled sandboxing for the renderer by default. It looks like discord doesn't like that. Adding sandbox: false, into app_bootstrap/splashScreen.js in the 'webPreferences' section fixes it, enabling electron20.

It looks like putting nodeIntegration: true, may fix it as well, I wonder which option is safer (I'm not quite familiar enough with the inner-workings of electron to really get what nodeIntegration is doing, but maybe someone more knowledgeable than me can figure out the best option).

EDIT: Just tested, and yes, nodeIntegration: true, fixes it as well. My gut instinct is that this is probably the safer option, but I'd prefer someone more familar with this confirm.

anonfunc commented on 2022-08-24 11:32 (UTC) (edited on 2022-08-24 12:39 (UTC) by anonfunc)

@cosandr your patch has clipped lines (the added sed command for example) :)

Did you copy from less or similar pager?

EDIT: By adding .js to that clipped line I can confirm that patch is working fine with electron19. Sadly not with 20, but oh well. 19 should be fine for a decent while.

cosandr commented on 2022-08-23 07:21 (UTC) (edited on 2022-08-23 07:23 (UTC) by cosandr)

Patch for electron19 using @Nairaner and @Icronos findings. Works for me on sway 1.7.

diff --git a/PKGBUILD b/PKGBUILD
index 0069bf6..0a72534 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,14 +5,14 @@
 pkgname=discord_arch_electron
 _pkgname=discord
 pkgver=0.0.19
-pkgrel=1
+pkgrel=2
 pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
 arch=('x86_64')
 provides=('discord')
 conflicts=('discord')
 url='https://discord.com'
 license=('custom')
-depends=('electron16')
+depends=('electron19')
 makedepends=('asar')
 optdepends=('libpulse: Pulseaudio support'
             'xdg-utils: Open files')
@@ -39,6 +39,7 @@ package() {
   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
+  sed -i "s|^module.paths.*|module.paths = [\"/home/\" + process.env.USER + \"/.config/discord/${pkgver}/modules\"];|" Discord/resources/app/app_bootstrap/requireNative>
   asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**'
   rm -rf Discord/resources/app

@@ -47,7 +48,7 @@ package() {

   # Create starter script for discord
   echo "#!/bin/sh" > "$srcdir"/$_pkgname
-  echo "exec electron16 /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname
+  echo "exec electron19 /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname

   install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}}
   install -Dm 755 $_pkgname "$pkgdir"/usr/bin/$_pkgname

anonfunc commented on 2022-08-22 11:22 (UTC) (edited on 2022-08-22 11:23 (UTC) by anonfunc)

Is it possible to switch to a more recent electron? electron16 just got dropped.

kronikpillow commented on 2022-08-16 23:00 (UTC)

I seem to be unable to move around channels on a server, and even unable to reorganize the order of all my servers with this package ... kind of annoying, I have to reinstall the original Discord package to do reorganization of my servers and server folders, when i join a new server, and then to reinstall this package, to use it with the new order

Zoddo commented on 2022-08-11 09:47 (UTC) (edited on 2022-08-11 09:51 (UTC) by Zoddo)

@Hiru: I'm genuinely interested to know how you managed to get this error. asar is a build dependency, so makepkg should have failed on Checking buildtime dependencies... without the -s flag.

Hiru commented on 2022-08-11 00:00 (UTC) (edited on 2022-08-11 00:07 (UTC) by Hiru)

i'm getting an error when trying to update:


==> Making package: discord_arch_electron 0.0.19-1 (Wed 10 Aug 2022 10:54:16 PM -01)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
/home/user/.cache/yay/discord_arch_electron/PKGBUILD: line 38: asar: command not found
==> ERROR: A failure occurred in package().
    Aborting...
 -> error making: discord_arch_electron

edit: solved by manually installing community/asar