forked from akkana/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgimprun
More file actions
executable file
·60 lines (47 loc) · 2.06 KB
/
gimprun
File metadata and controls
executable file
·60 lines (47 loc) · 2.06 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/bash
# This script lets you run a GIMP you built yourself, and allows for
# several different GIMPs in different prefixes inside a base prefix.
# Make a link to this file named gimp-$version, e.g. gimp-master to
# run git master (currently 2.99), gimp-2.10 to run that version, etc.
# So, for example, inside a base prefix of $HOME/run/ you might
# have a GIMP 2.99 built with a prefix of $HOME/run/gimp-2.99,
# and another GIMP from git's master branch with a prefix of
# $HOME/run/gimp-2.99.
# Then you can have multiple symbolic links to this script in your
# bin directory naemd for the specific GIMP builds.
# For instance, name one gimp-2.10 and another gimp-master.
# The name of the executable will be used as the prefix directory
# inside BASE_PREFIX, and will also be used as the name of the
# GIMP executable to run -- with the special case that "gimp-master"
# will try to run an executable named "gimp-2.99".
# Set the path to your base prefix here, if it's different:
BASE_PREFIX=$HOME/run
GIMPEX=$(basename $0)
GIMP_PREFIX=$BASE_PREFIX/$GIMPEX
echo "prefix:", $GIMP_PREFIX
# Set mandatory enviroment variables
export PATH=$GIMP_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$GIMP_PREFIX/lib:$LD_LIBRARY_PATH
# GIMP master needs XDG_DATA_DIRS, but 2.10 breaks if you include it..
if [[ $GIMPEX == *master ]]; then
echo 'MASTER'
if [[ x$XDG_DATA_DIRS == x ]]; then
export XDG_DATA_DIRS=$GIMP_PREFIX/share:/usr/local/share:/usr/share
else
export XDG_DATA_DIRS=$GIMP_PREFIX/share:$XDG_DATA_DIRS
fi
echo XDG_DATA_DIRS $XDG_DATA_DIRS
fi
# Shouldn't be need for gimp, but Might be for things like plug-ins
export PKG_CONFIG_PATH=$GIMP_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
# If GIMPEX is gimp-master, change it to GIMP 2.99.
# This will need to be changed when the version gets bumped.
if [ $GIMPEX = 'gimp-master' ]; then
GIMPEX=gimp-2.99
fi
echo PATH $PATH
echo LD_LIBRARY_PATH $LD_LIBRARY_PATH
echo PKG_CONFIG_PATH $PKG_CONFIG_PATH
# Run GIMP, passing along any command-line arguments.
echo "Running:" $GIMP_PREFIX/bin/$GIMPEX $@
$GIMP_PREFIX/bin/$GIMPEX $@