summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b0ce6963055fecce911b5998f2d7480ce04062ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: 910JQK <v910JQK@gmail.com>
_pkgname=subway-launcher
pkgname=$_pkgname-git
pkgver=r35.7edce43
pkgrel=2
pkgdesc='An HTML5-based application launcher for GNU/Linux with modern (metro) style.'
arch=('any')
url='https://github.com/SubwayDesktop/subway-launcher'
depends=('cubway-git' 'cubway-jslib-simplejs-git')
makedepends=('coreutils')
provides=('subway-launcher')
source=('subway-launcher::git+https://github.com/SubwayDesktop/subway-launcher.git')
md5sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_pkgname}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
	cd "${srcdir}/${_pkgname}"
	install -m755 -d "${pkgdir}/opt/Subway/launcher"
	install -m644 back_arrow.svg launcher.js main.html style.css "${pkgdir}/opt/Subway/launcher/"
	install -m755 -d "${pkgdir}/usr/bin"
	install -m755 -d "${pkgdir}/usr/share/applications"
	cat << EOF > "${pkgdir}/usr/bin/subway-launcher"
#!/bin/sh
if (dbus-send --session       \
  --dest=org.freedesktop.DBus \
  --type=method_call          \
  --print-reply               \
  /org/freedesktop/DBus       \
  org.freedesktop.DBus.ListNames \
  | grep 'org.subwaydesktop.launcher' > /dev/null );
then
  dbus-send --session \
  --dest=org.subwaydesktop.launcher \
  --type=method_call \
  /view org.subwaydesktop.cubway.toggleVisible
  dbus-send --session \
  --dest=org.subwaydesktop.launcher \
  --type=method_call \
  /view org.subwaydesktop.cubway.activateWindow
else
  /opt/Subway/Cubway/cubway /opt/Subway/launcher/main.html
fi
EOF
	chmod 755 "${pkgdir}/usr/bin/subway-launcher"
	cat << EOF > "${pkgdir}/usr/share/applications/subway-launcher.desktop"
[Desktop Entry]
Version=0.01
Encoding=UTF-8
Name=Subway Launcher
Comment=MS Modern Style Launcher
Exec=subway-launcher
Icon=applications-other
Categories=Application;Utility
EOF
	chmod 644 "${pkgdir}/usr/share/applications/subway-launcher.desktop"
}