Mail-CLI-dotfiles/.local/bin/mailnotify

13 lines
383 B
Plaintext
Raw Permalink Normal View History

2020-08-30 18:10:18 +02:00
#!/bin/sh
SEARCH=${1:-"tag:new"}
SORT="newest-first"
for row in $(notmuch search --format=json --output=summary --sort="$SORT" "$SEARCH" | jq -r '.[] | @base64'); do
_jq() {
echo ${row} | base64 --decode | jq -r ${1}
}
notify-send -i "applications-email-panel" "$(_jq '.subject')" "$(_jq '.authors') - $(_jq '.matched')/$(_jq '.total')\
\n$(_jq '-j .tags')"
done