summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-18 17:48:13 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-18 17:48:13 +0200
commit99f2a1a9bf6fedeafe3e882f76aff876274d8ed3 (patch)
treea7c93edd5e9e8c9ad46050b06f39f72860781e89 /lexer
parentae8e7d996430a48a211075b97727daaf0cb7e157 (diff)
Add @theme import command, that resets the current theme.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l6
-rw-r--r--lexer/theme-parser.y4
2 files changed, 8 insertions, 2 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 391ed3b8..a576e266 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -229,6 +229,7 @@ C_COMMENT_OPEN "/*"
INCLUDE "@import"
+THEME "@theme"
CONFIGURATION (?i:configuration)
@@ -302,6 +303,11 @@ if ( queue == NULL ){
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
BEGIN(INCLUDE);
}
+<INITIAL>{THEME} {
+ rofi_theme_reset();
+ g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
+ BEGIN(INCLUDE);
+}
/** Skip all whitespace */
<INCLUDE>{WHITESPACE} {}
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index de22b98b..b97bae22 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -256,8 +256,8 @@ t_entry_list:
%empty {
// There is always a base widget.
if (rofi_theme == NULL ){
- $$ = rofi_theme = g_slice_new0 ( ThemeWidget );
- rofi_theme->name = g_strdup ( "Root" );
+ rofi_theme_reset();
+ $$ = rofi_theme;
}
}
| t_entry_list