summaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/notmuch-delete.sh6
-rwxr-xr-xbin/notmuch-gnus-tags.sh20
-rwxr-xr-xbin/notmuch-tags.sh109
3 files changed, 135 insertions, 0 deletions
diff --git a/bin/notmuch-delete.sh b/bin/notmuch-delete.sh
new file mode 100755
index 0000000..fc230a5
--- /dev/null
+++ b/bin/notmuch-delete.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+# [[file:../mail.org::*delete shell script][delete shell script:1]]
+echo "Deleting $(notmuch count tag:deleted) files"
+notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm
+notmuch new 2>&1
+# delete shell script:1 ends here
diff --git a/bin/notmuch-gnus-tags.sh b/bin/notmuch-gnus-tags.sh
new file mode 100755
index 0000000..23e1358
--- /dev/null
+++ b/bin/notmuch-gnus-tags.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# [[file:../mail.org::*notmuch tags][notmuch tags:1]]
+notmuch new
+[[ $1 ]] && notmuch compact
+
+for b in ~/.emacs.d/gnus/Mail/*; do
+ b="${b##*/}"
+ e="${b##*.}"
+ b="${b%.*}"
+ if [[ $e != $b ]]; then
+ notmuch tag "+$b" "+$e" -- tag:new and "folder:\"/(gnus/)?$b.$e/\"";
+ else
+ notmuch tag "+$b" -- tag:new and "folder:\"/(gnus/)?$b/\"";
+ fi
+done
+
+notmuch-tags.sh
+
+notmuch tag +trove folder:/trove/ and not tag:trove
+# notmuch tags:1 ends here
diff --git a/bin/notmuch-tags.sh b/bin/notmuch-tags.sh
new file mode 100755
index 0000000..3a6cbef
--- /dev/null
+++ b/bin/notmuch-tags.sh
@@ -0,0 +1,109 @@
+#!/bin/bash
+
+for f in local feeds bigml jao; do
+ notmuch tag +$f -- tag:new and folder:$f
+done
+function tag_list () {
+ x=${2:-$1}
+ notmuch tag "+$1" -prog -drivel +lists "$3" "$4" -- "tag:new AND (List:$x OR Xref:$x)"
+}
+
+for l in clojure elixir idris haskell erlang pharo; do
+ tag_list $l
+done
+
+tag_list idris idris2
+tag_list pharo 6f667565c2569234585a7be77mc
+
+for l in haskellweekly commercialhaskell agda xmonad caml; do
+ tag_list haskell $l
+done
+
+for l in xmobar notmuch mailutils lobsters; do
+ tag_list $l
+done
+
+for l in kawa chicken guile gambit scheme chez racket; do
+ tag_list scheme $l
+done
+
+# emacsy lists
+for l in emacs-orgmode ding bbdb info-gnus-english; do
+ tag_list emacs $l
+done
+
+for l in emacs-devel emacs-diffs; do
+ tag_list $l $l -emacs
+ notmuch tag "+$l" -emacs -prog -- tag:new AND to:$l
+done
+
+tag_list emacs-bugs bug-gnu-emacs -emacs
+tag_list emacs-help help-gnu-emacs -emacs
+
+for l in consult embark vertico marginalia orderless corfu; do
+ tag_list emacs-github $l -emacs
+done
+
+tag_list hacking info-gnu
+tag_list mdk bug-mdk -hacking
+tag_list geiser geiser -scheme -emacs
+function tag_bigml {
+ query="(tag:bigml from:@bigml or to:@bigml) and tag:new and $1"
+ shift
+ notmuch tag -inbox $* -- $query
+}
+
+function tag_drivel {
+ for f in $*; do
+ tag_bigml "from:\"/.*($f).*/\"" +drivel -lists -deploys;
+ done
+}
+
+tag_bigml "tag:new" +bigml -jao
+tag_bigml "from:/.*uk/" +alba -drivel
+tag_bigml "from:mbmcommercial" +alba -drivel
+tag_bigml "to:info@bigml or from:/info/" +drivel
+
+tag_bigml "List:bigmlcom" +lists
+tag_bigml "List:whizzml" +lists
+tag_bigml "List:github" +lists
+tag_bigml "(List:bigmlcom/wintermute OR List:bigmlcom/universe)" +bugs -lists -drivel
+tag_bigml "List:support OR List:education" +support -inbox -drivel -lists
+tag_bigml "from:\"BigML Support Transcript\"" -new +deleted
+tag_bigml "from:production_reports@bigml.com" +deploys
+
+tag_bigml "subject:\"/.*(Confirmation code|Sameroom).*/\"" +drivel -lists
+tag_drivel "gotowebinar\\.com" "digit\\.fyi" "noreply" "no-reply"
+tag_drivel "slack\\.com" "globalvia\\." "ai-forum\\.com" "gsuite" "google voice"
+tag_drivel "techcrunch\\.com" "demos@" "cognitionx\\." "cogx"
+tag_drivel "events@" "marketing@" "security@" "info@"
+tag_drivel "getrevue.com" "calendar-notification" "ed\\.ac\\.uk"
+function killfile () {
+ notmuch tag -new -unread $2 -- tag:new AND $1
+}
+
+killfile "(tag:spam OR tag:trash)"
+
+killfile "from:incal@dataswamp.org"
+killfile "from:\"Planet Clojure: Eric Normand\""
+killfile "from:\"Planet Clojure: Ivan Grishaev\""
+
+killfile "subject:prefclean from:apt-listbugs"
+killfile "subject:open-thread AND Rss:astralcodexten" +1d
+killfile "subject:hidden-thread AND Rss:astralcodexten" +deleted
+
+# gfeeds="grep -o -e feeds.*@localhost $HOME/.config/rss2email.cfg"
+# for f in $($gfeeds | sort | uniq); do
+# ftag=$(echo $f | sed 's/feeds.\(.*\)@localhost/\1/');
+# notmuch tag +rss +feeds +$ftag -- tag:new AND folder:feeds AND to:$f
+# done
+
+notmuch tag +write +jao -words -drivel -feeds \
+ -- "tag:new AND from:/campusdee?scrip?tura/"
+
+notmuch tag +logwatch -- "tag:new AND subject:logwatch"
+
+notmuch tag +mdk -- subject:mdk
+
+notmuch tag -drivel -new -unread -inbox +sent +jao -- \
+ "tag:new AND from:\"/mail@jao.io|jao@gnu.org|jaor@pm.me/\""