Created
October 3, 2022 21:09
-
-
Save ISSOtm/7cc83eb85791b0dcf40f7be2bf7879aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/PKGBUILD b/PKGBUILD | |
index fe012c2..f43190d 100644 | |
--- a/PKGBUILD | |
+++ b/PKGBUILD | |
@@ -18,10 +18,12 @@ optdepends=('libpulse: Pulseaudio support' | |
'xdg-utils: Open files') | |
source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz" | |
'discord-launcher.sh' | |
+ 'https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar' | |
'LICENSE.html::https://discordapp.com/terms' | |
'OSS-LICENSES.html::https://discordapp.com/licenses') | |
sha512sums=('720bc8a8b61cbbe3566c34065f9831571da121d210e3f2876c34cb964d60bab33f8dc16f7ca758e918cd8f35a69699c0b9063782e6c95087c0baa41a6d0e7cf5' | |
- '93418d8e40cab7ed25f6debc341294f76f90a4f879e158cfea418360c8705347653f60dbd6f18fb754448d299404bfa247b07625ae113e9386188d9f9485a14b' | |
+ '88a396a3b7e32aed71892c6cbcba4df7380887c94631b0138db349f80ed17c7a1fa43974c43c6be5b42db80f29198141301c4d6a09e7ce1040613a1ff67565b6' | |
+ SKIP | |
SKIP | |
SKIP) | |
@@ -35,11 +37,11 @@ package() { | |
install -d "$pkgdir"/usr/lib/$_pkgname | |
# HACKS FOR SYSTEM ELECTRON | |
- asar e Discord/resources/app.asar Discord/resources/app | |
+ asar e 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 | |
- sed -i "s#^module\.paths.*;#module.paths = [(process.env.XDG_CONFIG_HOME || (process.env.HOME + \"/.config\")) + \"/discord/$pkgver/modules\"];#" Discord/resources/app/app_bootstrap/requireNative.js | |
+ sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/utils/buildInfo.js | |
+ sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/autoStart/linux.js | |
+ sed -i "s#^module\.paths.*;#module.paths = [(process.env.XDG_CONFIG_HOME || (process.env.HOME + \"/.config\")) + \"/discord/$pkgver/modules\"];#" Discord/resources/app/utils/requireNative.js | |
asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**' | |
rm -rf Discord/resources/app | |
diff --git a/discord-launcher.sh b/discord-launcher.sh | |
index f778568..c5c61f4 100755 | |
--- a/discord-launcher.sh | |
+++ b/discord-launcher.sh | |
@@ -18,4 +18,29 @@ for line in "${MAPFILE[@]}"; do | |
fi | |
done | |
+if [ "$XDG_SESSION_TYPE" = wayland ]; then | |
+ # Using wayland | |
+ flags+=( | |
+ --enable-features=UseOzonePlatform | |
+ --ozone-platform=wayland | |
+ --enable-accelerated-mjpeg-decode | |
+ --enable-accelerated-video | |
+ --ignore-gpu-blacklist | |
+ --enable-native-gpu-memory-buffers | |
+ --enable-gpu-rasterization | |
+ --enable-gpu | |
+ --enable-features=WebRTCPipeWireCapturer | |
+ ) | |
+else | |
+ # Using x11 | |
+ flags+=( | |
+ --enable-accelerated-mjpeg-decode | |
+ --enable-accelerated-video | |
+ --ignore-gpu-blacklist | |
+ --enable-native-gpu-memory-buffers | |
+ --enable-gpu-rasterization | |
+ --enable-gpu | |
+ ) | |
+fi | |
+ | |
exec /usr/bin/${electron} /usr/lib/${name}/app.asar "${flags[@]}" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment