polybar/modules/mail: escape html in notifications
This commit is contained in:
parent
a4af4eb308
commit
103884bcda
|
@ -5,6 +5,7 @@ import email
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
import html
|
||||||
from shlex import quote
|
from shlex import quote
|
||||||
|
|
||||||
ICON = ""
|
ICON = ""
|
||||||
|
@ -41,7 +42,7 @@ def recent_messages(address, password):
|
||||||
def notify(sender, subject):
|
def notify(sender, subject):
|
||||||
if not sender[0].isalnum() and "<" in sender:
|
if not sender[0].isalnum() and "<" in sender:
|
||||||
sender = sender.split("<")[1].split(">")[0]
|
sender = sender.split("<")[1].split(">")[0]
|
||||||
os.system("/usr/bin/notify-send {} {}".format(quote("<b>{}</b>".format(sender)), quote(subject)))
|
os.system("/usr/bin/notify-send {} {}".format(quote("<b>{}</b>".format(html.escape(sender))), quote(html.escape(subject))))
|
||||||
|
|
||||||
def ding():
|
def ding():
|
||||||
os.system("/usr/bin/aplay -N -q '{}'".format(os.path.expanduser("~/.config/polybar/sounds/robinhood76-music-box.wav")))
|
os.system("/usr/bin/aplay -N -q '{}'".format(os.path.expanduser("~/.config/polybar/sounds/robinhood76-music-box.wav")))
|
||||||
|
|
Loading…
Reference in a new issue