summaryrefslogtreecommitdiffstats
path: root/lexer/theme-parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'lexer/theme-parser.y')
-rw-r--r--lexer/theme-parser.y27
1 files changed, 27 insertions, 0 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index e304ff29..f571d231 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -89,6 +89,7 @@ int yylex (YYSTYPE *, YYLTYPE *);
%token NAME_PREFIX "Element section ('# {name} { ... }')"
%token WHITESPACE "White space"
%token PDEFAULTS "Default settings section ( '* { ... }')"
+%token CONFIGURATION "Configuration block"
%type <ival> highlight_styles
%type <sval> entry
@@ -131,6 +132,32 @@ NAME_PREFIX name_path BOPEN optional_properties BCLOSE
PDEFAULTS BOPEN optional_properties BCLOSE {
rofi_theme_widget_add_properties ( rofi_theme, $3);
}
+| CONFIGURATION BOPEN optional_properties BCLOSE {
+ GHashTableIter iter;
+ g_hash_table_iter_init ( &iter, $3 );
+ gpointer key,value;
+ while ( g_hash_table_iter_next ( &iter, &key, &value ) ) {
+ Property *p = (Property *) value;
+ switch ( p ->type )
+ {
+ case P_STRING:
+ config_parser_set_option ( p->name, p->value.s);
+ break;
+ case P_BOOLEAN:
+ config_parser_set_option ( p->name, p->value.b?"true":"false");
+ break;
+ case P_INTEGER:
+ {
+ char *str = g_strdup_printf("%d", p->value.i);
+ config_parser_set_option ( p->name, str );
+ g_free(str);
+ }
+ default:
+ break;
+
+ }
+ }
+}
;
/**