summaryrefslogtreecommitdiffstats
path: root/source/xrmoptions.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-03-27 09:04:55 +0200
committerDave Davenport <qball@gmpclient.org>2017-03-27 09:04:55 +0200
commitb91a9fb0c0d08950aa4556c4a7e9ad0870a1cdab (patch)
treec42295027485464ce44244b7bddca59363de67d0 /source/xrmoptions.c
parent5186dab1b848d97aa12ae64b4f424371f91cec9c (diff)
Add 'Configuration' section to rasi format that parses config option.
Diffstat (limited to 'source/xrmoptions.c')
-rw-r--r--source/xrmoptions.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 9c017377..8b4e17e5 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -49,6 +49,7 @@ const char * const ConfigSourceStr[] = {
"Default",
"XResources",
"File",
+ "Rasi File",
"Commandline",
};
/** Enumerator of different sources of configuration. */
@@ -57,7 +58,8 @@ enum ConfigSource
CONFIG_DEFAULT = 0,
CONFIG_XRESOURCES = 1,
CONFIG_FILE = 2,
- CONFIG_CMDLINE = 3
+ CONFIG_FILE_THEME = 3,
+ CONFIG_CMDLINE = 4
};
typedef struct
@@ -386,6 +388,24 @@ static void __config_parse_xresource_options_dynamic ( xcb_xrm_database_t *xDB,
}
}
+void config_parser_set_option ( char *option, char *value)
+{
+ for ( unsigned int i = 0; i < sizeof ( xrmOptions ) / sizeof ( XrmOption ); ++i ) {
+ XrmOption *op = &( xrmOptions[i] );
+ if ( g_strcmp0 ( op->name, option) == 0 ) {
+ config_parser_set ( op, value, CONFIG_FILE_THEME);
+ return;
+ }
+ }
+ for ( unsigned int i = 0; i < num_extra_options; ++i ) {
+ XrmOption *op = &( extra_options[i] );
+ if ( g_strcmp0 ( op->name, option) == 0 ) {
+ config_parser_set ( op, value, CONFIG_FILE_THEME);
+ return;
+ }
+ }
+}
+
void config_parse_xresource_options_dynamic ( xcb_stuff *xcb )
{
char *name = window_get_text_prop ( xcb_stuff_get_root_window ( xcb ), XCB_ATOM_RESOURCE_MANAGER );