Concepts
oatbar configuration is built around four main concepts that work together to display information.
- Bar (
[[bar]]): The top-level window and layout container. - Block (
[[block]]): Visual widgets (text, images, graphs) displayed on the bar. - Command (
[[command]]): External programs that fetch data. - Variable (
[[var]]): Named data holders populated by commands and used by blocks.
Data Flow
- Command runs (e.g.,
date) and outputs text. oatbarparses the output and updates a Variable (e.g.,${clock:value}).- Block references the variable in its
valueproperty (e.g.,value="Time: ${clock:value}"). - Bar re-renders the block with the new text.
Variable Interpolation
String properties in blocks support variable interpolation using the ${...} syntax.
Syntax
- Basic:
${command_name:variable_name} - With Property:
${command_name:variable_name.property}(for complex data like i3bar JSON). - Filters:
${variable|filter:arg}(e.g.,${cpu|align:>3}).
Example
[[command]]
name="clock"
command="date +%H:%M"
interval=60
[[block]]
name="my_clock"
type="text"
value="Time: ${clock:value}"
Debugging
Use oatctl to inspect the current state of variables and blocks.
# List all active variables and their values
oatctl var ls