File: getGimpPluginDir.sh

package info (click to toggle)
mtink 1.0.16-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,480 kB
  • ctags: 1,349
  • sloc: ansic: 19,263; sh: 1,008; python: 626; xml: 444; makefile: 75
file content (41 lines) | stat: -rwxr-xr-x 833 bytes parent folder | download | duplicates (9)
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
#!/bin/sh
# check for the gimp plugin directory

getGimptoolDir()
{
   for dir in `echo $PATH | tr ':' ' '`
   do
      if [ -x $dir/gimptool ]
      then
         echo $dir
         break;
      fi
      if [ -x $dir/gimptool-2.0 ]
      then
         echo $dir
         break;
      fi
   done
}

# this work perfectly with gimp 1.0, 1.1 and 1.2.
# gimptool will alway fail but we can get the wanted path

getDir()
{
  Res=`sh -x $gimptoolDir/gimptool ---install-admin-bin t.sh --just-print --dry-run 2>&1 | sed -n 's/.*plug[_]*in[_]*dir=\(.*\)/\1/p'`
  if [ "$Res" = "" ]
  then
     # we may have gimp 2.0
     Res=`$gimptoolDir/gimptool-2.0 --gimpplugindir 2>&1`
     if [ "$Res" = "" ]
     then
        Res=`$gimptoolDir/gimptool --gimpplugindir 2>&1`
     fi
  fi
  echo $Res/plug-ins
}

gimptoolDir=`getGimptoolDir`

getDir