Skip to content
Mathilde Gilles edited this page Jul 3, 2020 · 10 revisions

bar3x Uses a markup language base on XML to describe its UI. The language is kept intentionally simple, with each element having a specific purpose.

Variables

Variables, as well as basic operations, can be used as elements properties or content. To use such expressions, surround them by curly braces. This is useful to adapt modules and themes to user config.

Note that custom variables can be added to the config and used in the markup so that theme creators can give additional switches and knobs to users using their themes.

Variables can also be declared, overridden per element and their children, allowing to change aspects of specific parts of the bar.

Examples

Variable and mathematical operations

<Graph Height="{bar_height / 2 - v_padding}" />

Conditinal

<Bar Visible="{bar_height > 20}" />

New local variable

<Row ctx:txt_width="50">
  ...
  <Text Width="{txt_width}">Part 1</Text>
  <Icon>-</Icon>
  <Text Width="{txt_width}">Part 2</Text>
</Row>

Override variable locally

<ModuleRow ctx:accent_color="#ff0000">
  <DateTime />
</ModuleRow>

Clone this wiki locally