summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 55f70cffe133e2834c1bc6b382fd59700f8358bb (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
61
62
# Maintainer: Ghassan Alduraibi <git@ghassan.dev>
# Contributor: akaessens

pkgname=google-calendar-nativefier-dark
pkgver=2023.02.13
pkgrel=2
pkgdesc='Google Calendar in shared Electron runtime with dark theme (by pyxelr)'
arch=('x86_64')
url='https://calendar.google.com'
license=('MIT')
depends=("electron")
makedepends=(
  'curl'
  'gendesk'
  'nodejs-nativefier'
)

_name='Google Calendar Dark'

prepare() {
  cat > "${pkgname}" <<EOF
#!/usr/bin/env bash
exec electron /usr/share/${pkgname} "\$@"
EOF
  gendesk \
    --pkgname "${pkgname}" \
    --pkgdesc "${pkgdesc}" \
    --name "${_name}" \
    --categories "Network;Office;Calendar" \
    -n \
    -f
  curl \
    https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Calendar_icon_%282020%29.svg/512px-Google_Calendar_icon_%282020%29.svg.png \
    > "${pkgname}.png"
  curl \
    https://raw.githubusercontent.com/pyxelr/dark-google-calendar/master/Google-DarkCalendar.user.css \
    > "${pkgname}.css"
}

build() {
  cd "${srcdir}"
  nativefier \
    https://calendar.google.com \
    --name "${_name}" \
    --icon "${pkgname}.png" \
    --maximize \
    --user-agent firefox \
    --single-instance \
    --verbose \
    --inject "${pkgname}.css"
}

package() {
  mkdir -p "${pkgdir}/usr/share"
  local _x=`echo "${_name// /}-linux-"*`
  cp -r "${_x}/resources/app" "${pkgdir}/usr/share/${pkgname}"
  install -Dm755 -t "${pkgdir}/usr/bin/" "${pkgname}"
  install -Dm644 -t "${pkgdir}/usr/share/applications/" "${pkgname}.desktop"
  install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "${_x}/LICENSE"
  install -Dm644 -t "${pkgdir}/usr/share/pixmaps/" "${pkgname}.png"
}