3 # XGrabControl, part of XGrabControl.
4 # (c) 2011, en passant development.
6 # This is a simple wrapper script for XGrabControl.
7 # Either source it or use it:
9 # or use it as a program running helper:
10 # XGrabControl program arg1 arg2 ...
13 SONAME=libXGrabControl.so
17 for n in $PWD "${0%/*}" /usr/lib /usr/local/lib
19 if [ -e "$n/$SONAME" ]
28 echo "$MYNAME: Could not find $SONAME. Aborting."
33 # Insert ourselves into LD_PRELOAD if we are not there yet.
34 if echo $LD_PRELOAD | grep -q "$SONAME" # $SONAME is treated as a regexp
36 echo "$MYNAME: $SONAME is already in LD_PRELOAD."
38 echo "$MYNAME: Adding $SOPATH to LD_PRELOAD."
39 export LD_PRELOAD="$SOPATH $LD_PRELOAD"
42 # If any arguments were given, pass them on to the shell.