Closed cnotis82 closed 2 years ago
Sorry for missing this question for such a long time. I first thought that it is not possible, but I think I have an idea how it could be accomplished.
I've now added click-support to ConkyGenerator
, you can see an example in my config.py
. Note that it only works, if you directly pass ConkyGenerator
to the ConkyWidget
(without calling str()
on ConkyGenerator
).
Example-snippet:
from barpyrus import conky
# [...]
def spawn_htop(button):
subprocess.call(['urxvt', '-e', 'htop'])
cg = conky.ConkyGenerator(lemonbar.textpainter())
with cg.clickable([1], spawn_htop):
with cg.temp_fg('#B7CE42'):
cg.symbol(0xe026);
cg += ' '; cg.var('cpu'); cg += '% '
with cg.temp_fg('#6F99B4'):
cg.symbol(0xe021);
cg += ' '; cg.var('memperc'); cg += '% '
# [...]
bar = lemonbar.Lemonbar(geometry=(10,10,800,20))
bar.widget = W.ListLayout([
W.RawLabel('%{l}'),
conky.ConkyWidget(cg),
])
It is a great bar for herbstluftwm. I would like to ask you if it is possible to add clickable areas on conky items.