summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Wieczorek2016-05-02 23:08:04 +0200
committerMarcin Wieczorek2016-05-02 23:08:04 +0200
commit56f0c9cceec79853bf518196d28f065291fe78ec (patch)
tree371d8aa0a9efb4d9900da4fdd79f7559eaaf1668
parent8b327bfb8021999dfea204b76fe30c6ad4e3ff32 (diff)
downloadaur-56f0c9cceec79853bf518196d28f065291fe78ec.tar.gz
Added start.sh fixing missing WM_CLASS property in NW.js
-rw-r--r--.SRCINFO4
-rwxr-xr-xPKGBUILD11
-rwxr-xr-xstart.sh14
3 files changed, 26 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fd2ae80a5e7..41c5e7c69e4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -19,9 +19,13 @@ pkgbase = messengerfordesktop-git
depends = libnotify
depends = fontconfig
depends = nss
+ depends = xorg-xprop
+ depends = xorg-xwininfo
options = !strip
source = messengerfordesktop-git::git+https://github.com/Sytten/Facebook-Messenger-Desktop.git
+ source = start.sh
md5sums = SKIP
+ md5sums = ce686652299792c01f4605cf995c4d87
pkgname = messengerfordesktop-git
diff --git a/PKGBUILD b/PKGBUILD
index 926a05fadb2..587a7921291 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,10 +8,12 @@ arch=('i686' 'x86_64')
url="http://messengerfordesktop.com/"
license=('MIT')
options=(!strip)
-depends=('gcc-libs' 'cairo' 'libxtst' 'alsa-lib' 'gtk2' 'gconf' 'libnotify' 'fontconfig' 'nss')
+depends=('gcc-libs' 'cairo' 'libxtst' 'alsa-lib' 'gtk2' 'gconf' 'libnotify' 'fontconfig' 'nss' 'xorg-xprop' 'xorg-xwininfo')
makedepends=('git' 'gulp' 'npm')
-source=("$pkgname::git+https://github.com/Sytten/Facebook-Messenger-Desktop.git")
-md5sums=('SKIP')
+source=("$pkgname::git+https://github.com/Sytten/Facebook-Messenger-Desktop.git"
+ "start.sh")
+md5sums=('SKIP'
+ 'ce686652299792c01f4605cf995c4d87')
install="$pkgname.install"
if [ $(uname -m) == "i686" ]
@@ -29,6 +31,8 @@ build() {
}
package() {
+ install -D -m755 "${srcdir}/start.sh" "${pkgdir}/opt/MessengerForDesktop/start.sh"
+
cd "${srcdir}/messengerfordesktop-git/build/Messenger/${_arch}"
mkdir -p "${pkgdir}/opt/MessengerForDesktop/"
install -D -m755 "Messenger" "${pkgdir}/opt/MessengerForDesktop/Messenger"
@@ -37,6 +41,7 @@ package() {
install -D -m644 "libffmpegsumo.so" "${pkgdir}/opt/MessengerForDesktop/libffmpegsumo.so"
cd "${srcdir}/messengerfordesktop-git/assets-linux"
+ sed -i '6s/.*/Exec=sh \/opt\/MessengerForDesktop\/start.sh/' messengerfordesktop.desktop
install -D -m644 "${srcdir}/messengerfordesktop-git/assets-linux/messengerfordesktop.desktop" "${pkgdir}/usr/share/applications/messengerfordesktop.desktop"
install -D -m644 "icons/256/messengerfordesktop.png" "${pkgdir}/usr/share/pixmaps/messengerfordesktop.png"
}
diff --git a/start.sh b/start.sh
new file mode 100755
index 00000000000..e50b2f1ad7a
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+EXEC="/usr/local/bin/messengerfordesktop"
+
+exec -a "$0" "$EXEC" $params &
+pid=$!
+
+while [ -z $winid ]
+do
+ winid=$(xwininfo -name "Messenger" 2> /dev/null | grep "Window id:" | grep -Eio "0x[a-z0-9]+")
+done
+xprop -id ${winid} -f WM_CLASS 8s -set WM_CLASS "MessengerForDesktop"
+
+wait $pid