mirror of
https://github.com/lbonn/rofi
synced 2024-11-23 12:23:02 +00:00
Quick 'n dirty hack to find plugin in plugin dir
This commit is contained in:
parent
35deecec36
commit
85bd47e42f
2 changed files with 10 additions and 2 deletions
|
@ -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)\
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue