1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

Only dump configuration changes, not theme in -dump-config.

This commit is contained in:
Dave Davenport 2017-09-04 16:46:06 +02:00
parent 2d586a47df
commit 73827ce680
4 changed files with 9 additions and 8 deletions

View file

@ -15,7 +15,7 @@ Command line only options:
-show [mode] Show the mode 'mode' and exit. The mode has to be enabled. -show [mode] Show the mode 'mode' and exit. The mode has to be enabled.
-no-lazy-grab Disable lazy grab that, when fail to grab keyboard, does not block but retry later. -no-lazy-grab Disable lazy grab that, when fail to grab keyboard, does not block but retry later.
-no-plugins Disable loading of external plugins. -no-plugins Disable loading of external plugins.
-dump-config Dump the current configuration and theme in rasi format and exit. -dump-config Dump the current configuration in rasi format and exit.
-dump-theme Dump the current theme in rasi format and exit. -dump-theme Dump the current theme in rasi format and exit.
DMENU command line options: DMENU command line options:
-mesg [string] Print a small user message under the prompt (uses pango markup) -mesg [string] Print a small user message under the prompt (uses pango markup)

View file

@ -167,8 +167,10 @@ char ** config_parser_return_display_help ( unsigned int *length );
gboolean config_parse_set_property ( const Property *p, char **error ); gboolean config_parse_set_property ( const Property *p, char **error );
/** /**
* @param changes Only print the changed options.
*
* @brief Dump configuration in rasi format. * @brief Dump configuration in rasi format.
*/ */
void config_parse_dump_config_rasi_format ( void ); void config_parse_dump_config_rasi_format ( gboolean changes );
/* @}*/ /* @}*/
#endif #endif

View file

@ -267,7 +267,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 ( "-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-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 ( "-no-plugins", "", "Disable loading of external plugins.", NULL, is_term );
print_help_msg ( "-dump-config", "", "Dump the current configuration and theme in rasi format and exit.", 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 ); print_help_msg ( "-dump-theme", "", "Dump the current theme in rasi format and exit.", NULL, is_term );
} }
static void help ( G_GNUC_UNUSED int argc, char **argv ) static void help ( G_GNUC_UNUSED int argc, char **argv )
@ -909,8 +909,7 @@ int main ( int argc, char *argv[] )
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
if ( find_arg ( "-dump-config" ) >= 0 ) { if ( find_arg ( "-dump-config" ) >= 0 ) {
config_parse_dump_config_rasi_format ( ); config_parse_dump_config_rasi_format ( TRUE );
rofi_theme_print ( rofi_theme );
cleanup (); cleanup ();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View file

@ -592,7 +592,7 @@ static void config_parse_dump_config_option ( XrmOption *option )
printf ( "\n" ); printf ( "\n" );
} }
void config_parse_dump_config_rasi_format ( void ) void config_parse_dump_config_rasi_format ( gboolean changes )
{ {
printf ( "configuration {\n" ); printf ( "configuration {\n" );
@ -604,12 +604,12 @@ void config_parse_dump_config_rasi_format ( void )
continue; continue;
} }
} }
if ( xrmOptions[i].source != CONFIG_DEFAULT ) { if ( !changes || xrmOptions[i].source != CONFIG_DEFAULT ) {
config_parse_dump_config_option ( &( xrmOptions[i] ) ); config_parse_dump_config_option ( &( xrmOptions[i] ) );
} }
} }
for ( unsigned int i = 0; i < num_extra_options; i++ ) { for ( unsigned int i = 0; i < num_extra_options; i++ ) {
if ( extra_options[i].source != CONFIG_DEFAULT ) { if ( !changes || extra_options[i].source != CONFIG_DEFAULT ) {
config_parse_dump_config_option ( &( extra_options[i] ) ); config_parse_dump_config_option ( &( extra_options[i] ) );
} }
} }