I want to configure polybar to use a module separator with a foreground that's different from the regular bar foreground. Example:

I tried to use the following in my bar section but that didn't work:
separator = "|"
separator-padding = 1
separator-foreground = ${colors.foreground-alt}
So, as a workaround, I added the following simple text module:
; Workaround for using a module separator with a different foreground color than
; the one defined for the whole bar.
[module/sep]
type = custom/text
content = |
content-foreground = ${colors.foreground-alt}
content-padding = 1
And then I add the sep module between every pair of modules, for example:
modules-right = filesystem sep memory sep cpu sep keyboard-layout sep
This worked fine for some time, but recently after upgrading polybar it started printing this error:
error: The module "module/sep" appears multiple times in your modules list. This is deprecated and should be avoided, as it can lead to inconsistent behavior. Both modules will be displayed for now.
I traced this back to #1534
I don't want my config to break in a future upgrade, hence I opened this issue to ask how to handle this.
Thanks!
CC @patrick96
I do this by simply setting separator = %{F#RRGGBB}|%{F-} (see https://github.com/polybar/polybar/wiki/Formatting#foreground-color-f)
Thanks @pcb060 that works well!
That is an interesting usecase that I didn't think about when I wrote #1534. I now made the module separator a label, so that separator-foreground and so on work. I will upload that shortly.
Most helpful comment
I do this by simply setting
separator = %{F#RRGGBB}|%{F-}(see https://github.com/polybar/polybar/wiki/Formatting#foreground-color-f)