diff --git a/core/output.py b/core/output.py index 3e3135e..064cc36 100644 --- a/core/output.py +++ b/core/output.py @@ -23,7 +23,7 @@ class block(object): __COMMON_THEME_FIELDS = [ 'separator', 'separator-block-width', 'default-separators', 'border-top', 'border-left', 'border-right', 'border-bottom', - 'pango', 'fg', 'bg', 'padding', 'prefix', 'suffix' + 'fg', 'bg', 'padding', 'prefix', 'suffix' ] def __init__(self, theme, module, widget): self.__attributes = {} @@ -39,6 +39,26 @@ class block(object): def set(self, key, value): self.__attributes[key] = value + def is_pango(self, attr): + if isinstance(attr, dict) and 'pango' in attr: + return True + return False + + def pangoize(self, text): + if not self.is_pango(text): + return text + self.__attributes['markup'] = 'pango' + attr = dict(text['pango']) + text = attr.get('full_text', '') + if 'full_text' in attr: + del attr['full_text'] + + result = '