Implement conditions on tag

A condition is formed by:
    <tag> <op> <value>

<tag> is the normal yambar tag. <op> is one of '==', '!=', '<', '<=', '>', or
'>='. <value> is what you wish to compare it to.

'boolean' tags must be used directly. They falsehood is matched with '~':

    <tag>
    ~<tag>

Finally, to match an empty string, one must use ' "" ':
    <tag> <op> ""
This commit is contained in:
Leonardo Gibrowski Faé 2022-04-10 00:10:07 -03:00
parent 4496d82cfb
commit 2b103b7acd
11 changed files with 416 additions and 75 deletions

View file

@ -102,10 +102,9 @@ bar:
content:
"":
map:
tag: state
default: {string: {text: "{name}"}}
values:
focused: {string: {text: "{name}*"}}
conditions:
(state == focused): {string: {text: "{name}*"}}
current: { string: {text: "{application}: {title}"}}
```