mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-22 18:25:38 +02:00
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:
parent
4496d82cfb
commit
2b103b7acd
11 changed files with 416 additions and 75 deletions
|
@ -68,20 +68,17 @@ in red.
|
|||
```
|
||||
content:
|
||||
map:
|
||||
tag: carrier
|
||||
values:
|
||||
false: {empty: {}}
|
||||
true:
|
||||
conditions:
|
||||
(carrier == false): {empty: {}}
|
||||
(carrier == true):
|
||||
map:
|
||||
tag: state
|
||||
default: {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
values:
|
||||
up:
|
||||
conditions:
|
||||
(state == up):
|
||||
map:
|
||||
tag: ipv4
|
||||
default: {string: {text: , font: *awesome}}
|
||||
values:
|
||||
"": {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
conditions:
|
||||
(ipv4 == ""): {string: {text: , font: *awesome, foreground: ffffff66}}
|
||||
```
|
||||
|
||||
## Use yaml anchors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue