summarylogtreecommitdiffstats
path: root/gog-hollow-knight
blob: b1965935c4e5dc06043f901fe84796a88874acaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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: