summaryrefslogtreecommitdiff
path: root/tools/shared.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-07-17 10:02:49 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-07-17 10:36:08 +1000
commitc7a9b2064d076df21e4984ea2c2f62f1aa7c9e36 (patch)
tree9b81872ec116586cefda452642103ec2904ff33a /tools/shared.c
parentad5d2fef7202e07581c1a3464ff54ada8565282b (diff)
downloadlibinput-c7a9b2064d076df21e4984ea2c2f62f1aa7c9e36.tar.gz
tools: setenv the quirks dir when running from the build directory
Fixes #84 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/shared.c')
-rw-r--r--tools/shared.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/shared.c b/tools/shared.c
index c36ee136..2a53343d 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -311,6 +311,13 @@ tools_open_device(const char *path, bool verbose, bool *grab)
return li;
}
+static void
+tools_setenv_quirks_dir(void)
+{
+ if (tools_execdir_is_builddir(NULL, 0))
+ setenv("LIBINPUT_QUIRKS_DIR", LIBINPUT_QUIRKS_SRCDIR, 0);
+}
+
struct libinput *
tools_open_backend(enum tools_backend which,
const char *seat_or_device,
@@ -319,6 +326,8 @@ tools_open_backend(enum tools_backend which,
{
struct libinput *li;
+ tools_setenv_quirks_dir();
+
switch (which) {
case BACKEND_UDEV:
li = tools_open_udev(seat_or_device, verbose, grab);