summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrealgagu2018-12-14 17:29:31 -0500
committerfrealgagu2018-12-14 17:29:31 -0500
commit81a664674f9626b091a2cea3c9ebc972ea1ce450 (patch)
treef11c46edefb2e031a525604098def51251f39c66
downloadaur-81a664674f9626b091a2cea3c9ebc972ea1ce450.tar.gz
Initial commit.
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD42
-rw-r--r--whatsapp-nativefier-inject.js2
-rw-r--r--whatsapp-nativefier.desktop11
-rw-r--r--whatsapp-nativefier.pngbin0 -> 2043 bytes
6 files changed, 82 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0af48bf98cf
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = whatsapp-nativefier
+ pkgdesc = WhatsApp desktop built with nativefier (electron)
+ pkgver = 0.3.1649
+ pkgrel = 1
+ url = https://web.whatsapp.com
+ arch = armv7l
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = nodejs-nativefier
+ depends = gtk3
+ depends = libxss
+ depends = nss
+ source = whatsapp-nativefier.png
+ source = whatsapp-nativefier.desktop
+ source = whatsapp-nativefier-inject.js
+ sha256sums = 3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27
+ sha256sums = a4ea20639ea570d2f9ec6040b8873136fa507e0aa2341fd98aad25aa6bb66e2e
+ sha256sums = 043bd3f16d42464fab92d9ecd9ca4312f9a2bc07ca4da106df73ae0f227fa67f
+
+pkgname = whatsapp-nativefier
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..09b45b9e7a3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+whatsapp-nativefier-*.pkg.tar.xz
+whatsapp-nativefier-*.log
+PKGBUILD-namcap.log
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..2c2416d0c58
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Fredy GarcĂ­a <frealgagu at gmail dot com>
+
+pkgname=whatsapp-nativefier
+pkgver=0.3.1649
+pkgrel=1
+pkgdesc="WhatsApp desktop built with nativefier (electron)"
+arch=("armv7l" "i686" "x86_64")
+url="https://web.${pkgname%-nativefier}.com"
+license=("custom")
+depends=("gtk3" "libxss" "nss")
+makedepends=("nodejs-nativefier")
+source=("${pkgname}.png"
+ "${pkgname}.desktop"
+ "${pkgname}-inject.js")
+sha256sums=("3899581abcfed9b40b7208bbbca8bdbfe3ae9655980dbf55f04dec9cb3309f27"
+ "a4ea20639ea570d2f9ec6040b8873136fa507e0aa2341fd98aad25aa6bb66e2e"
+ "043bd3f16d42464fab92d9ecd9ca4312f9a2bc07ca4da106df73ae0f227fa67f")
+
+build() {
+ cd "${srcdir}"
+
+ nativefier \
+ --name "WhatsApp" \
+ --icon "${pkgname}.png" \
+ --width "800px" \
+ --height "600px" \
+ --inject "${pkgname}-inject.js" \
+ --verbose \
+ --tray \
+ "https://web.${pkgname%-nativefier}.com"
+}
+
+package() {
+ install -dm755 "${pkgdir}/"{opt,usr/{bin,share/{applications,licenses/${pkgname},pixmaps}}}
+
+ cp -rL "${srcdir}/whats-app-linux-"* "${pkgdir}/opt/${pkgname}"
+ ln -s "/opt/${pkgname}/whats-app" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm755 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm755 "${pkgdir}/opt/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm755 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+}
+
diff --git a/whatsapp-nativefier-inject.js b/whatsapp-nativefier-inject.js
new file mode 100644
index 00000000000..f60009058b6
--- /dev/null
+++ b/whatsapp-nativefier-inject.js
@@ -0,0 +1,2 @@
+if (document.body.innerText.replace(/\n/g, ' ').search(/whatsapp works with.*to use whatsapp.*update/i) === 0)
+ navigator.serviceWorker.getRegistration().then(function (r) { r.unregister(); document.location.reload() });
diff --git a/whatsapp-nativefier.desktop b/whatsapp-nativefier.desktop
new file mode 100644
index 00000000000..68034ff0a1b
--- /dev/null
+++ b/whatsapp-nativefier.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=WhatsApp
+Comment=WhatsApp desktop built with nativefier (electron)
+Exec=whatsapp-nativefier
+Icon=whatsapp-nativefier
+Encoding=UTF-8
+StartupWMClass=whatsapp-nativefier
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Network;Chat;InstantMessaging;Application;
diff --git a/whatsapp-nativefier.png b/whatsapp-nativefier.png
new file mode 100644
index 00000000000..5c0edcf41eb
--- /dev/null
+++ b/whatsapp-nativefier.png
Binary files differ