aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/osx/textadept_osx
blob: 03162541429f2278cadc690e8efc029b65bbf1e7 (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
#!/bin/sh
# Copyright 2007-2015 Mitchell mitchell.att.foicica.com. See LICENSE.

# Set the GTK environment variables of resources within Textadept.app.
bundle=$(cd "$(dirname "$0")/../../" && pwd)
bundle_res="$bundle/Contents/Resources"
export DYLD_LIBRARY_PATH="$bundle_res/lib:$DYLD_LIBRARY_PATH"
export GTK_DATA_PREFIX="$bundle_res"
export GTK_EXE_PREFIX="$bundle_res"
export GTK_PATH="$bundle_res"
export GTK2_RC_FILES="$bundle_res/etc/gtk-2.0/gtkrc"
export GTK_IM_MODULE_FILE="$bundle_res/etc/gtk-2.0/gtk.immodules"
export GDK_PIXBUF_MODULE_FILE="$bundle_res/etc/gtk-2.0/gdk-pixbuf.loaders"
export PANGO_LIBDIR="$bundle_res/lib"
export PANGO_SYSCONFDIR="$bundle_res/etc"
export CHARSETALIASDIR="$bundle_res/lib"

# Strip out the argument added by OSX.
if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then shift 1; fi

# Source '~/.textadept/osx_env.sh' to set variables like $PATH when opening
# Textadept.app from the Dock or the Finder.
if [ -f $HOME/.textadept/osx_env.sh ]; then . $HOME/.textadept/osx_env.sh; fi

# Run Textadept.
textadept=textadept
if [ ! -z $TEXTADEPTJIT ]; then textadept=textadeptjit; fi
exec "$bundle/Contents/MacOS/$textadept" "$@"