diff options
| author | Mike Vink <ivi@vinkies.net> | 2023-10-23 19:55:32 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2023-10-23 19:55:38 +0200 |
| commit | ff3a22f0076298282c63f416993c929b23fb5b6f (patch) | |
| tree | 72c4ff966992e2c9c503477bd0c4247fe5473470 /mut/bin | |
| parent | bf110465f731976b4b4d8d584a4b6378bb9c865a (diff) | |
packages
Diffstat (limited to 'mut/bin')
| -rwxr-xr-x | mut/bin/notmuch-hook | 6 | ||||
| -rwxr-xr-x | mut/bin/sb-mailbox | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mut/bin/notmuch-hook b/mut/bin/notmuch-hook index 0e49783..147559e 100755 --- a/mut/bin/notmuch-hook +++ b/mut/bin/notmuch-hook @@ -4,7 +4,8 @@ notmuch tag -new +unread +jobs -- 'tag:new and (from:jobs-listings* or from:jobs notmuch tag -new +unread +houses -- 'tag:new and (from:"'$MAKELAAR'" or thread:{'$MAKELAAR'})' notmuch tag -new +unread +dev -- 'tag:new and (from:/.*github.com/ or thread:{from:/.*github.com/})' -notmuch tag +inbox +unread -- tag:new +# New needs to be removed, otherwise it will re add inbox unread +notmuch tag -new +inbox +unread -- tag:new # Gmail + mbsync = a lot of duplicates due to the archive notmuch tag -new -inbox +archive -- 'folder:/Archive/ -folder:/Inbox/ -folder:/\[Gmail\]/ -folder:/FarDrafts/ -folder:/Important/ -folder:/Sent/' @@ -19,3 +20,6 @@ notmuch tag --remove-all +spam -- folder:/Spam/ or folder:/Junk/ # Remove files of messages that were tagged but still have files left behind in the mailbox, should be fine since gmail already keeps a duplicate in the Archive so the message will not be deleted only one file of the message # TODO(): make this work with non gmail emails too # notmuch search --output=files -- 'folder:/Inbox/ -tag:inbox' | grep Inbox | xargs >/dev/null 2>&1 rm + +# update dwmblocks mail module +pkill -RTMIN+12 dwmblocks diff --git a/mut/bin/sb-mailbox b/mut/bin/sb-mailbox index ca77f5c..8fd2d5b 100755 --- a/mut/bin/sb-mailbox +++ b/mut/bin/sb-mailbox @@ -13,7 +13,9 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" +# NOTE(): can't figure out why this one doesn't work, emails don't end up in new folder always +# unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" +unread="$(notmuch search tag:inbox and tag:unread | wc -l 2>/dev/null)" pidof mbsync >/dev/null 2>&1 && icon="🔃" |
