Add niri-taskbar widget for vibepanel#96
Conversation
|
Thank you for the contribution! There is a couple of things I'd like to sort out before being comfortable with bringing this into the codebase though. First of all, the Secondly, the widget is called Lastly, I'd like the config options to be singular instead of plural, i.e Let me know if you want assistance with any of this. |
- Rename niri_taskbar widget to taskbar for compositor-agnostic naming - Make WindowListService event-driven via callback instead of polling - Change config options to singular: show_title, show_icon - Set show_title default to false (icons only by default) - Add WindowListCallback type and set_window_list_callback to trait - Implement event-driven window list updates in NiriBackend - Add register_window_list_callback to CompositorManager All 350 tests pass.
22b3337 to
d08a123
Compare
|
Add new commit |
- Sort taskbar buttons by workspace index, layout position, then window ID to match niri's visual window order - Handle WindowLayoutsChanged events for live reorder when moving columns - Fix JSON parsing for WindowLayoutsChanged (Vec of tuples, not object) - Remove manual spacers that caused double spacing with existing CSS gap - Add hover/active CSS for taskbar buttons using padding+negative-margin - Update window title labels on state change without full rebuild - Remove stale "Niri" references from doc comments
- icon_size option (default: theme pixmap_icon_size, min 8px, max bar-constrained) - show_active option (default: true) to toggle focused-window highlight - Per-button CssProvider with proportional padding (icon_size/4, min 3px) - Border radius follows widget_radius_percent from theme - Icon shrinks only when needed to fit within bar constraints
|
Thanks :) I went ahead and pushed two commits on top of yours. The first one fixes a few things that were bugging me. Window ordering is now deterministic, buttons are sorted by workspace index, then layout position, then window ID so they match niri's visual order, same as niri-taskbar. I also fixed so icons reorder live when you move windows around and there's now basic hover/active CSS for the buttons. The second commit adds |
… multi-monitor sorting - Add workspace and output separators with distinct visual styles - Fix focused window tracking (clear stale is_focused on new focus) - Smart max_windows: swap focused window into last visible slot - Simplify spacing by eliminating negative margins - Extract TaskbarLayout struct, shared CssProvider, CONTENT_PADDING_X - Sort windows by output, workspace index, layout position, then ID - Trigger window list callback on workspace changes
|
Pushed one more commit on top that addresses remaining rough edges:
I'm happy with where this is at now and will merge it. Thanks again for the contribution! |
This commit adds a taskbar widget that displays all open windows on the monitor, similar to niri-taskbar for Waybar.
Features:
New files:
Modified files:
Usage in config.toml:
[[widgets]]
name = niri_taskbar
type = niri_taskbar
[widgets.niri_taskbar]
show_titles = true
show_icons = true
max_windows = 10
filter_by_output = true