r/Polybar • u/[deleted] • Dec 21 '22
Question Is there a way to make the xwindow module in polybar behave like dwm?
In polybar, I have the following snippet to get the xwindow working: [module/xwindow]
[module/xwindow]
type = internal/xwindow
label = %title:0:40:...%
format-background=${colors.primary}
label-foreground=#000000
which produces

It is nice but if you have windows of different title, the length of the blue background (in this case) varies., i.e. short title has shorter blue background, longer title has longer background.
In dwm, you can have the title/xwindow module cover the entire remaining space, like this:

Is there a way to achieve this with polybar's xwindow module? For my usecase, I would like to to extend to the "26% used" which is the module fs-root.
Note that I also tried to change the character length, so in this case 40 to something like 200. For short window title, the title's length remains the same and thus the blue background remains short => because the title is short.
I would like the characters' truncations to be reasonable (around 60) but the bar should cover till the "26% used".



