update
This commit is contained in:
parent
a18d8d744a
commit
a8c341aad1
@ -6,7 +6,7 @@
|
|||||||
# Last Modified By : Jeff LANCE <email@jefflance.me>
|
# Last Modified By : Jeff LANCE <email@jefflance.me>
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
ASTROID_BIN=$(which astroid)
|
ASTROID_BIN=$(which astroid)
|
||||||
NOTMUCH_BIN=$(which notmuch)
|
NOTMUCH_BIN=$(which notmuch)
|
||||||
NOTIFY_BIN=$(which notify-send)
|
NOTIFY_BIN=$(which notify-send)
|
||||||
@ -15,18 +15,18 @@ NOTIFY_BIN=$(which notify-send)
|
|||||||
function notify() {
|
function notify() {
|
||||||
# count new mails and display a message
|
# count new mails and display a message
|
||||||
newcount=$(${NOTMUCH_BIN} count tag:new)
|
newcount=$(${NOTMUCH_BIN} count tag:new)
|
||||||
summary="Tu as reçu ${newcount} new message"
|
summary="Tu as reçu ${newcount} message"
|
||||||
|
|
||||||
# come on, who here doesn't actually hate "you have 1 new message(s)"?
|
# come on, who here doesn't actually hate "you have 1 new message(s)"?
|
||||||
if [ $newcount -gt 1 ]; then
|
if [ $newcount -gt 1 ]; then
|
||||||
summary="${summary}s"
|
summary="${summary}s"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $newcount -gt 0 ]; then
|
if [ $newcount -gt 0 ]; then
|
||||||
detail="$(${NOTMUCH_BIN} search --output=summary --format=json tag:new \
|
detail="$(${NOTMUCH_BIN} search --output=summary --format=json tag:new \
|
||||||
| sed -e 's/.*authors": "//;s/|[^"]*"/"/;s/", "subject": "/ : /;s/".*//')"
|
| sed -e 's/.*authors": "//;s/|[^"]*"/"/;s/", "subject": "/ : /;s/".*//')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${newcount} -gt 0 ]; then
|
if [ ${newcount} -gt 0 ]; then
|
||||||
${NOTIFY_BIN} \
|
${NOTIFY_BIN} \
|
||||||
-i /usr/share/notify-osd/icons/hicolor/scalable/status/notification-message-email.svg \
|
-i /usr/share/notify-osd/icons/hicolor/scalable/status/notification-message-email.svg \
|
||||||
@ -34,13 +34,6 @@ function notify() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refresh_ui() {
|
|
||||||
# refresh astroid ui
|
|
||||||
${ASTROID_BIN} --refresh 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# some additional tags
|
# some additional tags
|
||||||
${NOTMUCH_BIN} tag --input=${HOME}/Mail/.notmuch/tagupdate
|
${NOTMUCH_BIN} tag --input=${HOME}/Mail/.notmuch/tagupdate
|
||||||
|
|
||||||
@ -52,15 +45,8 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# run afew on mew mails and make moves
|
# run afew on mew mails and make moves
|
||||||
afew --tag --new
|
# afew --tag --new
|
||||||
afew --move-mails
|
# afew --move-mails
|
||||||
|
|
||||||
|
|
||||||
if [ "x${DISPLAY}" != "x" ]; then
|
|
||||||
logger -t notmuch "post-new: refresh_ui"
|
|
||||||
refresh_ui
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
@ -5,10 +5,6 @@
|
|||||||
# Last Modified Date: 01.03.2021
|
# Last Modified Date: 01.03.2021
|
||||||
# Last Modified By : Jeff LANCE <email@jefflance.me>
|
# Last Modified By : Jeff LANCE <email@jefflance.me>
|
||||||
|
|
||||||
|
|
||||||
ASTROID_BIN=$(which astroid)
|
|
||||||
|
|
||||||
|
|
||||||
# purging trash
|
# purging trash
|
||||||
notmuch search --output=files --format=text0 \
|
notmuch search --output=files --format=text0 \
|
||||||
-- tag:deleted date:...7d | xargs -0 --no-run-if-empty rm
|
-- tag:deleted date:...7d | xargs -0 --no-run-if-empty rm
|
||||||
|
@ -10,11 +10,10 @@ path=/home/jeff/Mail
|
|||||||
[user]
|
[user]
|
||||||
name=Jeff LANCE
|
name=Jeff LANCE
|
||||||
primary_email=jeff.lance@mala.fr
|
primary_email=jeff.lance@mala.fr
|
||||||
other_email=jean-francois.lance@ac-creteil.fr;games@mala.fr;mathslance@gmail.com
|
|
||||||
|
|
||||||
[new]
|
[new]
|
||||||
tags=new;
|
tags=new;
|
||||||
ignore=.mbsyncstate;.isyncuidmap.db;.uidvalidity;.mbsyncstate.journal;.mbsyncstate.new;.mbsyncstate.lock;/.*[.](json|lock|bak)$/;
|
ignore=.mbsyncstate;.isyncuidmap.db;.uidvalidity;.mbsyncstate.journal;.mbsyncstate.new;.mbsyncstate.lock;/.*[.](json|lock|bak)$/;.templates;
|
||||||
|
|
||||||
[search]
|
[search]
|
||||||
exclude_tags=
|
exclude_tags=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user