diff options
author | xiota | 2023-11-30 22:17:49 -0800 |
---|---|---|
committer | xiota | 2023-11-30 22:18:12 -0800 |
commit | 293d46a80e207b023a44710b177d4992e3f3b70a (patch) | |
tree | 0d14111ce53290db3a0695a07ad6ac3621731731 /PKGBUILD | |
parent | 90c4e48d285abfc13fc2574c3ac239081538975a (diff) | |
download | aur-knowte.tar.gz |
update script, gendesk
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 47 |
1 files changed, 38 insertions, 9 deletions
@@ -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() { |