1yambar-modules(5)             File Formats Manual            yambar-modules(5)
2
3
4

NAME

6       yambar-modules - configuration file
7

DESCRIPTION

9       Modules are what monitors your system and provides data for the status
10       bar.
11
12       All modules expose their data through tags. Each tag has a name, type
13       and value. The name and type is fixed, while the value typically
14       changes over time. See yambar-tags(5).
15
16       The tags are rendered by particles. Each particle has its own way of
17       representing tag values. The simplest one is the string particle, which
18       renders a text representation of the tag value. See yambar-parti‐
19       cles(5).
20
21       Note that all the examples showed below have been kept simple. Here are
22       a couple of tips that will improve the looks:
23
24   Use list particles to change font and/or color
25       The string particle, for example, cannot change font or colors in the
26       middle of its string. To do this, you need to wrap multiple string par‐
27       ticles in a list particle.
28
29       This can be useful if you want to use an icon font for a glyph since
30       the default fallback fonts provided by fontconfig may not favor your
31       icon font.
32
33       Also remember there is a short version for lists (see yambar-parti‐
34       cles(5))
35
36       For example, to render backlight as " 20%", you could use:
37
38           content:
39             - string:
40                 font: Font Awesome 6 Free:style=solid:pixelsize=14
41                 text: 
42             - string:
43                 font: Adobe Helvetica:pixelsize=12
44                 text: "{percent}%"
45
46   Use map particles to handle 'state'
47       Several modules have a state tag that can be used to render different
48       particles depending on the module's state.
49
50       For example, you might want different things to be shown for a network
51       interface that is down or up. You could further differentiate between
52       an up interface that has or has not an IP address assigned to it.
53
54       Below is an example, where a wired connection is not renderer at all
55       when disconnected.
56
57       When connected, it is rendered in the default text color if it is up
58       and also has an IPv4 address. If it is up, but does not have an IPv4
59       address, it is rendered in a semi-transparent white color.
60
61       Finally, if it is down, or in any other unknown state, it is rendered
62       in red.
63
64           content:
65             map:
66               conditions:
67                 ~carrier: {empty: {}}
68                 carrier:
69                   map:
70                     default: {string: {text: , font: *awesome, foreground: ffffff66}}
71                     conditions:
72                       state == up:
73                         map:
74                           default: {string: {text: , font: *awesome}}
75                           conditions:
76                             ipv4 == "": {string: {text: , font: *awesome, foreground: ffffff66}}
77
78   Use yaml anchors
79       You often end up using the same definitions in a lot of places. This is
80       particular true for fonts. But it can also be true when mapping state.
81
82       In these cases, you can define an anchor point, either at top-level, or
83       in a module's anchors attribute:
84
85           awesome: &awesome Font Awesome 6 Free:style=solid:pixelsize=14
86
87
88       Then reference it in your particle definitions:
89
90           content:
91             string: {text: , font: *awesome}
92

GENERIC CONFIGURATION

94       Each module defines its own configuration format. However, the follow‐
95       ing attributes are supported by all modules:
96
97       ┌───────────┬─────────────────┬─────┬──────────────────────────────────┐
98Name       Type            Req Description                      
99       ├───────────┼─────────────────┼─────┼──────────────────────────────────┤
100       │content    │ particle        │ yes │ A particle describing how the    │
101       │           │                 │     │ module's information is to be    │
102       │           │                 │     │ rendered. See yambar-parti‐      
103       │           │                 │     │ cles(5)                          │
104       ├───────────┼─────────────────┼─────┼──────────────────────────────────┤
105       │anchors    │ associative ar‐ │ no  │ Free-to-use associative array,   │
106       │           │ ray             │     │ where you can put yaml anchor    │
107       │           │                 │     │ definitions                      │
108       ├───────────┼─────────────────┼─────┼──────────────────────────────────┤
109       │font       │ font            │ no  │ Font to use in the content par‐  │
110       │           │                 │     │ ticle. This is an inherited at‐  │
111       │           │                 │     │ tribute.                         │
112       ├───────────┼─────────────────┼─────┼──────────────────────────────────┤
113       │foreground │ color           │ no  │ Foreground (text) color of the   │
114       │           │                 │     │ content particle. This is an in‐ │
115       │           │                 │     │ herited attribute.               │
116       └───────────┴─────────────────┴─────┴──────────────────────────────────┘
117

BUILT-IN MODULES

119       Available modules have their own pages:
120
121       yambar-modules-alsa(5)
122
123       yambar-modules-backlight(5)
124
125       yambar-modules-battery(5)
126
127       yambar-modules-clock(5)
128
129       yambar-modules-i3(5)
130
131       yambar-modules-label(5)
132
133       yambar-modules-mpd(5)
134
135       yambar-modules-network(5)
136
137       yambar-modules-pulse(5)
138
139       yambar-modules-removables(5)
140
141       yambar-modules-river(5)
142
143       yambar-modules-script(5)
144
145       yambar-modules-sway-xkb(5)
146
147       yambar-modules-sway(5)
148
149       yambar-modules-xkb(5)
150
151       yambar-modules-xwindow(5)
152

SEE ALSO

154       yambar-particles(5), yambar-tags(5), yambar-decorations(5)
155
156                                  2023-07-14                 yambar-modules(5)
Impressum