config: barpyrus: config.py: add conky_icon function for easy formatting
In order to not having to repeat the same string sequence over and over again there now is a helper method which does exactly this.
This commit is contained in:
parent
e31c496951
commit
35d203b5cd
1 changed files with 6 additions and 0 deletions
|
|
@ -46,6 +46,12 @@ color = {
|
||||||
def frame(content, bg, fg, padding = (3, 3)):
|
def frame(content, bg, fg, padding = (3, 3)):
|
||||||
return Theme(bg = color[bg], fg = color[fg], padding = padding)(content)
|
return Theme(bg = color[bg], fg = color[fg], padding = padding)(content)
|
||||||
|
|
||||||
|
# function to insert colored icon into conky_text
|
||||||
|
def conky_icon(icon_code, icon_color, text_color = 'lightgrey'):
|
||||||
|
text = '%{F\\' + color[icon_color] + '}%{T2}' + icon_code + '%{T-}'
|
||||||
|
text += '%{F\\' + color[text_color] + '}'
|
||||||
|
return text
|
||||||
|
|
||||||
# conky specific configuration
|
# conky specific configuration
|
||||||
conky_text = ''
|
conky_text = ''
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue