Add window title and wm info to Bar

This commit adds the focused window title to the left side of the bar
and some WM info (primary count/ratio and # of visible/total windows) to
the right side.

It also adds new vertical_padding and horizontal_padding config options
for the bar.
This commit is contained in:
Ben Buhse 2026-02-27 10:42:08 -06:00
commit efd0222899
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
9 changed files with 231 additions and 51 deletions

View file

@ -126,10 +126,11 @@ do not re-trigger rules.
## Bar
The bar is an optional widget that shows the time on your screen. Right now, that's it.
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:
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 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:
```kdl
bar {
@ -140,10 +141,12 @@ bar {
| Setting | Type | Default | Description |
|--------------------|--------|--------------------|-----------------------------------|
| `fonts` | string | `monospace:size=14` | Comma-separated FontConfig fonts |
| `text_color` | color | `0xcdd6f4` | Text color |
| `background_color` | color | `0x1e1e2e` | Background color |
| `position` | enum | `top` | Bar position (`top` or `bottom`) |
| `fonts` | string | `monospace:size=14` | Comma-separated FontConfig fonts |
| `text_color` | color | `0xcdd6f4` | Text color |
| `background_color` | color | `0x1e1e2e` | Background color |
| `position` | enum | `top` | Bar position (`top` or `bottom`) |
| `vertical_padding` | u8 | `5` | Vertical padding above and below text |
| `horizontal_padding` | u8 | `5` | Horizontal padding between bar edges and text |
### Margins

View file

@ -2,15 +2,14 @@
These are in rough order of my priority, though no promises I do them in this order.
- [ ] Add gap support
- [ ] Add build-time options for including the wallpaper (and maybe bar)
- [ ] Check pointer position and only warp if not on focused window already
- [ ] Change focus direction when closing window
- [ ] Use set_xcursor_theme request
- [ ] Support configuring bar item positions (left/center/right)
- [ ] Add focused window title to bar
- [ ] Support overriding config location
- [ ] Add support for center-primary layout
- [ ] Add bar padding to config
- [ ] Support 12-hour clock format (maybe take any time format string?)
- [ ] Support per-output bar visibility
- [ ] Support more window rule options (e.g. ssd/csd)
@ -49,3 +48,5 @@ These are in rough order of my priority, though no promises I do them in this or
- [x] Move orphan handling out of .output and .seat events; into manage()
- [x] Add config for single-window width ratio (mostly because my ultrawide makes a single window massive)
- [x] Support configuring primary vs secondary stack side
- [x] Add focused window title to bar
- [x] Add bar padding to config