I propose to allow the setting of min_width property (swaybar JSON protocol) to a negative value in order to expand the element to take all available horizontal screen space. This should be fairly trivial to implement and I'd be eager to submit a PR if this gets approved.
Currently, it's possible to achieve a similar result for a certain element by subtracting the total width of all other elements (which can be easily calculated if the font is monospaced) from the width of the screen and appending the required amount of spaces before or after the full_text of the element that I want to expand. Obviously, this is very hacky, does not align well, and breaks if elements use different font families or sizes.
This change will not introduce any incompatible functionality since currently a negative value of min_width is simply ignored. I suggest putting this value to a good use and letting swaybar elements nicely occupy all available horizontal space, not just the right side.
TL;DR
Let's treat the negative min_width value of elements that use swaybar JSON protocol to take all available horizontal space.
Description:
I propose to allow the setting of
min_width
property (swaybar JSON protocol) to a negative value in order to expand the element to take all available horizontal screen space. This should be fairly trivial to implement and I'd be eager to submit a PR if this gets approved.Currently, it's possible to achieve a similar result for a certain element by subtracting the total width of all other elements (which can be easily calculated if the font is monospaced) from the width of the screen and appending the required amount of spaces before or after the
full_text
of the element that I want to expand. Obviously, this is very hacky, does not align well, and breaks if elements use different font families or sizes.This change will not introduce any incompatible functionality since currently a negative value of
min_width
is simply ignored. I suggest putting this value to a good use and letting swaybar elements nicely occupy all available horizontal space, not just the right side.TL;DR
min_width
value of elements that use swaybar JSON protocol to take all available horizontal space.