Implement configurable component locations in bar

This allows the user to configure which component (title, wm_info, clock)
is rendered to which part of the bar (left, right, center).

You can also use `none` to hide the location.
This commit is contained in:
Ben Buhse 2026-02-27 11:33:50 -06:00
commit 040ccc14f3
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
5 changed files with 104 additions and 68 deletions

View file

@ -126,9 +126,8 @@ do not re-trigger rules.
## Bar
The bar is an optional widget that shows the focused window title on the left,
the date/time in the center, and layout info (primary count/ratio and visible
window count) on the right. It is only created when a `bar` block is present in
The bar is an optional widget that displays configurable components in three
slots: left, center, and right. It is only created when a `bar` block is present in
the config. All settings have defaults, with the color based on the Catppuccin
Mocha theme. An empty block can be used to enable the widget with all defaults:
@ -145,9 +144,12 @@ bar {
| `text_color` | color | `0xcdd6f4` | Text color |
| `background_color` | color | `0x1e1e2e` | Background color |
| `position` | enum | `top` | Bar position (`top` or `bottom`) |
| `left` | enum | `title` | Component in the left slot (`title`, `clock`, `wm_info`, `none`) |
| `center` | enum | `clock` | Component in the center slot (`title`, `clock`, `wm_info`, `none`) |
| `right` | enum | `wm_info` | Component in the right slot (`title`, `clock`, `wm_info`, `none`) |
| `vertical_padding` | u8 | `5` | Vertical padding above and below text |
| `horizontal_padding` | u8 | `5` | Horizontal padding between bar edges and text |
| `time_format` | string | `%Y-%m-%d %H:%M, %A` | strftime format string for the clock display (an empty string hides the clock) |
| `time_format` | string | `%Y-%m-%d %H:%M, %A` | strftime format string for the clock display |
### Margins