diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-03-04 12:22:28 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-03-04 12:22:28 +0100 |
commit | 8ee37012d1b55e69a66fb88727b14c284b6a367f (patch) | |
tree | e84ac09bfebecc3071c420adf6a4731f3a286d30 | |
parent | 86dc1e14486044c4b5d7838005fbe7960d157026 (diff) |
Add dir parser function
-rw-r--r-- | source/rofi.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/source/rofi.c b/source/rofi.c index fe952173..2770ee5c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -439,24 +439,10 @@ static gboolean rofi_collect_modi_add ( Mode *mode ) } return FALSE; } -/** - * Find all available modi. - */ -static void rofi_collect_modi ( void ) -{ -#ifdef WINDOW_MODE - rofi_collect_modi_add ( &window_mode ); - rofi_collect_modi_add ( &window_mode_cd ); -#endif - rofi_collect_modi_add ( &run_mode ); - rofi_collect_modi_add ( &ssh_mode ); -#ifdef ENABLE_DRUN - rofi_collect_modi_add ( &drun_mode ); -#endif - rofi_collect_modi_add ( &combi_mode ); - rofi_collect_modi_add ( &help_keys_mode ); - GDir *dir = g_dir_open ( PLUGIN_PATH, 0, NULL ); +static void rofi_collect_modi_dir ( const char *base_dir ) +{ + GDir *dir = g_dir_open ( base_dir, 0, NULL ); if ( dir ) { const char *dn = NULL; while ( ( dn = g_dir_read_name ( dir ) ) ) @@ -490,6 +476,26 @@ static void rofi_collect_modi ( void ) } /** + * Find all available modi. + */ +static void rofi_collect_modi ( void ) +{ +#ifdef WINDOW_MODE + rofi_collect_modi_add ( &window_mode ); + rofi_collect_modi_add ( &window_mode_cd ); +#endif + rofi_collect_modi_add ( &run_mode ); + rofi_collect_modi_add ( &ssh_mode ); +#ifdef ENABLE_DRUN + rofi_collect_modi_add ( &drun_mode ); +#endif + rofi_collect_modi_add ( &combi_mode ); + rofi_collect_modi_add ( &help_keys_mode ); + + rofi_collect_modi_dir ( PLUGIN_PATH ); +} + +/** * Setup configuration for config. */ static void rofi_collect_modi_setup ( void ) |