aur/sublime-text.sh
Carsten Teibes 200b0ec02c [add] sublime-text 2.0.2
Add an old libpng with associated patches to circumvent a bug:
The compiled-in zlib does not work with newer libpng versions,
therefore no icons are shown in sublime-text dialogs.
2015-02-09 19:20:46 +01:00

22 lines
604 B
Bash
Executable file

#!/bin/bash
# Please note that Sublime Text 2 for some reason opens an empty instance
# if the project you're trying to open is already open in another instance,
# instead of just giving it focus.
BIN=/opt/sublime-text/sublime_text
PID=$(ps -Ao comm,pid | awk '$1 == "sublime_text" { print $2 }')
ARGS="--class=sublime_text"
if [[ ${1:(-16)} == ".sublime-project" ]]; then
ARGS="${ARGS} --project"
fi
# LD_LIBRARY_PATH is needed for old libpng
if [[ -n ${PID} ]]; then
LD_LIBRARY_PATH=/opt/sublime-text/lib ${BIN} ${ARGS} "$@"
else
LD_LIBRARY_PATH=/opt/sublime-text/lib ${BIN} ${ARGS} "$@" &
fi