diff --git a/.config/i3blocks/block.py b/.config/i3blocks/block.py index 7f2b9fa..2d99ff9 100644 --- a/.config/i3blocks/block.py +++ b/.config/i3blocks/block.py @@ -1,3 +1,4 @@ +import html import os BTN_LEFT = 1 @@ -77,6 +78,9 @@ class Block: text=text, )) + def safe_text(self, text): + return html.escape(text) + def set_icon(self, icon): """ Overwrites the icon speicfied in constructor diff --git a/.config/i3blocks/spotify b/.config/i3blocks/spotify index 6fae62b..4d47d77 100755 --- a/.config/i3blocks/spotify +++ b/.config/i3blocks/spotify @@ -50,10 +50,10 @@ class Spotify(Block): 'Metadata', ) - return "{} - {}".format( + return self.safe_text("{} - {}".format( meta.get('xesam:artist')[0], meta.get('xesam:title'), - ) + )) def main():