diff options
author | root | 2018-09-03 17:05:08 -0500 |
---|---|---|
committer | root | 2018-09-03 17:05:08 -0500 |
commit | 33d76af541e7855ff2ced2a40b1dbfdf6ffbe5f1 (patch) | |
tree | 14098a713d0c07d94b399ce8aaad130fda19d935 /gog-hollow-knight | |
parent | e66f9eb58c67d79f4b958410506220b714a4773a (diff) | |
download | aur-33d76af541e7855ff2ced2a40b1dbfdf6ffbe5f1.tar.gz |
upgpkg: gog-hollow-knight 11.4.2.4-1
upstream release
v1.4.2.4
Diffstat (limited to 'gog-hollow-knight')
-rw-r--r-- | gog-hollow-knight | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/gog-hollow-knight b/gog-hollow-knight index 7e1175b8e385..b1965935c4e5 100644 --- a/gog-hollow-knight +++ b/gog-hollow-knight @@ -1,24 +1,37 @@ -#! /bin/bash - -pkgname='gog-hollow-knight' -pkgdir="/opt/${pkgname}/" -run="${pkgdir}/start.sh" - -if hash firejail; then - echo "Firejail detected; attempting to enforce a sandbox..." - if [[ -f "${XDG_CONFIG_HOME}/firejail/${pkgname}.profile" ]]; then - echo "Firejail profile for ${pkgname} found in ${XDG_CONFIG_HOME}/firejail/" - echo "Enforcing a sandbox!" - firejail "${run}" - elif [[ -f "/etc/firejail/${pkgname}.profile" ]]; then - echo "Firejail profile for ${pkgname} found in /etc/firejail/" - echo "Enforcing a sandbox!" - firejail "${run}" - else - echo "No Firejail profile detected!" - echo "Skipping Firejail sandbox..." - "${run}" - fi -else - "${run}" -fi +#!/usr/bin/env bash + +readonly APP='gog-hollow-knight' + +function warn() { + local -r msg="${1}" + + if tty &> /dev/null; then + printf '%s\n' "${msg}" 1>&2 + else + notify-send \ + --app-name="${APP}" \ + --icon="/usr/share/pixmaps/${APP}.png" \ + "${APP}" \ + "${msg}" + fi +} + +function main() { + local -r dir="/opt/${APP}/" + local -r start="${dir}/start.sh" + + # I don't make the rules... I just have to bend my scripts and PKGBUILDs to + # them... Basically Hollow Knight's global Config.ini must be writable by + # the user playing the game. To best accomplish this, I created a file that + # is writable by the group 'games': + if ! id "${USER}" | grep games &> /dev/null; then + warn "${USER} must be a member of group: 'games'" + return 1 + fi + + "${start}" +} + +main "${@}" + +# vim: sw=2 ts=2 et: |