summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-10-16 18:25:16 +0200
committerDave Davenport <qball@gmpclient.org>2017-10-16 18:25:16 +0200
commit12e7b67ddd5a8bcb23e1e122b7f257cf55883ce2 (patch)
tree452370141d68d51bb8910db5f070273869c44e01 /source
parentf9cf9c6b87a1eab1fe778d1265b9dd313fc066b1 (diff)
Make -plugin-path commandline flag be read before loading plugins
Diffstat (limited to 'source')
-rw-r--r--source/rofi.c5
-rw-r--r--source/xrmoptions.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/source/rofi.c b/source/rofi.c
index d4b31ad8..170715f5 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -274,6 +274,7 @@ static void print_main_application_options ( int is_term )
print_help_msg ( "-show", "[mode]", "Show the mode 'mode' and exit. The mode has to be enabled.", NULL, is_term );
print_help_msg ( "-no-lazy-grab", "", "Disable lazy grab that, when fail to grab keyboard, does not block but retry later.", NULL, is_term );
print_help_msg ( "-no-plugins", "", "Disable loading of external plugins.", NULL, is_term );
+ print_help_msg ( "-plugin-path", "", "Directory used to search for rofi plugins.", NULL, is_term );
print_help_msg ( "-dump-config", "", "Dump the current configuration in rasi format and exit.", NULL, is_term );
print_help_msg ( "-dump-theme", "", "Dump the current theme in rasi format and exit.", NULL, is_term );
}
@@ -488,7 +489,7 @@ static void rofi_collect_modi_dir ( const char *base_dir )
if ( !g_str_has_suffix ( dn, G_MODULE_SUFFIX ) ) {
continue;
}
- char *fn = g_build_filename ( PLUGIN_PATH, dn, NULL );
+ char *fn = g_build_filename ( base_dir, dn, NULL );
GModule *mod = g_module_open ( fn, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL );
if ( mod ) {
Mode *m = NULL;
@@ -536,6 +537,8 @@ static void rofi_collect_modi ( void )
rofi_collect_modi_add ( &help_keys_mode );
if ( find_arg ( "-no-plugins" ) < 0 ) {
+ find_arg_str ( "-plugin-path", &(config.plugin_path) );
+ g_debug ( "Parse plugin path: %s", config.plugin_path );
rofi_collect_modi_dir ( config.plugin_path );
}
}
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 74a95853..9a0f155e 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -202,8 +202,6 @@ static XrmOption xrmOptions[] = {
"Color scheme for active row", CONFIG_DEFAULT },
{ xrm_String, "color-window", { .str = &config.color_window }, NULL,
"Color scheme window", CONFIG_DEFAULT },
- { xrm_String, "plugin-path", { .str = &config.plugin_path }, NULL,
- "Directory containing plugins", CONFIG_DEFAULT },
{ xrm_Number, "max-history-size", { .num = &config.max_history_size }, NULL,
"Max history size (WARNING: can cause slowdowns when set to high).", CONFIG_DEFAULT },
};