Add theme option to config system.

This commit is contained in:
Dave Davenport 2016-12-11 18:06:35 +01:00
parent 3b850f4472
commit 95667e60d9
4 changed files with 7 additions and 3 deletions

View File

@ -128,4 +128,5 @@ Settings config = {
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.show_match = TRUE,
.theme = NULL,
};

View File

@ -149,6 +149,8 @@ typedef struct
/** Click outside the window to exit */
int click_to_exit;
gboolean show_match;
char *theme;
} Settings;
/** Global Settings structure. */
extern Settings config;

View File

@ -898,9 +898,8 @@ int main ( int argc, char *argv[] )
// Parse command line for settings, independent of other -no-config.
config_parse_cmd_options_dynamic ( );
char *theme = NULL;
if ( find_arg_str ( "-theme", &theme ) > 0 ){
rofi_theme_parse_file ( theme );
if ( config.theme ) {
rofi_theme_parse_file ( config.theme );
rofi_theme_print ( rofi_theme );
}

View File

@ -194,6 +194,8 @@ static XrmOption xrmOptions[] = {
"Click outside the window to exit", CONFIG_DEFAULT },
{ xrm_Boolean, "show-match", { .snum = &config.show_match }, NULL,
"Indicate how it match by underlining it.", CONFIG_DEFAULT },
{ xrm_String, "theme", { .str = &config.theme }, NULL,
"New style theme file" },
};
/** Dynamic array of extra options */