diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | knowte.sh | 10 |
3 files changed, 39 insertions, 22 deletions
@@ -1,16 +1,14 @@ pkgbase = knowte pkgdesc = Cross platform note taking application pkgver = 3.0.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/digimezzo/knowte arch = x86_64 license = GPL3 makedepends = gendesk makedepends = nvm source = knowte-3.0.0.tar.gz::https://github.com/digimezzo/knowte/archive/refs/tags/v3.0.0.tar.gz - source = knowte.sh sha256sums = 32247fbec85fcd9340e35bcb0c2655e216899ac568e7dbe91844a873da280f64 - sha256sums = 4fc173bf2c4c7f210e4a3fa1983ed6e502aa3bd2845b1947a472952189272b6f pkgname = knowte depends = electron @@ -8,7 +8,7 @@ _pkgname=knowte pkgname="$_pkgname${_pkgtype:+-$_pkgtype}" pkgver=3.0.0 -pkgrel=1 +pkgrel=2 pkgdesc="Cross platform note taking application" url="https://github.com/digimezzo/knowte" license=('GPL3') @@ -26,13 +26,6 @@ _main_package() { else _main_git fi - - source+=( - "$_pkgname.sh" - ) - sha256sums+=( - '4fc173bf2c4c7f210e4a3fa1983ed6e502aa3bd2845b1947a472952189272b6f' - ) } # stable package @@ -72,7 +65,43 @@ _main_git() { # common functions prepare() { - gendesk -q -f -n --categories "Utility" --pkgname="${_pkgname}" --pkgdesc="$pkgdesc" --name="Knowte" --exec="${_pkgname}" + cat <<'EOF' > "$_pkgname.sh" +#!/usr/bin/env sh +set -e + +APPDIR="/usr/lib/knowte" +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + +_ELECTRON=/usr/bin/electron +_ASAR="${APPDIR}/app.asar" +_FLAGS_FILE="$XDG_CONFIG_HOME/logseq-flags.conf" + +if [ -r "$_FLAGS_FILE" ]; then + _USER_FLAGS="$(cat "$_FLAGS_FILE")" +fi + +if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then + exec ${_ELECTRON} ${_ASAR} $_USER_FLAGS "$@" +else + exec ${_ELECTRON} ${_ASAR} --no-sandbox $_USER_FLAGS "$@" +fi +EOF + + local _gendesk_options=( + -q -f -n + --pkgname="$_pkgname" + --pkgdesc="$pkgdesc" + --name="Knowte" + --exec="$_pkgname %u" + --icon="$_pkgname" + --terminal=false + --categories="Utility" + #--mimetypes="" + --startupnotify=true + --custom="StartupWMClass=Knowte" + ) + + gendesk "${_gendesk_options[@]}" } _ensure_local_nvm() { diff --git a/knowte.sh b/knowte.sh deleted file mode 100644 index 4f449d17be80..000000000000 --- a/knowte.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -_ELECTRON=/usr/bin/electron -APPDIR="/usr/lib/knowte" -export PATH="${APPDIR}:${PATH}" -_ASAR="${APPDIR}/app.asar" -if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then - exec ${_ELECTRON} ${_ASAR} "$@" -else - exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@" -fi |