diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-04-19 11:34:28 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-04-19 11:34:28 +0200 |
commit | 3a9c60804b0074f07b2165b3f2c1092459113440 (patch) | |
tree | ed3d1bc0ae4b6a37bbe77edaf0a4b54e40cfe507 | |
parent | 3e64e4422df516acb519de767889890e384c7645 (diff) |
Add ROFI_PLUGIN_PATH environment variable.
-rw-r--r-- | source/rofi.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 ); + } } } |