From 3a9c60804b0074f07b2165b3f2c1092459113440 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 19 Apr 2020 11:34:28 +0200 Subject: [PATCH] Add ROFI_PLUGIN_PATH environment variable. --- source/rofi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/rofi.c b/source/rofi.c index 9425738b..f6811aa7 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -504,6 +504,7 @@ static gboolean rofi_collect_modi_add ( Mode *mode ) static void rofi_collect_modi_dir ( const char *base_dir ) { + g_debug ( "Looking into: %s for plugins", base_dir ); GDir *dir = g_dir_open ( base_dir, 0, NULL ); if ( dir ) { const char *dn = NULL; @@ -512,6 +513,7 @@ static void rofi_collect_modi_dir ( const char *base_dir ) continue; } char *fn = g_build_filename ( base_dir, dn, NULL ); + g_debug ( "Trying to open: %s plugin", fn ); GModule *mod = g_module_open ( fn, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL ); if ( mod ) { Mode *m = NULL; @@ -562,6 +564,15 @@ static void rofi_collect_modi ( void ) find_arg_str ( "-plugin-path", &( config.plugin_path ) ); g_debug ( "Parse plugin path: %s", config.plugin_path ); rofi_collect_modi_dir ( config.plugin_path ); + /* ROFI_PLUGIN_PATH */ + const char *path = g_getenv("ROFI_PLUGIN_PATH"); + if ( path != NULL ) { + gchar ** paths = g_strsplit ( path, ":", -1 ); + for ( unsigned int i = 0; paths[i]; i++ ) { + rofi_collect_modi_dir ( paths[i] ); + } + g_strfreev ( paths ); + } } }