diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | hexpick.sh | 21 |
3 files changed, 23 insertions, 9 deletions
@@ -1,7 +1,7 @@ pkgbase = hexpick-bin pkgdesc = A simple color picker app for Linux pkgver = 1.0.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/KartoffelChipss/HexPick arch = x86_64 license = GPL-3.0-only @@ -12,6 +12,6 @@ pkgbase = hexpick-bin source = hexpick-1.0.1.deb::https://github.com/KartoffelChipss/HexPick/releases/download/v1.0.1/hexpick-1.0.1.deb source = hexpick.sh sha256sums = 04b1581f8a5440402222425a4af9218a4626a8588a32468cffdc384e0d3d5451 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d pkgname = hexpick-bin @@ -3,7 +3,7 @@ pkgname=hexpick-bin _pkgname=HexPick pkgver=1.0.1 _electronversion=29 -pkgrel=1 +pkgrel=2 pkgdesc="A simple color picker app for Linux" arch=('x86_64') url="https://github.com/KartoffelChipss/HexPick" @@ -19,12 +19,13 @@ source=( "${pkgname%-bin}.sh" ) sha256sums=('04b1581f8a5440402222425a4af9218a4626a8588a32468cffdc384e0d3d5451' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d') build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ - -e "s|@options@||g" \ + -e "s|@cfgdirname@|${pkgname%-bin}|g" \ + -e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \ -i "${srcdir}/${pkgname%-bin}.sh" bsdtar -xf "${srcdir}/data."* sed "s|/opt/${_pkgname}/${pkgname%-bin}|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" diff --git a/hexpick.sh b/hexpick.sh index 7ddcaab8d734..398398461fee 100644 --- a/hexpick.sh +++ b/hexpick.sh @@ -1,16 +1,29 @@ #!/bin/bash -set -e +set -o pipefail _APPDIR="/usr/lib/@appname@" _RUNNAME="${_APPDIR}/@runname@" +_CFGDIR="@cfgdirname@/" _OPTIONS="@options@" export PATH="${_APPDIR}:${PATH}" export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}" export ELECTRON_IS_DEV=0 export ELECTRON_FORCE_IS_PACKAGED=true +export ELECTRON_DISABLE_SECURITY_WARNINGS=true +export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@" export NODE_ENV=production +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf" +declare -a _USER_FLAGS +if [[ -f "${_FLAGS_FILE}" ]]; then + while read -r line; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then + _USER_FLAGS+=("${line}") + fi + done < "${_FLAGS_FILE}" +fi cd "${_APPDIR}" -if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then - exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $? +if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "${_USER_FLAGS[@]}" "$@" else - exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $? + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "${_USER_FLAGS[@]}" "$@" fi
\ No newline at end of file |