diff options
author | Vendicated | 2022-11-29 20:28:58 +0100 |
---|---|---|
committer | Vendicated | 2022-11-29 20:28:58 +0100 |
commit | 4141103bcf1209e8488da77ec4559de02b328c15 (patch) | |
tree | fb5b3c9538865ffc5c148b19739ff48525a26503 | |
parent | 0ea859b6a177ac836e8e6dcece161b8cfeee5b2f (diff) | |
download | aur-4141103bcf1209e8488da77ec4559de02b328c15.tar.gz |
Easy custom flags & electron version
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rwxr-xr-x | armcord-launcher.sh | 13 | ||||
-rwxr-xr-x | notes.install | 22 |
4 files changed, 43 insertions, 3 deletions
@@ -3,6 +3,7 @@ pkgbase = armcord-git pkgver = r595.cdb73c3 pkgrel = 4 url = https://github.com/ArmCord/ArmCord + install = notes.install arch = x86_64 arch = aarch64 license = custom:OSL-3.0 @@ -18,8 +19,10 @@ pkgbase = armcord-git source = armcord-git::git+https://github.com/ArmCord/ArmCord.git source = armcord.desktop source = armcord-launcher.sh + source = notes.install sha256sums = SKIP sha256sums = a964b66a4829eb2fe86a0fa4841a67a9fd3264dfea960aa4cacf2a64c0200d93 - sha256sums = 5a37668b474263bc362bc322df4c90981710b9294e85a5ab0fd93b253e9ca2e2 + sha256sums = 87eab1a06ee59701abe9eb97c8ec062f5a335e69510b915e6b5dce87558fe84a + sha256sums = 1eb8ba4094bd80b4e62e02198aa07bccf3d77937e01f627d2a580b8b0a4de076 pkgname = armcord-git @@ -16,6 +16,8 @@ optdepends=( 'xdg-utils: Open links, files, etc' ) +install="notes.install" + provides=("armcord") conflicts=("armcord") @@ -23,10 +25,12 @@ source=( "${pkgname}::git+${url}.git" "armcord.desktop" "armcord-launcher.sh" + "notes.install" ) sha256sums=('SKIP' 'a964b66a4829eb2fe86a0fa4841a67a9fd3264dfea960aa4cacf2a64c0200d93' - '5a37668b474263bc362bc322df4c90981710b9294e85a5ab0fd93b253e9ca2e2') + '87eab1a06ee59701abe9eb97c8ec062f5a335e69510b915e6b5dce87558fe84a' + '1eb8ba4094bd80b4e62e02198aa07bccf3d77937e01f627d2a580b8b0a4de076') pkgver() { cd "$pkgname" diff --git a/armcord-launcher.sh b/armcord-launcher.sh index 999cf6cb0cc3..77dce8a23101 100755 --- a/armcord-launcher.sh +++ b/armcord-launcher.sh @@ -1,3 +1,14 @@ #!/bin/sh -/usr/bin/electron /usr/share/armcord/app.asar +electron=/usr/bin/electron + +CONFIG=${XDG_CONFIG_HOME:-~/.config} +FLAGS="$CONFIG/armcord-flags.conf" + +# Allow users to override command-line options +if [ -f "$FLAGS" ]; then + USER_FLAGS="$(cat "$FLAGS")" +fi + +# shellcheck disable=SC2086 # USER_FLAGS has to be unquoted +"$electron" /usr/share/armcord/app.asar $USER_FLAGS "$@" diff --git a/notes.install b/notes.install new file mode 100755 index 000000000000..46b9f39893b8 --- /dev/null +++ b/notes.install @@ -0,0 +1,22 @@ +BOLD='\033[1m' +RESET='\033[0m' + +post_install() { + echo + printf "${BOLD}ArmCord successfully installed!${RESET}\n" + echo + printf "By default, ArmCord will run with ${BOLD}/usr/bin/electron${RESET}:\n" + # --no-sandbox flag is needed as otherwise electron segfaults due to being ran as root + # why does this script run as root anyway???????? + # doesn't that mean packages can just nuke your system here, making the entire "makepkg must not be run as root" + # stuff senseless? + electron --version --no-sandbox + echo + echo "You may use a custom electron, for example a more recent version." + printf "To do so, simply change the ${BOLD}electron${RESET} variable in ${BOLD}/usr/bin/armcord${RESET}\n" + echo "using your favorite text editor!" + echo + printf "You can also pass custom flags to ArmCord by adding them to ${BOLD}${XDG_CONFIG_HOME:-~/.config}/armcord-flags.conf${RESET}\n" + echo "See https://www.electronjs.org/docs/latest/api/command-line-switches#electron-cli-flags" + echo +} |