yambar-particles(5)
NAME
yambar-particles(5) β the particles configuration file, from the File Formats Manual. Hii bestie π
DESCRIPTION
Okay so particles are literally the thing that renders the tags your modules give you. Each particle defines its own set of configuration attributes. However, the following attributes are supported by all particles:
Common attributes π
left-marginβ type:int, required:no; space, in pixels, on the left side of the particle.right-marginβ type:int, required:no; space, in pixels, on the right side of the particle.marginβ type:int, required:no; short-hand for setting bothleft-marginandright-margin.fontβ type:font, required:no; the font to use. Note that this is an inherited attribute; i.e. you can set it on e.g. a list particle, and it will apply to all particles in the list. Slay.font-shapingβ type:enum, required:no; font-shaping; one offullornone. When set tofull(the default), strings will be "shaped" using HarfBuzz. Requires support in fcft.foregroundβ type:color, required:no; foreground (text) color. Just likefont, this is an inherited attribute.on-clickβ type:associative array/string, required:no; when set to a string, executes the string as a command when the particle is left-clicked. Tags can be used. Note that the string is not executed in a shell. Environment variables are not expanded.~/is expanded, but only in the first argument. The same applies to all attributes associated with it, below.on-click.leftβ type:string, required:no; command to execute when the particle is left-clicked.on-click.rightβ type:string, required:no; command to execute when the particle is right-clicked.on-click.middleβ type:string, required:no; command to execute when the particle is middle-clicked.on-click.wheel-upβ type:string, required:no; command to execute every time a 'wheel-up' event is triggered.on-click.wheel-downβ type:string, required:no; command to execute every time a 'wheel-down' event is triggered.on-click.previousβ type:string, required:no; command to execute when the particle is clicked with the 'previous' button.on-click.nextβ type:string, required:no; command to execute when the particle is clicked with the 'next' button.decoβ type:decoration, required:no; decoration to apply to the particle. Seeyambar-decorations(5).
EXAMPLES β¨
on-click as a string (handles left click):
content:
<particle>:
on-click: command args
on-click as an associative array (handles other buttons):
content:
<particle>:
on-click:
left: command-1
wheel-up: command-3
wheel-down: command-4
π STRING π
Okay so this is like the most basic particle ever β the starter pack, the vanilla ice cream of particles π¦. It takes a format string, which is just free text mixed with tag specifiers. That's it. That's the whole vibe.
β¨ CONFIGURATION β¨
textβ string, required π β the format string itself. You specify tags with{tag_name}. Some tag types have suffixes you can append (like{tag_name:suffix}). Go checkyambar-modules(5)for the tea on that one π«.maxβ int, optional β sets the rendered string's maximum length. If the final string's length exceeds this, the rendered string gets truncated and"β¦"gets appended. Important bestie: that trailing"β¦"counts toward the maximum length. So like, if you setmaxto'5', you will only get 4 characters from the string π. Math is math.
π EXAMPLES π
content:
string:
text: "hello, this is footag's value: {footag}"
π¦ EMPTY π¦
This particle is literally just a place-holder. It doesn't render any tags, but the margins and decorations do get rendered. So it's giving invisible-but-present, main character energy that refuses to be seen π».
β¨ CONFIGURATION β¨
None. Nothing. Zero. Nada π.
π EXAMPLES π
content:
empty: {}
π LIST π
This particle is a list (or sequence, if that's more your vibe) of other particles. You can use it to render like, string particles with different font and/or color formatting. Or any other particle combinations honestly, go off π .
But heads up β this means you cannot set any attributes on the list particle itself. It's a container, not a participant, iykyk.
β¨ CONFIGURATION β¨
itemsβ list, required β the list of sub particles π§left-spacingβ int, optional β space, in pixels, between the sub particles.right-spacingβ int, optional β space, in pixels, between the sub particles. Note:default=2πspacingβ int, optional β short-hand for setting bothleft-spacingandright-spacingat once. Slay, efficiency π
π EXAMPLES π
content:
list:
spacing: 5
items:
- string: {text: hello}
- string: {text: world}
A lot of the time, the only attribute you actually need to set is items. And for those times, there's a shorter form π. So instead of:
content:
list:
items:
- string: ...
- string: ...
you can just list the items directly:
content:
- string: ...
- string: ...
Not me loving a shortcut π«Ά.
π₯ MAP π₯
This particle maps the values of a specific tag to different particles based on conditions. So like, tag says one thing β show this, tag says another thing β show that. Very choose-your-own-adventure β.
A condition takes either the form of:
<tag> <operation> <value>
Or, for boolean tags:
<tag>
Where <tag> is the tag you would like to map, <operation> is one of:
==, !=, >=, >, <=, <
and <value> is the value you would like to compare it to. If the value contains any non-alphanumerical characters, you must surround it with ":
"hello world"
"@#$%"
Negation is done with a preceding ~:
~<tag>
~<condition>
To match for empty strings, use "":
<tag> == ""
Furthermore, you may use the boolean operators:
&&, ||
in order to create more complex conditions:
<condition1> && <condition2>
You may surround <condition> with parenthesis for clarity or for specifying precedence:
(<condition>)
<condition1> && (<condition2> || <condition3>)
In addition to explicit tag values, you can also specify a default/fallback particle π.
Lowkey crucial bestie: conditions are evaluated in the order they appear. If multiple conditions are true, the first one will be used. So in a configuration such as:
tx-bitrate > 1000:
tx-bitrate > 1000000:
the second condition would never run, since whenever the second condition is true, the first one is also true π. The correct way of doing this would be to invert the order of the conditions:
tx-bitrate > 1000000:
tx-bitrate > 1000:
β¨ CONFIGURATION β¨
conditionsβ associative array, required β an associative array of conditions (see above) mapped to particles πdefaultβ particle, optional β the default particle to use when none of the conditions are true. Your safety net, your fallback bestie π«Ά
π EXAMPLES π
content:
map:
default:
string:
text: this is the default particle; the tag's value is now {tag_name}
conditions:
tag == one_value:
string:
text: tag's value is now one_value
tag == another_value:
string:
text: tag's value is now another_value
For a boolean tag:
content:
map:
conditions:
tag:
string:
text: tag is true
~tag:
string:
text: tag is false
Periodt. π
π RAMP π
Okay bestie, RAMP is the particle that uses a range tag to index into an array of particles. Itβs giving βmap a value to a whole vibeβ: for example, map volume to a volume-level icon, or a batteryβs capacity level to a battery indicator. πβ¨
βοΈ CONFIGURATION βοΈ
tagβ string Β· Req: yes. The range tag (name of) to use as index.itemsβ list Β· Req: yes. List of particles. Note that the tag value is not used as-is; its minimum and maximum values are used to map the tagβs range to the particle listβs range. π§minβ int Β· Req: no. If present this will be used as a lower bound instead of the tagβs minimum value. Tag values falling outside the defined range will get clamped tomin/max. πmaxβ int Β· Req: no. If present this will be used as an upper bound instead of the tagβs maximum value. Tag values falling outside the defined range will get clamped tomin/max. π
β¨ EXAMPLES β¨
content:
ramp:
tag: capacity
items:
- string: {text: ο}
- string: {text: ο}
- string: {text: ο}
- string: {text: ο}
- string: {text: ο}
π PROGRESS-BAR π
This particle renders a range tagβs value as a progress bar. You control the looks of it by defining the particles to use for the progress barβs start and end, its size, which particles to use for the range that has been completed, the range that has yet to be completed, and the particle to use as the progress barβs current value indicator. Itβs a whole aesthetic. π¨
This particle also supports realtime tags, and will then auto-update itself when needed. No cap. β±οΈ
βοΈ CONFIGURATION βοΈ
tagβ string Β· Req: yes. The range or realtime tag (name of) which value will be used as the progress barβs value.lengthβ int Β· Req: yes. The size/length of the progress bar, in characters. Note that the start, end and indicator particles are not included. πstartβ particle Β· Req: yes. The progress barβs starting character.endβ particle Β· Req: yes. The progress barβs ending character.fillβ particle Β· Req: yes. Particle to use in the completed range.emptyβ particle Β· Req: yes. Particle to use in the not-yet-completed range.indicatorβ particle Β· Req: yes. Particle representing the progress barβs current value.
β¨ EXAMPLES β¨
content:
progres-bar:
tag: tag_name
length: 20
start: {string: {text: β}}
end: {string: {text: β€}}
fill: {string: {text: β}}
empty: {string: {text: β}}
indicator: {string: {text: βΌ}}
Bestie, the example key is literally progres-bar β keep it exactly like that if you copy this. π
π SEE ALSO π
Go peek at yambar-tags(5) and yambar-decorations(5) too, bestie π«Ά
Thatβs the tea β β source/version yambar-particles(5), dated 2024-04-22. Byeee, go make your bar cute ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms