summaryrefslogtreecommitdiffstats
path: root/source/rofi.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-04-21 09:48:03 +0200
committerDave Davenport <qball@gmpclient.org>2017-04-21 09:48:03 +0200
commit04e764c8e615b03e3fe3703f79e2662539ab5349 (patch)
tree4a10e0ddf88d6286b329eb6cce53161fb2a21322 /source/rofi.c
parent01159b29f009977da975ff8c2d648ec0d2881e40 (diff)
[Plugins] Add -no-plugins and -plugin-path options
* -no-plugins disables the loading of plugins. * -plugin-path specifies the directory used by rofi to look for plugins.
Diffstat (limited to 'source/rofi.c')
-rw-r--r--source/rofi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/rofi.c b/source/rofi.c
index a7f4a9b3..636f2787 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -305,6 +305,7 @@ static void print_main_application_options ( int is_term )
print_help_msg ( "-normal-window", "", "In dmenu mode, behave as a normal window. (experimental)", NULL, 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 );
}
static void help ( G_GNUC_UNUSED int argc, char **argv )
{
@@ -547,7 +548,7 @@ static void rofi_collect_modi_dir ( const char *base_dir )
Mode *m = NULL;
if ( g_module_symbol ( mod, "mode", (gpointer *) &m ) ) {
if ( m->abi_version != ABI_VERSION ) {
- g_warning ( "ABI version of plugin does not match: %08X expecting: %08X", m->abi_version, ABI_VERSION );
+ g_warning ( "ABI version of plugin: '%s' does not match: %08X expecting: %08X", dn, m->abi_version, ABI_VERSION );
g_module_close ( mod );
}
else {
@@ -558,7 +559,7 @@ static void rofi_collect_modi_dir ( const char *base_dir )
}
}
else {
- g_warning ( "Symbol 'mode' not found in module: %s", fn );
+ g_warning ( "Symbol 'mode' not found in module: %s", dn );
g_module_close ( mod );
}
}
@@ -585,7 +586,9 @@ static void rofi_collect_modi ( void )
rofi_collect_modi_add ( &combi_mode );
rofi_collect_modi_add ( &help_keys_mode );
- rofi_collect_modi_dir ( PLUGIN_PATH );
+ if ( find_arg ( "-no-plugins" ) < 0 ) {
+ rofi_collect_modi_dir ( config.plugin_path );
+ }
}
/**