diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | boostchanger.sh | 24 |
3 files changed, 25 insertions, 9 deletions
@@ -1,7 +1,7 @@ pkgbase = boostchanger-bin pkgdesc = With this app you can control CPU turbo boost and the settings of the cpu speed in order to consuming less battery voltage on Linux pkgver = 5.0.3 - pkgrel = 7 + pkgrel = 9 url = https://github.com/nbebaw/boostchanger arch = x86_64 license = MIT @@ -14,6 +14,6 @@ pkgbase = boostchanger-bin source = boostchanger.sh sha256sums = 4f9d2239359802b2f0e3662556114a2c48a9f232064d6356f1a1501c7dd91726 sha256sums = af8aec94b8f5c88f4c4e4435570b94d143970c621048db7e25f27403fa4ec02e - sha256sums = f80acf84a87f3f50d7c4e2ed22f4d0e8b09dd98a6c26253f2524e5413771eab1 + sha256sums = 41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d pkgname = boostchanger-bin @@ -2,7 +2,7 @@ pkgname=boostchanger-bin pkgver=5.0.3 _electronversion=25 -pkgrel=7 +pkgrel=9 pkgdesc="With this app you can control CPU turbo boost and the settings of the cpu speed in order to consuming less battery voltage on Linux" arch=('x86_64') url="https://github.com/nbebaw/boostchanger" @@ -22,11 +22,13 @@ source=( ) sha256sums=('4f9d2239359802b2f0e3662556114a2c48a9f232064d6356f1a1501c7dd91726' 'af8aec94b8f5c88f4c4e4435570b94d143970c621048db7e25f27403fa4ec02e' - 'f80acf84a87f3f50d7c4e2ed22f4d0e8b09dd98a6c26253f2524e5413771eab1') + '41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d') build() { sed -e "s|@electronversion@|${_electronversion}|g" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ + -e "s|@cfgdirname@|${pkgname%-bin}|g" \ + -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" sed "s|/opt/${pkgname%-bin}/${pkgname%-bin}|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" asar e "${srcdir}/opt/${pkgname%-bin}/resources/app.asar" "${srcdir}/app.asar.unpacked" diff --git a/boostchanger.sh b/boostchanger.sh index e6784b369c25..398398461fee 100644 --- a/boostchanger.sh +++ b/boostchanger.sh @@ -1,15 +1,29 @@ -#!/bin/sh -set -e +#!/bin/bash +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}" "$@" || exit $? +if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "${_USER_FLAGS[@]}" "$@" else - exec electron@electronversion@ "${_RUNNAME}" --no-sandbox "$@" || exit $? + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "${_USER_FLAGS[@]}" "$@" fi
\ No newline at end of file |