diff --git a/source/rofi.c b/source/rofi.c index 5b85763d..07448fa7 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -542,7 +542,6 @@ static int add_mode ( const char * token ) Mode *sw = script_switcher_parse_setup ( token ); if ( sw != NULL ) { modi[num_modi] = sw; - mode_set_config ( sw ); num_modi++; } else { @@ -564,7 +563,6 @@ static void setup_modi ( void ) } // Free string that was modified by strtok_r g_free ( switcher_str ); - rofi_collect_modi_setup (); } /** @@ -577,22 +575,14 @@ static inline void load_configuration ( ) gchar *etc = g_build_filename ( SYSCONFDIR, "rofi.conf", NULL ); if ( g_file_test ( etc, G_FILE_TEST_IS_REGULAR ) ) { config_parse_xresource_options_file ( etc ); - } - g_free ( etc ); - // Load in config from X resources. - config_parse_xresource_options ( xcb ); - config_parse_xresource_options_file ( config_path ); -} -static inline void load_configuration_dynamic ( ) -{ - // Load distro default settings - gchar *etc = g_build_filename ( SYSCONFDIR, "rofi.conf", NULL ); - if ( g_file_test ( etc, G_FILE_TEST_IS_REGULAR ) ) { config_parse_xresource_options_dynamic_file ( etc ); } g_free ( etc ); // Load in config from X resources. + config_parse_xresource_options ( xcb ); + // Load in config from X resources. config_parse_xresource_options_dynamic ( xcb ); + config_parse_xresource_options_file ( config_path ); config_parse_xresource_options_dynamic_file ( config_path ); } @@ -938,6 +928,7 @@ int main ( int argc, char *argv[] ) TICK_N ( "Open Display" ); rofi_collect_modi (); + rofi_collect_modi_setup (); TICK_N ( "Collect MODI" ); xcb->screen = xcb_aux_get_screen ( xcb->connection, xcb->screen_nbr ); @@ -1075,6 +1066,8 @@ int main ( int argc, char *argv[] ) } // Parse command line for settings, independent of other -no-config. config_parse_cmd_options ( ); + // Parse command line for settings, independent of other -no-config. + config_parse_cmd_options_dynamic ( ); if ( !dmenu_mode ) { // setup_modi @@ -1082,14 +1075,7 @@ int main ( int argc, char *argv[] ) TICK_N ( "Setup Modi" ); } - if ( find_arg ( "-no-config" ) < 0 ) { - // Reload for dynamic part. - load_configuration_dynamic ( ); - TICK_N ( "Load config dynamic" ); - } - // Parse command line for settings, independent of other -no-config. - config_parse_cmd_options_dynamic ( ); - TICK_N ( "Load cmd config dynamic" ); + TICK_N ( "Load cmd config" ); if ( config.theme ) { TICK_N ( "Parse theme" ); diff --git a/test/box-test.c b/test/box-test.c index 0e943d24..228fe52b 100644 --- a/test/box-test.c +++ b/test/box-test.c @@ -23,6 +23,9 @@ unsigned int test =0; } \ } +void config_parser_set_option ( const char *k, const char *v) +{ +} char * rofi_expand_path ( const char *path ) { diff --git a/test/scrollbar-test.c b/test/scrollbar-test.c index 297bff98..5402719c 100644 --- a/test/scrollbar-test.c +++ b/test/scrollbar-test.c @@ -22,6 +22,9 @@ unsigned int test =0; abort ( ); \ } \ } +void config_parser_set_option ( const char *k, const char *v) +{ +} void rofi_add_error_message ( GString *msg ) {} diff --git a/test/textbox-test.c b/test/textbox-test.c index 27a2e96d..8034b69b 100644 --- a/test/textbox-test.c +++ b/test/textbox-test.c @@ -22,6 +22,10 @@ unsigned int normal_window_mode = 0; #include "view.h" +void config_parser_set_option ( const char *k, const char *v) +{ +} + void rofi_add_error_message ( GString *msg) { } diff --git a/test/widget-test.c b/test/widget-test.c index 5b06012b..5118ffbd 100644 --- a/test/widget-test.c +++ b/test/widget-test.c @@ -12,6 +12,9 @@ unsigned int test =0; assert ( a ); \ printf ( "Test %3i passed (%s)\n", ++test, # a ); \ } +void config_parser_set_option ( const char *k, const char *v) +{ +} void rofi_add_error_message ( GString *msg ) { }