Closed jsav0 closed 3 years ago
They are hard-wired to use the colors https://github.com/t-wissmann/barpyrus/blob/master/barpyrus/colors.py which you can modify:
import colors
colors.BG1 = 'red'
Perfect. thanks
They are hard-wired to use the colors https://github.com/t-wissmann/barpyrus/blob/master/barpyrus/colors.py which you can modify:
import colors colors.BG1 = 'red'
I imagine it needs to be:
from barpyrus import colors
i'm making the change in myconfig.py
, but that doesn't appear to affect a color change of the tags either. They are still defaulting to the hardcoded colors.
Ah. Due to lack of time, I can't look into it right now. But the following should work and is in fact more flexible:
Define a function in your config.py
that renders a tag, e.g. I have:
def simple_tag_renderer(self, painter): # self is a HLWMTagInfo object
self.activecolor = '#86AB5F'
if self.empty:
return
#painter.ol('#ffffff' if self.focused else None)
painter.set_flag(painter.underline, True if self.visible else False)
painter.fg('#a0a0a0' if self.occupied else '#909090')
if self.urgent:
painter.ol('#FF7F27')
painter.fg('#FF7F27')
painter.set_flag(painter.underline, True)
painter.bg('#57000F')
elif self.here:
painter.fg('#ffffff')
painter.ol(self.activecolor if self.focused else '#ffffff')
painter.bg(self.emphbg)
else:
painter.ol('#454545')
painter.space(1)
painter += self.name
painter.space(1)
painter.bg()
painter.ol()
painter.set_flag(painter.underline, False)
painter.space(1)
And in the widget list of the bar
, you can then pass it to the HLWMTags
widget:
hlwm.HLWMTags(hc, monitor, tag_renderer = simple_tag_renderer),
Thanks for sharing, I'll try that out
the solution worked great. Thanks
Thanks for your feedback!
The custom color theme function does not seem to affect HLWMTags like it does the other elements.
How can the tag colors be changed?