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 5 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               tag: carrier
67               values:
68                 false: {empty: {}}
69                 true:
70                   map:
71                     tag: state
72                     default: {string: {text: , font: *awesome, foreground: ffffff66}}
73                     values:
74                       up:
75                         map:
76                           tag: ipv4
77                           default: {string: {text: , font: *awesome}}
78                           values:
79                             "": {string: {text: , font: *awesome, foreground: ffffff66}}
80
81   Use yaml anchors
82       You often end up using the same definitions in a lot of places. This is
83       particular true for fonts. But it can also be true when mapping state.
84
85       In these cases, you can define an anchor point, either at top-level, or
86       in a module's anchors attribute:
87
88           awesome: &awesome Font Awesome 5 Free:style=solid:pixelsize=14
89
90
91       Then reference it in your particle definitions:
92
93           content:
94             string: {text: , font: *awesome}
95

GENERIC CONFIGURATION

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

BUILT-IN MODULES

132       Available modules have their own pages:
133
134       yambar-modules-alsa(5)
135
136       yambar-modules-backlight(5)
137
138       yambar-modules-battery(5)
139
140       yambar-modules-clock(5)
141
142       yambar-modules-i3(5)
143
144       yambar-modules-label(5)
145
146       yambar-modules-mpd(5)
147
148       yambar-modules-network(5)
149
150       yambar-modules-removables(5)
151
152       yambar-modules-river(5)
153
154       yambar-modules-script(5)
155
156       yambar-modules-sway-xkb(5)
157
158       yambar-modules-sway(5)
159
160       yambar-modules-xkb(5)
161
162       yambar-modules-xwindow(5)
163

SEE ALSO

165       yambar-particles(5), yambar-tags(5), yambar-decorations(5)
166
167                                  2022-08-26                 yambar-modules(5)
Impressum