Currently discord stable is running electron version 22.3.2
Using this technique I managed to make discord run natively on wayland, altho it is pretty unstable (screensharing doesn't):
- Make sure you have openasar installed
- Locate your discord's asar directory (ex:
/opt/discord/ressources/app.asar/
) - Inside id run
electron25 . --ozone-platform-hint=auto --enable-features=UseOzonePlatform
(I only tested electron25 but it may work with other versions as well)
- Install your prefered electron version (19, 20, 21 ,22)
- Copy the PKGBUILD from
discord_arch_electron_wayland
- Edit this PKGBUILD and replace every
electron13
by you prefered version (ie.electron22
), using sed:sed -i 's/electron13/electron22/g' PKGBUILD
- Go to openasar and download the app.asar
- Copy this file to
/usr/lib/discord/app.asar
(overwrite the current file) - You can run discord
- Install your prefered electron version (19, 20, 21 ,22)
- Download the latest discord version (use the tar.gz)
- Unpack it
- Go to openasar and download the app.asar
- Replace the
Discord/resources/app.asar
with the one download on step 4 - While you can now run discord using your prefered electron version I recomend moving this whole folder to a system dir (requires su permissions) like
/usr/bin
- Create a basic script like this in a folder wich is in your PATH (like
/bin
or/usr/bin
)
cd /usr/bin/discord/resources/
electron22 app.asar
- give it executable permissions
chmod +x /usr/bin/discord.sh
- Create a desktop entry file in your
/usr/share/applications
directory (needs su permission)
[Desktop Entry]
Name=Discord
StartupWMClass=discord
Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
GenericName=Internet Messenger
Exec=/usr/bin/discord
Icon=discord
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin
- Should now be available in your app menu (may need to login again)
- Download electron from it's release page over on github, the zip file to download should be name like so
electron-vVERSION-NUMER-win32-x64.zip
- Unzip the file to your desired directory
- Download and execute the openasar installer from it's website
- Open a terminal (CMD or powershell) back in the electron directory unziped in step 2 and run
.\electron.exe C:\Users\YOUR-USERNAME-HERE\AppData\Local\Discord\app-1.0.9007\resources\app.asar
, alternatively you can just replace this long path with%localappdata%\Discord\app-1.0.9007\resources\app.asar
if you are using CMD - I recommend creating a script and then creating a shortcut on your desktop with a custom icon
- You can now run discord using the downloaded electron version