[mail] don't notify if no email
This commit is contained in:
@ -8,11 +8,12 @@ new_mail_list = json.loads(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
output = "Mail's here!\n\n"
|
if new_mail_list:
|
||||||
for message in new_mail_list:
|
output = "Mail's here!\n\n"
|
||||||
msg = message[0][0]
|
for message in new_mail_list:
|
||||||
dt = msg['headers']['Date']
|
msg = message[0][0]
|
||||||
subj = msg['headers']['Subject']
|
dt = msg['headers']['Date']
|
||||||
output += f"{dt}\n{subj}\n\n"
|
subj = msg['headers']['Subject']
|
||||||
|
output += f"{dt}\n{subj}\n\n"
|
||||||
|
|
||||||
subprocess.run(["dunstify", output])
|
subprocess.run(["dunstify", output])
|
||||||
|
|||||||
Reference in New Issue
Block a user