| 1 | #! /usr/bin/env bash |
| 2 | |
| 3 | set -o physical |
| 4 | |
| 5 | script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" |
| 6 | |
| 7 | bundle_dir="$(cd "${script_dir}/../Prefix"; pwd)" |
| 8 | |
| 9 | echo "Starting NetRadiant in ${bundle_dir}" |
| 10 | |
| 11 | cd "${bundle_dir}" |
| 12 | |
| 13 | export FC_DEBUG=1024 |
| 14 | |
| 15 | # if bundled |
| 16 | if [ -d "${bundle_dir}/share/icons/hicolor" ] |
| 17 | then |
| 18 | export FONTCONFIG_PATH="${bundle_dir}/etc/fonts" |
| 19 | |
| 20 | # export GDK_GL_LIBGL_PATH="${bundle_dir}/lib/libGL.1.dylib" |
| 21 | # export GDK_GL_LIBGLU_PATH="${bundle_dir}/lib/libGLU.1.dylib" |
| 22 | |
| 23 | export GDK_PATH="${bundle_dir}" |
| 24 | |
| 25 | export GDK_PIXBUF_MODULE_FILE="${bundle_dir}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" |
| 26 | |
| 27 | export GTK_IM_MODULE_FILE="${bundle_dir}/lib/gtk-2.0/2.10.0/immodules.cache" |
| 28 | |
| 29 | export GOBJECT_PATH="${bundle_dir}" |
| 30 | |
| 31 | export GTK_DATA_PREFIX="${bundle_dir}" |
| 32 | export GTK_EXE_PREFIX="${bundle_dir}" |
| 33 | export GTK_PATH="${bundle_dir}" |
| 34 | fi |
| 35 | |
| 36 | color="$(defaults read -g AppleInterfaceStyle 2>/dev/null)" |
| 37 | case "${color}" in |
| 38 | 'Dark') |
| 39 | ;; |
| 40 | *) |
| 41 | color='Light' |
| 42 | ;; |
| 43 | esac |
| 44 | |
| 45 | gtkrc_file="${bundle_dir}/share/themes/Mojave-${color}/gtk-2.0/gtkrc" |
| 46 | |
| 47 | if [ -f "${gtkrc_file}" ] |
| 48 | then |
| 49 | export GTK2_RC_FILES="${gtkrc_file}" |
| 50 | fi |
| 51 | |
| 52 | if [ "${1}" = '--debug' ] |
| 53 | then |
| 54 | shift |
| 55 | export PATH="/usr/bin:${PATH}" |
| 56 | exec lldb ./netradiant "${@}" |
| 57 | else |
| 58 | exec ./netradiant "${@}" |
| 59 | fi |