1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-03-03 16:05:20 -05:00

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}", .window_format = "{w} {c} {t}",
.click_to_exit = TRUE, .click_to_exit = TRUE,
.show_match = TRUE, .show_match = TRUE,
.theme = NULL,
}; };

View file

@ -149,6 +149,8 @@ typedef struct
/** Click outside the window to exit */ /** Click outside the window to exit */
int click_to_exit; int click_to_exit;
gboolean show_match; gboolean show_match;
char *theme;
} Settings; } Settings;
/** Global Settings structure. */ /** Global Settings structure. */
extern Settings config; 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. // Parse command line for settings, independent of other -no-config.
config_parse_cmd_options_dynamic ( ); config_parse_cmd_options_dynamic ( );
char *theme = NULL; if ( config.theme ) {
if ( find_arg_str ( "-theme", &theme ) > 0 ){ rofi_theme_parse_file ( config.theme );
rofi_theme_parse_file ( theme );
rofi_theme_print ( rofi_theme ); rofi_theme_print ( rofi_theme );
} }

View file

@ -194,6 +194,8 @@ static XrmOption xrmOptions[] = {
"Click outside the window to exit", CONFIG_DEFAULT }, "Click outside the window to exit", CONFIG_DEFAULT },
{ xrm_Boolean, "show-match", { .snum = &config.show_match }, NULL, { xrm_Boolean, "show-match", { .snum = &config.show_match }, NULL,
"Indicate how it match by underlining it.", CONFIG_DEFAULT }, "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 */ /** Dynamic array of extra options */