Package Details: discord_arch_electron 0.0.78-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: 197
Popularity: 4.27
First Submitted: 2020-05-19 23:51 (UTC)
Last Updated: 2024-12-17 20:22 (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 2 3 4 5 6 7 8 9 10 11 12 .. 39 Next › Last »

ItachiSan commented on 2023-11-06 21:05 (UTC) (edited on 2023-11-07 09:33 (UTC) by ItachiSan)

Hi, I would recommend to call the Electron binary rather than the Arch wrapper script.

Namely instead of:

exec /usr/bin/${electron} /usr/share/${name}/resources/app.asar "${flags[@]}" "$@"

It is better to do:

exec /usr/lib/${electron}/electron /usr/share/${name}/resources/app.asar "${flags[@]}" "$@"

Because otherwise both the flags from discord-flags.conf and {electron}-flags.conf get read.

This caused my Discord to crash when I created my electron25-flags.conf as Wayland flags do not work with it.

EDIT 1 Electron 24 works with no issues with Wayland flags. I recommend using that instead.

EDIT 2 Electron 24 works also with the Discord app 0.0.34.

reeeeeeeeeeelity commented on 2023-10-25 07:12 (UTC)

Great work! Wonder if you're willing to "Patch Krisp binary to ignore signature check" like the other package discord-electron. I have tested and it works with this package. Also set electron version to be 24 to make wayland work.

diff --git a/.SRCINFO b/.SRCINFO
index 2fd87aa..04862eb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -6,8 +6,9 @@ pkgbase = discord_arch_electron
    arch = any
    license = custom
    makedepends = asar
-   depends = electron
+   depends = electron24
    depends = libxss
+   depends = rizin
    optdepends = libpulse: Pulseaudio support
    optdepends = xdg-utils: Open files
    provides = discord
@@ -18,7 +19,7 @@ pkgbase = discord_arch_electron
    source = LICENSE.html::https://discord.com/terms
    source = OSS-LICENSES.html::https://discord.com/licenses
    sha512sums = e3ca9075e4a66c7c4358bdccb748f8f849de24cf3036b85d2c42dd15f8e56125fc42e86e73920751126b0e4fa73596a1d7af1f21ac9903911d6c843637c46813
-   sha512sums = d398351b209cd89432d8e9cebe9122f152484236d8ca4dd91e5679d3853fe2f082625d35a9ac3f450f1f08250736bf3a23db9926311e8271730d884b57d12dbc
+   sha512sums = 7824fb20f1065d89a964fe5977212324410711fe472a3b0e64b90e8148f98ed1524bbff709f88d00ef9b532cc81140d4a118c372e735f71c78f4d2baa3f6a7be
    sha512sums = SKIP
    sha512sums = SKIP

diff --git a/PKGBUILD b/PKGBUILD
index cc9f614..59771c3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 # Contributor: johnnyapol <arch@johnnyapol.me>
 # Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) <lains@archlinux.org>
 _pkgname=discord
-_electron=electron
+_electron=electron24
 pkgname=${_pkgname}_arch_electron
 pkgver=0.0.32
 pkgrel=1
@@ -15,7 +15,7 @@ conflicts=("${_pkgname}")
 url='https://discord.com'
 license=('custom')
 options=(!strip)
-depends=("${_electron}" 'libxss')
+depends=("${_electron}" 'libxss' 'rizin')
 makedepends=('asar')
 optdepends=('libpulse: Pulseaudio support'
             'xdg-utils: Open files')
@@ -24,12 +24,14 @@ source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
         'LICENSE.html::https://discord.com/terms'
         'OSS-LICENSES.html::https://discord.com/licenses')
 sha512sums=('e3ca9075e4a66c7c4358bdccb748f8f849de24cf3036b85d2c42dd15f8e56125fc42e86e73920751126b0e4fa73596a1d7af1f21ac9903911d6c843637c46813'
-            'd398351b209cd89432d8e9cebe9122f152484236d8ca4dd91e5679d3853fe2f082625d35a9ac3f450f1f08250736bf3a23db9926311e8271730d884b57d12dbc'
+            '7824fb20f1065d89a964fe5977212324410711fe472a3b0e64b90e8148f98ed1524bbff709f88d00ef9b532cc81140d4a118c372e735f71c78f4d2baa3f6a7be'
             SKIP
             SKIP)

+_krisp_b2sum='90c3fbf6aab16638995fe21c49d4b8f93dbec9a9147cc7b1424c591c630aae84c362ee2b1a81507311b31e442e6b2706e6f48e1df8edd7248f5659108bbb3711'
+
 prepare() {
-  sed -i "s|@PKGNAME@|${_pkgname}|;s|@ELECTRON@|${_electron}|" discord-launcher.sh
+  sed -i "s|@PKGNAME@|${_pkgname}|g;s|@PKGVER@|${pkgver}|g;s|@ELECTRON@|${_electron}|g;s|@KRISPB2@|${_krisp_b2sum}|g" discord-launcher.sh
   sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" Discord/discord.desktop

   # HACKS FOR SYSTEM ELECTRON
diff --git a/discord-launcher.sh b/discord-launcher.sh
index 6e6f47e..121d69c 100755
--- a/discord-launcher.sh
+++ b/discord-launcher.sh
@@ -8,6 +8,18 @@ flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"

 declare -a flags

+krisp_bin="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node"
+krisp_b2=@KRISPB2@
+
+if hash rizin &> /dev/null; then
+   # Patch Krisp binary to ignore signature check
+   if [[ -f "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then
+       addr=$(rz-find -x '4881ec00010000' "${krisp_bin}" | head -n1)
+       rizin -q -w -c "s $addr + 0x30 ; wao nop" "${krisp_bin}" &> /dev/null
+   fi
+fi
+
+
 if [[ -f "${flags_file}" ]]; then
     mapfile -t < "${flags_file}"
 fi

Zoddo commented on 2023-10-19 18:28 (UTC) (edited on 2023-10-19 18:31 (UTC) by Zoddo)

@Lightning5: That file isn't part of the package, but is dynamically created by Discord in your home directory when you start it. It would be possible to dynamically patch it in the launcher script, but there are edge cases like if you never started Discord before, the file doesn't yet exist, or what if you want to keep the option disabled?

Additionally, on top of the Arch package guideline that prohibits packages from including files in /home, I believe this extends to not touching any file in this directory in any way as a packager (install scripts, wrappers...) unless absolutely required to make the package work.

IMO, Discord should instead provide a system-wide option that distribution packagers can use to disable the built-in "updater".

For now, you can patch the file manually; it's a one-time action that you can then forget about.

Lightning5 commented on 2023-10-19 11:45 (UTC)

FEATURE REQUEST @Zoddo Regarding "Discord requires an update, but this package isn't yet updated"

https://wiki.archlinux.org/title/Discord#Discord_asks_for_an_update_not_yet_available_in_the_repository

Would it be possible to activate this by default? Discord update mechanism doesn't really serve any purpose for this package?

e00E commented on 2023-10-18 10:40 (UTC) (edited on 2023-10-18 10:48 (UTC) by e00E)

I just tested again. It still crashes. Maybe it is not Wayland in general but Sway specifically that crashes it? Some programs are confused by getting resized or not being floating in Sway.

Update: https://aur.archlinux.org/packages/discord-electron works for me. This might be due to different electron version being picked. discord_arch_electron does not fix the electron version, which made it use the plain electron package, which is 25. discord-electron forces electron-24. The maintainer has commented that they intentionally did not use 25 because it "resulted in unstable behavior".

Lightning5 commented on 2023-10-17 09:41 (UTC)

@e00E It works for me under Wayland. Try to set back to X, running it and then back to Wayland. If I remember correctly, first run has to be on X. Then it will work on Wayland :)

e00E commented on 2023-10-15 21:31 (UTC)

This package doesn't work with Wayland. I didn't read through a lot of comment history so maybe this has already been reported. By default when you run this package without xwayland, Discord doesn't start. If you add options that usually make electron work with Wayland, then Discord crashes after the splash screen.

aliu commented on 2023-10-09 19:54 (UTC)

If anyone is interested I also have an OpenASAR installer script that automatically searches all known possible directories

Thaodan commented on 2023-10-09 19:49 (UTC)

@Thaodan: The resource folder was asked by irisnk in this comment.

That sounds like a hack. If one wants openasar they should install discord patched with openasar... But not my call what he wants to do.