summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornorly <norly@enpas.org>2011-10-10 01:13:20 +0100
committernorly <norly@enpas.org>2011-10-10 01:13:20 +0100
commitf1bc1bd7b8930bd04c585918dbbc185265123cd5 (patch)
tree89171e0a76bff25a9f5e6741f876b5c58be4dce7
parent12ed2a553cc8b73e91eb2ad0b416ef44d2097b36 (diff)
Added wrapper script.
-rwxr-xr-xXGrabControl26
1 files changed, 26 insertions, 0 deletions
diff --git a/XGrabControl b/XGrabControl
new file mode 100755
index 0000000..1154a70
--- /dev/null
+++ b/XGrabControl
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# XGrabControl, part of XGrabControl.
+# (c) 2011, en passant development.
+#
+# This is a simple wrapper script for XGrabControl.
+# Either source it or use it:
+# source XGrabControl
+# or use it as a program running helper:
+# XGrabControl program arg1 arg2 ...
+
+
+# Insert ourselves into LD_PRELOAD if we are not there yet.
+if echo $LD_PRELOAD | grep -q "libXGrabControl\.so"
+then
+ echo "XGrabControl: Already in LD_PRELOAD."
+else
+ echo "XGrabControl: Adding to LD_PRELOAD."
+ export LD_PRELOAD="libXGrabControl.so $LD_PRELOAD"
+fi
+
+# If any arguments were given, pass them on to the shell.
+if [ $# -gt 0 ]
+then
+ exec "$@"
+fi