summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMateus Honorato2024-10-07 17:59:03 -0300
committerMateus Honorato2024-10-07 17:59:03 -0300
commitb0179b13425b08826aaf09634a5e07d825a4e750 (patch)
tree298450d0c008cb3a4f52c88bef610005141dcfb8 /PKGBUILD
parentdefd2d6a8d0c7530cd0331361865dd3695daa5ad (diff)
downloadaur-b0179b13425b08826aaf09634a5e07d825a4e750.tar.gz
improve duplicated instances patch
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD2
1 files changed, 2 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7ff1cec0e5da..87e0d4694511 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -69,6 +69,8 @@ prepare() {
sed -i 's|getIcon(){[^}]*}|getIcon(){return s.default.join(__dirname, "trayIcon.png");}|g' "$srcdir/asar_patched/.webpack/main/index.js"
# avoid running duplicated instances, fixes url opening
sed -i 's|handleOpenUrl);else if("win32"===process.platform)|handleOpenUrl);else if("linux"===process.platform)|g' "$srcdir/asar_patched/.webpack/main/index.js"
+ sed -i 's|async function(){await(0,a.setupLogging)(),|o.app.requestSingleInstanceLock() ? async function(){await(0,a.setupLogging)(),|g' "$srcdir/asar_patched/.webpack/main/index.js"
+ sed -i 's|setupAboutPanel)()}()}()|setupAboutPanel)()}()}() : o.app.quit();|g' "$srcdir/asar_patched/.webpack/main/index.js"
# fake the useragent as windows to fix the spellchecker languages selector and other issues
sed -i 's|e.setUserAgent(`${e.getUserAgent()} WantsServiceWorker`),|e.setUserAgent(`${e.getUserAgent().replace("Linux", "Windows")} WantsServiceWorker`),|g' "$srcdir/asar_patched/.webpack/main/index.js"
# repacking asar with all the patches