diff --git a/notify-mail.hy b/notify-mail.hy index 32d3758..7d8f1fe 100755 --- a/notify-mail.hy +++ b/notify-mail.hy @@ -100,7 +100,7 @@ 0 (msg.tag "-unread") 1 (do (setv global-did-delete True) - (msg.tag "-unread") + (msg.tag "-unread" "+deleted") (msg.move "Trash"))))) (let [mail-root (get (notmuch "config" "get" "database.mail_root" @@ -117,5 +117,4 @@ (notmuch "tag" "-notnotified" "*") (when global-did-delete - (notmuch "tag" "+deleted" "folder:Trash") (notmuch "new" "--no-hooks")) diff --git a/notmuch-mbsync-refresh.sh b/notmuch-mbsync-refresh.sh index 043385b..56d7cfb 100755 --- a/notmuch-mbsync-refresh.sh +++ b/notmuch-mbsync-refresh.sh @@ -1,6 +1,5 @@ #!/usr/bin/env zsh -~/scripts/notmuch-pre.sh mbsync -a notmuch new ~/scripts/notmuch-post.sh diff --git a/notmuch-post.sh b/notmuch-post.sh index 308b7cd..6bd6248 100755 --- a/notmuch-post.sh +++ b/notmuch-post.sh @@ -9,5 +9,3 @@ notmuch tag +spam folder:Spam notmuch tag -starred not folder:Starred hy ~/scripts/notify-mail.hy - -notmuch tag +deleted folder:Trash diff --git a/notmuch-pre.sh b/notmuch-pre.sh deleted file mode 100755 index ef79d92..0000000 --- a/notmuch-pre.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env zsh - -local mail_root="$(notmuch config get database.mail_root)" - -# copy-by-query [query...] -copy-by-query() { - for old_file in $(notmuch search --output=files not folder:Starred \ - and not folder:Sent \ - and not folder:Drafts \ - and not folder:"${1}" and ${@:2}); do - local name="$(basename "${old_file}")" - local new_file="${mail_root}/${1}/cur/${name}" - cp "${old_file}" "${new_file}" - done -} - -copy-by-query Starred tag:starred