summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-02-17 20:02:12 +0100
committerDave Davenport <qball@gmpclient.org>2017-02-17 20:02:12 +0100
commit85bd47e42f6212d8af25d26fb5497fa7755e3f2b (patch)
tree52ba6941fbe3a4086441ab69c1092172a626c29e
parent35deecec364805ed54ef18bf199bcee6895de895 (diff)
Quick 'n dirty hack to find plugin in plugin dir
-rw-r--r--Makefile.am3
-rw-r--r--source/rofi.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index ce79dd6a..da5ab542 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,7 +117,8 @@ rofi_CFLAGS=\
-I$(top_builddir)/\
-Werror=missing-prototypes\
-DSYSCONFDIR=\"$(sysconfdir)\"\
- -DTHEME_CONVERTER
+ -DTHEME_CONVERTER\
+ -DPLUGIN_PATH=\"${libdir}/rofi\"
rofi_LDADD=\
$(glib_LIBS)\
diff --git a/source/rofi.c b/source/rofi.c
index 97ce848c..d3c9daa7 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -451,9 +451,15 @@ static int add_mode ( const char * token )
}
else if ( g_str_has_suffix ( token, G_MODULE_SUFFIX ) )
{
+ gchar *fn;
+ if ( token[0] != G_DIR_SEPARATOR) {
+ fn = g_build_filename ( PLUGIN_PATH, token, NULL );
+ } else {
+ fn = g_strdup ( token );
+ }
TICK_N("Loading module");
// Load module.
- GModule *mod = g_module_open ( token, G_MODULE_BIND_LAZY|G_MODULE_BIND_LOCAL );
+ GModule *mod = g_module_open ( fn, G_MODULE_BIND_LAZY|G_MODULE_BIND_LOCAL );
if ( mod ) {
Mode *m = NULL;
if ( g_module_symbol ( mod, "mode", (gpointer *)&m) ){
@@ -473,6 +479,7 @@ static int add_mode ( const char * token )
} else {
fprintf ( stderr, "Failed to open module: %s\n", token);
}
+ g_free(fn);
TICK_N("Loading module done");
}
else {