summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-09-11 18:10:49 +0200
committerDave Davenport <qball@gmpclient.org>2020-09-11 18:10:49 +0200
commit6ba878e44a3522928cad6d3c0dcb1aaa2bec311e (patch)
treec9a40bbcb279dffaca9e1fff6ade8a3552beb78a
parentd3ae32429088a6fba726c8b7b39284f4708afe25 (diff)
[Lexer] Fix media parser.
-rw-r--r--doc/rofi-theme.515
-rw-r--r--doc/rofi-theme.5.markdown10
-rw-r--r--lexer/theme-lexer.l3
3 files changed, 23 insertions, 5 deletions
diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5
index 27084299..34077b3a 100644
--- a/doc/rofi-theme.5
+++ b/doc/rofi-theme.5
@@ -1420,12 +1420,23 @@ It supports the following keys as constraint:
.IP \(bu 2
\fB\fCmin\-aspect\-ratio\fR load when aspect ratio is over value.
.IP \(bu 2
-\fB\fCmax\-aspect\_ratio\fR: load when aspect ratio is under value.
+\fB\fCmax\-aspect\-ratio\fR: load when aspect ratio is under value.
.IP \(bu 2
\fB\fCmonitor\-id\fR: The monitor id, see rofi \-help for id's.
.PP
-@media takes an integer number or a fraction.
+@media takes an integer number or a fraction, for integer number \fB\fCpx\fR can be added.
+
+.PP
+.RS
+
+.nf
+@media ( min\-width: 120 px ) {
+
+}
+
+.fi
+.RE
.SH Multiple file handling
.PP
diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown
index 7b7d73db..2817545a 100644
--- a/doc/rofi-theme.5.markdown
+++ b/doc/rofi-theme.5.markdown
@@ -997,12 +997,18 @@ It supports the following keys as constraint:
* `min-height`: load when height is bigger then value.
* `max-height`: load when height is smaller then value.
* `min-aspect-ratio` load when aspect ratio is over value.
- * `max-aspect_ratio`: load when aspect ratio is under value.
+ * `max-aspect-ratio`: load when aspect ratio is under value.
* `monitor-id`: The monitor id, see rofi -help for id's.
-@media takes an integer number or a fraction.
+@media takes an integer number or a fraction, for integer number `px` can be added.
+```
+@media ( min-width: 120 px ) {
+
+}
+```
+
## Multiple file handling
The rasi file format offers two methods of including other files.
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 6542df86..8fb5840c 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -167,6 +167,7 @@ UANYN {ASCN}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
WHITESPACE [[:blank:]]
WSO [[:blank:]]*
WORD [[:alnum:]-]+
+MEDIA_NAME [[:alpha:]-]+
COLOR_NAME [[:alpha:]]+
STRING \"{UANYN}*\"
CHAR \'({ASCN}|\\\\|\\\'|\\0)\'
@@ -648,7 +649,7 @@ if ( queue == NULL ){
BEGIN(MEDIA_CONTENT);
return T_PARENT_LEFT;
}
-<MEDIA_CONTENT>{WORD} {
+<MEDIA_CONTENT>{MEDIA_NAME} {
yylval->sval = g_strdup(yytext);
return T_STRING;
}