feat(wlr/taskbar): add truncate option to ellipsize long button text
#4545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optional boolean
truncateto thewlr/taskbarmodule. When enabled, task button text is ellipsized (… at the end) whenever the label would exceed the button's available width. This keeps the taskbar tidy when window titles are long or when space is tight. It will fix issue #3770 forwlr/taskbar.Configuration
It is off by default and enabling requires:
Screenshots
Before: different length of taskbar button label.

After: with

"truncate": true(visuals depend on theme and spacing).Before: huge amount of taskbar buttons.

After: with

"truncate": "true"Docs
truncatekey to thewlr/taskbarmodule documentation with accepted values and defaults.Testing
Motivation
Long window titles can cause layout jitter or overflow in the taskbar. Providing a first-class switch to ellipsize labels gives users a simple, predictable way to keep the module compact, regardless of how many tasks are present or how verbose their titles are.