19 lines
396 B
Python
Executable File
19 lines
396 B
Python
Executable File
import json
|
|
import subprocess
|
|
|
|
new_mail_list = json.loads(
|
|
subprocess.check_output(
|
|
["notmuch", "show", "--format=json", "tag:inbox"],
|
|
).decode('utf-8')
|
|
)
|
|
|
|
|
|
output = "Mail's here!\n\n"
|
|
for message in new_mail_list:
|
|
msg = message[0][0]
|
|
dt = msg['headers']['Date']
|
|
subj = msg['headers']['Subject']
|
|
output += f"{dt}\n{subj}\n\n"
|
|
|
|
subprocess.run(["dunstify", output])
|